-
Notifications
You must be signed in to change notification settings - Fork 235
/
movi_e.py
1673 lines (1573 loc) · 109 KB
/
movi_e.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2024 The Kubric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=line-too-long, unexpected-keyword-arg
import dataclasses
import json
import logging
from typing import Dict, List, Union
from etils import epath
import imageio
import numpy as np
import png
import tensorflow as tf
import tensorflow_datasets.public_api as tfds
_DESCRIPTION = """
A simple rigid-body simulation with GSO objects and an HDRI background.
The scene consists of a dome (half-sphere) onto which a random HDRI is projected,
which acts as background, floor and lighting.
The scene contains between 10 and 20 random static objects, and between 1 and 3
dynamic objects (tossed onto the others).
The camera moves on a straight line with constant velocity.
The starting point is sampled randomly in a half-sphere shell around the scene,
and from there the camera moves into a random direction with a random speed between 0 and 4.
This sampling process is repeated until a trajectory is found that starts and
ends within the specified half-sphere shell around the center of the scene.
The camera always points towards the origin.
Static objects are spawned without overlap in the region [(-7, -7, 0), (7, 7, 10)],
and are simulated to fall and settle before the first frame of the scene.
Dynamic objects are spawned without overlap in the region [(-5, -5, 1), (5, 5, 5)], and
initialized with a random velocity from the range [(-4, -4, 0), (4, 4, 0)]
minus the position of the object to bias their trajectory towards the center of
the scene.
The scene is simulated for 2 seconds, with the physical properties of the
objects kept at the default of friction=0.5, restitution=0.5 and density=1.0.
The dataset contains approx 10k videos rendered at 256x256 pixels and 12fps.
Each sample contains the following video-format data:
(s: sequence length, h: height, w: width)
- "video": (s, h, w, 3) [uint8]
The RGB frames.
- "segmentations": (s, h, w, 1) [uint8]
Instance segmentation as per-pixel object-id with background=0.
Note: because of this the instance IDs used here are one higher than their
corresponding index in sample["instances"].
- "depth": (s, h, w, 1) [uint16]
Distance of each pixel from the center of the camera.
(Note this is different from the z-value sometimes used, which measures the
distance to the camera *plane*.)
The values are stored as uint16 and span the range specified in
sample["metadata"]["depth_range"]. To convert them back to world-units
use:
minv, maxv = sample["metadata"]["depth_range"]
depth = sample["depth"] / 65535 * (maxv - minv) + minv
- "forward_flow": (s, h, w, 2) [uint16]
Forward optical flow in the form (delta_row, delta_column).
The values are stored as uint16 and span the range specified in
sample["metadata"]["forward_flow_range"]. To convert them back to pixels use:
minv, maxv = sample["metadata"]["forward_flow_range"]
depth = sample["forward_flow"] / 65535 * (maxv - minv) + minv
- "backward_flow": (s, h, w, 2) [uint16]
Backward optical flow in the form (delta_row, delta_column).
The values are stored as uint16 and span the range specified in
sample["metadata"]["backward_flow_range"]. To convert them back to pixels use:
minv, maxv = sample["metadata"]["backward_flow_range"]
depth = sample["backward_flow"] / 65535 * (maxv - minv) + minv
- "normal": (s, h, w, 3) [uint16]
Surface normals for each pixel in world coordinates.
- "object_coordinates": (s, h, w, 3) [uint16]
Object coordinates encode the position of each point relative to the objects
bounding box (i.e. back-left-top (X=Y=Z=1) corner is white,
while front-right-bottom (X=Y=Z=0) corner is black.)
Additionally there is rich instance-level information in sample["instances"]:
- "mass": [float32]
Mass of the object used for simulation.
- "friction": [float32]
Friction coefficient used for simulation.
- "restitution": [float32]
Restitution coefficient (bounciness) used for simulation.
- "positions": (s, 3) [float32]
Position of the object for each frame in world-coordinates.
- "quaternions": (s, 4) [float32]
Rotation of the object for each frame as quaternions.
- "velocities": (s, 3) [float32]
Velocity of the object for each frame.
- "angular_velocities": (s, 3) [float32]
Angular velocity of the object for each frame.
- "bboxes_3d": (s, 8, 3) [float32]
World-space corners of the 3D bounding box around the object.
- "image_positions": (s, 2) [float32]
Normalized (0, 1) image-space (2D) coordinates of the center of mass of the
object for each frame.
- "bboxes": (None, 4) [float32]
The normalized image-space (2D) coordinates of the bounding box
[ymin, xmin, ymax, xmax] for all the frames in which the object is visible
(as specified in bbox_frames).
- "bbox_frames": (None,) [int]
A list of all the frames the object is visible.
- "visibility": (s,) [uint16]
Visibility of the object in number of pixels for each frame (can be 0).
- "asset_id": [str] Asset id from Google Scanned Objects dataset.
- "category": ["Action Figures", "Bag", "Board Games",
"Bottles and Cans and Cups", "Camera", "Car Seat",
"Consumer Goods", "Hat", "Headphones", "Keyboard", "Legos",
"Media Cases", "Mouse", "None", "Shoe", "Stuffed Toys", "Toys"]
- "scale": float between 0.75 and 3.0
- "is_dynamic": bool indicating whether (at the start of the scene) the object
is sitting on the floor or is being tossed.
Information about the camera in sample["camera"]
(given for each frame eventhough the camera is static, so as to stay
consistent with other variants of the dataset):
- "focal_length": [float32]
- "sensor_width": [float32]
- "field_of_view": [float32]
- "positions": (s, 3) [float32]
- "quaternions": (s, 4) [float32]
And finally information about collision events in sample["events"]["collisions"]:
- "instances": (2,)[uint16]
Indices of the two instance between which the collision happened.
Note that collisions with the floor/background objects are marked with 65535
- "frame": tf.int32,
Frame in which the collision happenend.
- "force": tf.float32,
The force (strength) of the collision.
- "position": tfds.features.Tensor(shape=(3,), dtype=tf.float32),
Position of the collision event in 3D world coordinates.
- "image_position": tfds.features.Tensor(shape=(2,), dtype=tf.float32),
Position of the collision event projected onto normalized 2D image coordinates.
- "contact_normal": tfds.features.Tensor(shape=(3,), dtype=tf.float32),
The normal-vector of the contact (direction of the force).
"""
_CITATION = """\
@inproceedings{greff2022kubric,
title = {Kubric: a scalable dataset generator},
author = {Klaus Greff and Francois Belletti and Lucas Beyer and Carl Doersch and
Yilun Du and Daniel Duckworth and David J Fleet and Dan Gnanapragasam and
Florian Golemo and Charles Herrmann and Thomas Kipf and Abhijit Kundu and
Dmitry Lagun and Issam Laradji and Hsueh-Ti (Derek) Liu and Henning Meyer and
Yishu Miao and Derek Nowrouzezahrai and Cengiz Oztireli and Etienne Pot and
Noha Radwan and Daniel Rebain and Sara Sabour and Mehdi S. M. Sajjadi and Matan Sela and
Vincent Sitzmann and Austin Stone and Deqing Sun and Suhani Vora and Ziyu Wang and
Tianhao Wu and Kwang Moo Yi and Fangcheng Zhong and Andrea Tagliasacchi},
booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition, {CVPR}},
year = {2022},
publisher = {Computer Vision Foundation / {IEEE}},
}"""
@dataclasses.dataclass
class MoviEConfig(tfds.core.BuilderConfig):
""""Configuration for Multi-Object Video (MoviE) dataset."""
height: int = 256
width: int = 256
num_frames: int = 24
validation_ratio: float = 0.1
train_val_path: str = None
test_split_paths: Dict[str, str] = dataclasses.field(default_factory=dict)
class MoviE(tfds.core.BeamBasedBuilder):
"""DatasetBuilder for MOVi-E dataset."""
VERSION = tfds.core.Version("1.0.0")
RELEASE_NOTES = {
"1.0.0": "initial release",
}
BUILDER_CONFIGS = [
MoviEConfig(
name="256x256",
description="Full resolution of 256x256",
height=256,
width=256,
validation_ratio=0.025,
train_val_path="gs://research-brain-kubric-xgcp/jobs/movi_e_regen_10k/",
test_split_paths={
"test": "gs://research-brain-kubric-xgcp/jobs/movi_e_test_regen_1k/",
}
),
MoviEConfig(
name="128x128",
description="Downscaled to 128x128",
height=128,
width=128,
validation_ratio=0.025,
train_val_path="gs://research-brain-kubric-xgcp/jobs/movi_e_regen_10k/",
test_split_paths={
"test": "gs://research-brain-kubric-xgcp/jobs/movi_e_test_regen_1k/",
}
),
]
def _info(self) -> tfds.core.DatasetInfo:
"""Returns the dataset metadata."""
h = self.builder_config.height
w = self.builder_config.width
s = self.builder_config.num_frames
def get_movi_e_instance_features(seq_length: int):
features = get_instance_features(seq_length)
features.update({
"asset_id": tfds.features.Text(),
"category": tfds.features.ClassLabel(
names=["Action Figures", "Bag", "Board Games",
"Bottles and Cans and Cups", "Camera",
"Car Seat", "Consumer Goods", "Hat",
"Headphones", "Keyboard", "Legos",
"Media Cases", "Mouse", "None", "Shoe",
"Stuffed Toys", "Toys"]),
"scale": tf.float32,
"is_dynamic": tf.bool,
})
return features
return tfds.core.DatasetInfo(
builder=self,
description=_DESCRIPTION,
features=tfds.features.FeaturesDict({
"metadata": {
"video_name": tfds.features.Text(),
"width": tf.int32,
"height": tf.int32,
"num_frames": tf.int32,
"num_instances": tf.uint16,
"depth_range": tfds.features.Tensor(shape=(2,),
dtype=tf.float32),
"forward_flow_range": tfds.features.Tensor(shape=(2,),
dtype=tf.float32),
"backward_flow_range": tfds.features.Tensor(shape=(2,),
dtype=tf.float32),
},
"background": tfds.features.Text(),
"instances": tfds.features.Sequence(
feature=get_movi_e_instance_features(seq_length=s)),
"camera": get_camera_features(s),
"events": get_events_features(),
# -----
"video": tfds.features.Video(shape=(s, h, w, 3)),
"segmentations": tfds.features.Sequence(
tfds.features.Image(shape=(h, w, 1), dtype=tf.uint8),
length=s),
"forward_flow": tfds.features.Sequence(
tfds.features.Tensor(shape=(h, w, 2), dtype=tf.uint16),
length=s),
"backward_flow": tfds.features.Sequence(
tfds.features.Tensor(shape=(h, w, 2), dtype=tf.uint16),
length=s),
"depth": tfds.features.Sequence(
tfds.features.Image(shape=(h, w, 1), dtype=tf.uint16),
length=s),
"normal": tfds.features.Video(shape=(s, h, w, 3), dtype=tf.uint16),
"object_coordinates": tfds.features.Video(shape=(s, h, w, 3),
dtype=tf.uint16),
}),
supervised_keys=None,
homepage="https://github.com/google-research/kubric",
citation=_CITATION)
def _split_generators(self, unused_dl_manager: tfds.download.DownloadManager):
"""Returns SplitGenerators."""
del unused_dl_manager
path = as_path(self.builder_config.train_val_path)
all_subdirs = [str(d) for d in path.iterdir()]
logging.info("Found %d sub-folders in master path: %s",
len(all_subdirs), path)
# shuffle
rng = np.random.RandomState(seed=42)
rng.shuffle(all_subdirs)
validation_ratio = self.builder_config.validation_ratio
validation_examples = max(1, round(len(all_subdirs) * validation_ratio))
training_examples = len(all_subdirs) - validation_examples
logging.info("Using %f of examples for validation for a total of %d",
validation_ratio, validation_examples)
logging.info("Using the other %d examples for training", training_examples)
splits = {
tfds.Split.TRAIN: self._generate_examples(all_subdirs[:training_examples]),
tfds.Split.VALIDATION: self._generate_examples(all_subdirs[training_examples:]),
}
for key, path in self.builder_config.test_split_paths.items():
path = as_path(path)
split_dirs = [d for d in path.iterdir()]
# sort the directories by their integer number
split_dirs = sorted(split_dirs, key=lambda x: int(x.name))
logging.info("Found %d sub-folders in '%s' path: %s",
len(split_dirs), key, path)
splits[key] = self._generate_examples([str(d) for d in split_dirs])
return splits
def _generate_examples(self, directories: List[str]):
"""Yields examples."""
target_size = (self.builder_config.height, self.builder_config.width)
def _process_example(video_dir):
key, result, metadata = load_scene_directory(video_dir, target_size)
# add MoviE-D specific instance information:
for i, obj in enumerate(result["instances"]):
obj["asset_id"] = asset_id_from_metadata(metadata["instances"][i])
obj["category"] = metadata["instances"][i]["category"]
obj["scale"] = metadata["instances"][i]["scale"]
obj["is_dynamic"] = metadata["instances"][i]["is_dynamic"]
return key, result
beam = tfds.core.lazy_imports.apache_beam
return (beam.Create(directories) |
beam.Filter(is_complete_dir) |
beam.Map(_process_example))
DEFAULT_LAYERS = ("rgba", "segmentation", "forward_flow", "backward_flow",
"depth", "normal", "object_coordinates")
def load_scene_directory(scene_dir, target_size, layers=DEFAULT_LAYERS):
scene_dir = as_path(scene_dir)
example_key = f"{scene_dir.name}"
with tf.io.gfile.GFile(str(scene_dir / "data_ranges.json"), "r") as fp:
data_ranges = json.load(fp)
with tf.io.gfile.GFile(str(scene_dir / "metadata.json"), "r") as fp:
metadata = json.load(fp)
with tf.io.gfile.GFile(str(scene_dir / "events.json"), "r") as fp:
events = json.load(fp)
num_frames = metadata["metadata"]["num_frames"]
result = {
"metadata": {
"video_name": example_key,
"width": target_size[1],
"height": target_size[0],
"num_frames": num_frames,
"num_instances": metadata["metadata"]["num_instances"],
},
"background": metadata["metadata"]["background"],
"instances": [format_instance_information(obj)
for obj in metadata["instances"]],
"camera": format_camera_information(metadata),
"events": format_events_information(events),
}
resolution = metadata["metadata"]["resolution"]
assert resolution[1] / target_size[0] == resolution[0] / target_size[1]
scale = resolution[1] / target_size[0]
assert scale == resolution[1] // target_size[0]
paths = {
key: [scene_dir / f"{key}_{f:05d}.png" for f in range(num_frames)]
for key in layers if key != "depth"
}
if "depth" in layers:
depth_paths = [scene_dir / f"depth_{f:05d}.tiff" for f in range(num_frames)]
depth_frames = np.array([
subsample_nearest_neighbor(read_tiff(frame_path), target_size)
for frame_path in depth_paths])
depth_min, depth_max = np.min(depth_frames), np.max(depth_frames)
result["depth"] = convert_float_to_uint16(depth_frames, depth_min, depth_max)
result["metadata"]["depth_range"] = [depth_min, depth_max]
if "forward_flow" in layers:
result["metadata"]["forward_flow_range"] = [
data_ranges["forward_flow"]["min"] / scale,
data_ranges["forward_flow"]["max"] / scale]
result["forward_flow"] = [
subsample_nearest_neighbor(read_png(frame_path)[..., :2],
target_size)
for frame_path in paths["forward_flow"]]
if "backward_flow" in layers:
result["metadata"]["backward_flow_range"] = [
data_ranges["backward_flow"]["min"] / scale,
data_ranges["backward_flow"]["max"] / scale]
result["backward_flow"] = [
subsample_nearest_neighbor(read_png(frame_path)[..., :2],
target_size)
for frame_path in paths["backward_flow"]]
for key in ["normal", "object_coordinates", "uv"]:
if key in layers:
result[key] = [
subsample_nearest_neighbor(read_png(frame_path),
target_size)
for frame_path in paths[key]]
if "segmentation" in layers:
# somehow we ended up calling this "segmentations" in TFDS and
# "segmentation" in kubric. So we have to treat it separately.
result["segmentations"] = [
subsample_nearest_neighbor(read_png(frame_path),
target_size)
for frame_path in paths["segmentation"]]
if "rgba" in layers:
result["video"] = [
subsample_avg(read_png(frame_path), target_size)[..., :3]
for frame_path in paths["rgba"]]
return example_key, result, metadata
def get_camera_features(seq_length):
return {
"focal_length": tf.float32,
"sensor_width": tf.float32,
"field_of_view": tf.float32,
"positions": tfds.features.Tensor(shape=(seq_length, 3),
dtype=tf.float32),
"quaternions": tfds.features.Tensor(shape=(seq_length, 4),
dtype=tf.float32),
}
def format_camera_information(metadata):
return {
"focal_length": metadata["camera"]["focal_length"],
"sensor_width": metadata["camera"]["sensor_width"],
"field_of_view": metadata["camera"]["field_of_view"],
"positions": np.array(metadata["camera"]["positions"], np.float32),
"quaternions": np.array(metadata["camera"]["quaternions"], np.float32),
}
def get_events_features():
return {
"collisions": tfds.features.Sequence({
"instances": tfds.features.Tensor(shape=(2,), dtype=tf.uint16),
"frame": tf.int32,
"force": tf.float32,
"position": tfds.features.Tensor(shape=(3,), dtype=tf.float32),
"image_position": tfds.features.Tensor(shape=(2,), dtype=tf.float32),
"contact_normal": tfds.features.Tensor(shape=(3,), dtype=tf.float32),
})
}
def format_events_information(events):
return {
"collisions": [{
"instances": np.array(c["instances"], dtype=np.uint16),
"frame": c["frame"],
"force": c["force"],
"position": np.array(c["position"], dtype=np.float32),
"image_position": np.array(c["image_position"], dtype=np.float32),
"contact_normal": np.array(c["contact_normal"], dtype=np.float32),
} for c in events["collisions"]],
}
def get_instance_features(seq_length: int):
return {
"mass": tf.float32,
"friction": tf.float32,
"restitution": tf.float32,
"positions": tfds.features.Tensor(shape=(seq_length, 3),
dtype=tf.float32),
"quaternions": tfds.features.Tensor(shape=(seq_length, 4),
dtype=tf.float32),
"velocities": tfds.features.Tensor(shape=(seq_length, 3),
dtype=tf.float32),
"angular_velocities": tfds.features.Tensor(shape=(seq_length, 3),
dtype=tf.float32),
"bboxes_3d": tfds.features.Tensor(shape=(seq_length, 8, 3),
dtype=tf.float32),
"image_positions": tfds.features.Tensor(shape=(seq_length, 2),
dtype=tf.float32),
"bboxes": tfds.features.Sequence(
tfds.features.BBoxFeature()),
"bbox_frames": tfds.features.Sequence(
tfds.features.Tensor(shape=(), dtype=tf.int32)),
"visibility": tfds.features.Tensor(shape=(seq_length,), dtype=tf.uint16),
}
def format_instance_information(obj):
return {
"mass": obj["mass"],
"friction": obj["friction"],
"restitution": obj["restitution"],
"positions": np.array(obj["positions"], np.float32),
"quaternions": np.array(obj["quaternions"], np.float32),
"velocities": np.array(obj["velocities"], np.float32),
"angular_velocities": np.array(obj["angular_velocities"], np.float32),
"bboxes_3d": np.array(obj["bboxes_3d"], np.float32),
"image_positions": np.array(obj["image_positions"], np.float32),
"bboxes": [tfds.features.BBox(*bbox) for bbox in obj["bboxes"]],
"bbox_frames": np.array(obj["bbox_frames"], dtype=np.uint16),
"visibility": np.array(obj["visibility"], dtype=np.uint16),
}
def subsample_nearest_neighbor(arr, size):
src_height, src_width, _ = arr.shape
dst_height, dst_width = size
height_step = src_height // dst_height
width_step = src_width // dst_width
assert height_step * dst_height == src_height
assert width_step * dst_width == src_width
height_offset = int(np.floor((height_step-1)/2))
width_offset = int(np.floor((width_step-1)/2))
subsampled = arr[height_offset::height_step, width_offset::width_step, :]
return subsampled
def convert_float_to_uint16(array, min_val, max_val):
return np.round((array - min_val) / (max_val - min_val) * 65535
).astype(np.uint16)
def subsample_avg(arr, size):
src_height, src_width, channels = arr.shape
dst_height, dst_width = size
height_bin = src_height // dst_height
width_bin = src_width // dst_width
return np.round(arr.reshape((dst_height, height_bin,
dst_width, width_bin,
channels)).mean(axis=(1, 3))).astype(np.uint8)
def is_complete_dir(video_dir, layers=DEFAULT_LAYERS):
video_dir = as_path(video_dir)
filenames = [d.name for d in video_dir.iterdir()]
if not ("data_ranges.json" in filenames and
"metadata.json" in filenames and
"events.json" in filenames):
return False
nr_frames_per_category = {
key: len([fn for fn in filenames if fn.startswith(key)])
for key in layers}
nr_expected_frames = nr_frames_per_category["rgba"]
if nr_expected_frames == 0:
return False
if not all(nr_frames == nr_expected_frames
for nr_frames in nr_frames_per_category.values()):
return False
return True
PathLike = Union[str, epath.Path]
def as_path(path: PathLike) -> epath.Path:
"""Convert str or pathlike object to epath.Path.
Instead of pathlib.Paths, we use the TFDS path because they transparently
support paths to GCS buckets such as "gs://kubric-public/GSO".
"""
return tfds.core.as_path(path)
def read_png(filename, rescale_range=None) -> np.ndarray:
filename = as_path(filename)
png_reader = png.Reader(bytes=filename.read_bytes())
width, height, pngdata, info = png_reader.read()
del png_reader
bitdepth = info["bitdepth"]
if bitdepth == 8:
dtype = np.uint8
elif bitdepth == 16:
dtype = np.uint16
else:
raise NotImplementedError(f"Unsupported bitdepth: {bitdepth}")
plane_count = info["planes"]
pngdata = np.vstack(list(map(dtype, pngdata)))
if rescale_range is not None:
minv, maxv = rescale_range
pngdata = pngdata / 2**bitdepth * (maxv - minv) + minv
return pngdata.reshape((height, width, plane_count))
def write_tiff(data: np.ndarray, filename: PathLike):
"""Save data as as tif image (which natively supports float values)."""
assert data.ndim == 3, data.shape
assert data.shape[2] in [1, 3, 4], "Must be grayscale, RGB, or RGBA"
img_as_bytes = imageio.imwrite("<bytes>", data, format="tiff")
filename = as_path(filename)
filename.write_bytes(img_as_bytes)
def read_tiff(filename: PathLike) -> np.ndarray:
filename = as_path(filename)
img = imageio.imread(filename.read_bytes(), format="tiff")
if img.ndim == 2:
img = img[:, :, None]
return img
def asset_id_from_metadata(meta):
asset_id_lookup = {
(20706, 'Shoe', '11pro SL TRX FG'): '11pro_SL_TRX_FG',
(8922, 'Consumer Goods', '2 of Jenga Clas'): '2_of_Jenga_Classic_Game',
(23766, 'Toys', '30 CONSTRUCTION'): '30_CONSTRUCTION_SET',
(14142, 'Consumer Goods', '3D Dollhouse Ha'): '3D_Dollhouse_Happy_Brother',
(10490, 'Toys', '3D Dollhouse La'): '3D_Dollhouse_Lamp',
(3202, 'Toys', '3D Dollhouse Re'): '3D_Dollhouse_Refrigerator',
(7978, 'Toys', '3D Dollhouse Si'): '3D_Dollhouse_Sink',
(15052, 'Toys', '3D Dollhouse So'): '3D_Dollhouse_Sofa',
(8876, 'Toys', '3D Dollhouse Sw'): '3D_Dollhouse_Swing',
(6446, 'Toys', '3D Dollhouse Ta'): '3D_Dollhouse_TablePurple',
(4750, 'None', '3M Antislip Sur'): '3M_Antislip_Surfacing_Light_Duty_White',
(11422, 'None', '3M Vinyl Tape, '): '3M_Vinyl_Tape_Green_1_x_36_yd',
(15358, 'Consumer Goods', '4.5oz RAMEKIN A'): '45oz_RAMEKIN_ASST_DEEP_COLORS',
(10728, 'Toys', '50 BLOCKS\nConta'): '50_BLOCKS',
(8362, 'Bottles and Cans and Cups', '5 HTP'): '5_HTP',
(26126, 'Toys', '60 CONSTRUCTION'): '60_CONSTRUCTION_SET',
(11224, 'Consumer Goods', 'ACE Coffee Mug,'): 'ACE_Coffee_Mug_Kristen_16_oz_cup',
(14692, 'Toys', 'ALPHABET A-Z (G'): 'ALPHABET_AZ_GRADIENT',
(13878, 'Toys', 'ALPHABET A-Z (G'): 'ALPHABET_AZ_GRADIENT_WQb1ufEycSj',
(23444, 'Shoe', 'AMBERLIGHT UP W'): 'AMBERLIGHT_UP_W',
(37508, 'Shoe', 'ASICS GEL-1140V'): 'ASICS_GEL1140V_WhiteBlackSilver',
(38246, 'Shoe', 'ASICS GEL-1140V'): 'ASICS_GEL1140V_WhiteRoyalSilver',
(45698, 'Shoe', 'ASICS GEL-Ace™ '): 'ASICS_GELAce_Pro_Pearl_WhitePink',
(39092, 'Shoe', 'ASICS GEL-Blur3'): 'ASICS_GELBlur33_20_GS_BlackWhiteSafety_Orange',
(30660, 'Shoe', 'ASICS GEL-Blur3'): 'ASICS_GELBlur33_20_GS_Flash_YellowHot_PunchSilver',
(33438, 'Shoe', 'ASICS GEL-Chall'): 'ASICS_GELChallenger_9_Royal_BlueWhiteBlack',
(44502, 'Shoe', 'ASICS GEL-Dirt '): 'ASICS_GELDirt_Dog_4_SunFlameBlack',
(34586, 'Shoe', 'ASICS GEL-Links'): 'ASICS_GELLinksmaster_WhiteCoffeeSand',
(31266, 'Shoe', 'ASICS GEL-Links'): 'ASICS_GELLinksmaster_WhiteRasberryGunmetal',
(34160, 'Shoe', 'ASICS GEL-Links'): 'ASICS_GELLinksmaster_WhiteSilverCarolina_Blue',
(36694, 'Shoe', 'ASICS GEL-Resol'): 'ASICS_GELResolution_5_Flash_YellowBlackSilver',
(26000, 'Shoe', 'ASICS GEL-Tour '): 'ASICS_GELTour_Lyte_WhiteOrchidSilver',
(21152, 'Shoe', 'ASICS Hyper-Roc'): 'ASICS_HyperRocketgirl_SP_5_WhiteMalibu_BlueBlack',
(20336, 'Toys', 'ASSORTED VEGETA'): 'ASSORTED_VEGETABLE_SET',
(45866, 'Shoe', 'Adrenaline GTS '): 'Adrenaline_GTS_13_Color_DrkDenimWhtBachlorBttnSlvr_Size_50_yfK40TNjq0V',
(48412, 'Shoe', 'Adrenaline GTS '): 'Adrenaline_GTS_13_Color_WhtObsdianBlckOlmpcSlvr_Size_70',
(5762, 'None', 'Air Hogs Wind F'): 'Air_Hogs_Wind_Flyers_Set_Airplane_Red',
(8126, 'Bottles and Cans and Cups', 'Allergen-Free J'): 'AllergenFree_JarroDophilus',
(11836, 'Consumer Goods', 'Android Figure,'): 'Android_Figure_Chrome',
(9698, 'Consumer Goods', 'Android Figure,'): 'Android_Figure_Orange',
(10618, 'Consumer Goods', 'Android Figure,'): 'Android_Figure_Panda',
(14214, 'Legos', 'Android Lego'): 'Android_Lego',
(2444, 'Media Cases', 'Animal Crossing'): 'Animal_Crossing_New_Leaf_Nintendo_3DS_Game',
(21978, 'Toys', 'Animal Planet F'): 'Animal_Planet_Foam_2Headed_Dragon',
(1690, 'Consumer Goods', 'Apples to Apple'): 'Apples_to_Apples_Kids_Edition',
(2820, 'Consumer Goods', 'Arm Hammer Diap'): 'Arm_Hammer_Diaper_Pail_Refills_12_Pack_MFWkmoweejt',
(21582, 'Consumer Goods', 'Aroma Stainless'): 'Aroma_Stainless_Steel_Milk_Frother_2_Cup',
(17458, 'None', 'Asus - 802.11ac'): 'Asus_80211ac_DualBand_Gigabit_Wireless_Router_RTAC68R',
(16504, 'None', 'Asus M5A78L-M/U'): 'Asus_M5A78LMUSB3_Motherboard_Micro_ATX_Socket_AM3',
(9370, 'None', 'Asus M5A99FX PR'): 'Asus_M5A99FX_PRO_R20_Motherboard_ATX_Socket_AM3',
(1708, 'None', 'Asus Sabertooth'): 'Asus_Sabertooth_990FX_20_Motherboard_ATX_Socket_AM3',
(3184, 'None', 'Asus Sabertooth'): 'Asus_Sabertooth_Z97_MARK_1_Motherboard_ATX_LGA1150_Socket',
(2838, 'None', 'Asus X99-Deluxe'): 'Asus_X99Deluxe_Motherboard_ATX_LGA2011v3_Socket',
(3592, 'None', 'Asus Z87-PRO Mo'): 'Asus_Z87PRO_Motherboard_ATX_LGA1150_Socket',
(5896, 'None', 'Asus Z97-AR LGA'): 'Asus_Z97AR_LGA_1150_Intel_ATX_Motherboard',
(34176, 'None', 'Asus Z97I-PLUS '): 'Asus_Z97IPLUS_Motherboard_Mini_ITX_LGA1150_Socket',
(18402, 'Toys', 'Avengers Gamma '): 'Avengers_Gamma_Green_Smash_Fists',
(10822, 'Action Figures', 'Avengers Thor'): 'Avengers_Thor_PLlrpYniaeB',
(30976, 'Shoe', 'Azure Snake Tie'): 'Azure_Snake_Tieks_Leather_Snake_Print_Ballet_Flats',
(17646, 'Toys', 'BABY CAR\nThis c'): 'BABY_CAR',
(14524, 'Toys', 'BAGEL WITH CHEE'): 'BAGEL_WITH_CHEESE',
(6782, 'Toys', 'BAKING UTENSILS'): 'BAKING_UTENSILS',
(11788, 'Toys', 'BALANCING CACTU'): 'BALANCING_CACTUS',
(6320, 'Toys', 'BATHROOM - CLAS'): 'BATHROOM_CLASSIC',
(6798, 'Toys', 'BATHROOM (FURNI'): 'BATHROOM_FURNITURE_SET_1',
(8436, 'Toys', 'BEDROOM - CLASS'): 'BEDROOM_CLASSIC',
(8872, 'Toys', 'BEDROOM - CLASS'): 'BEDROOM_CLASSIC_Gi22DjScTVS',
(10840, 'Toys', 'BEDROOM - NEO\nT'): 'BEDROOM_NEO',
(14542, 'None', 'B.I.A Cordon Bl'): 'BIA_Cordon_Bleu_White_Porcelain_Utensil_Holder_900028',
(16274, 'None', 'BIA Porcelain R'): 'BIA_Porcelain_Ramekin_With_Glazed_Rim_35_45_oz_cup',
(17104, 'Toys', 'BIRD RATTLE\nThi'): 'BIRD_RATTLE',
(16190, 'Toys', 'BRAILLE ALPHABE'): 'BRAILLE_ALPHABET_AZ',
(11676, 'Toys', 'BREAKFAST MENU\n'): 'BREAKFAST_MENU',
(11724, 'Toys', 'BUILD -A- ROBOT'): 'BUILD_A_ROBOT',
(12958, 'Toys', 'BUILD A ZOO\nHel'): 'BUILD_A_ZOO',
(12146, 'Toys', 'BUNNY RACER\nHav'): 'BUNNY_RACER',
(11316, 'Toys', 'BUNNY RATTLE\nLi'): 'BUNNY_RATTLE',
(10528, 'None', 'Baby Elements S'): 'Baby_Elements_Stacking_Cups',
(1464, 'Board Games', 'Balderdash Game'): 'Balderdash_Game',
(6770, 'Consumer Goods', 'Beetle Adventur'): 'Beetle_Adventure_Racing_Nintendo_64',
(8726, 'Bottles and Cans and Cups', 'Beta Glucan'): 'Beta_Glucan',
(4630, 'Consumer Goods', 'Beyonc? - Life '): 'Beyonc_Life_is_But_a_Dream_DVD',
(9344, 'Bottles and Cans and Cups', 'Bifidus Balance'): 'Bifidus_Balance_FOS',
(12514, 'Bag', 'Big Dot Aqua Pe'): 'Big_Dot_Aqua_Pencil_Case',
(11720, 'Bag', 'Big Dot Pink Pe'): 'Big_Dot_Pink_Pencil_Case',
(31182, 'Consumer Goods', 'Big O Sponges, '): 'Big_O_Sponges_Assorted_Cellulose_12_pack',
(6932, 'None', 'Black/Black Nin'): 'BlackBlack_Nintendo_3DSXL',
(30034, 'None', 'Black & Decker '): 'Black_Decker_CM2035B_12Cup_Thermal_Coffeemaker',
(47628, 'None', 'Black & Decker '): 'Black_Decker_Stainless_Steel_Toaster_4_Slice',
(4028, 'Consumer Goods', 'Black Elderberr'): 'Black_Elderberry_Syrup_54_oz_Gaia_Herbs',
(2036, 'Consumer Goods', 'Black Forest Fr'): 'Black_Forest_Fruit_Snacks_28_Pack_Grape',
(2544, 'Consumer Goods', 'Black Forest Fr'): 'Black_Forest_Fruit_Snacks_Juicy_Filled_Centers_10_pouches_9_oz_total',
(4658, 'None', 'Black and Decke'): 'Black_and_Decker_PBJ2000_FusionBlade_Blender_Jars',
(31474, 'None', 'Black and Decke'): 'Black_and_Decker_TR3500SD_2Slice_Toaster',
(8676, 'Bottles and Cans and Cups', 'Blackcurrant + '): 'Blackcurrant_Lutein',
(5932, 'None', 'Blue/Black Nint'): 'BlueBlack_Nintendo_3DSXL',
(6068, 'Media Cases', 'Blue Jasmine [I'): 'Blue_Jasmine_Includes_Digital_Copy_UltraViolet_DVD',
(9132, 'Bottles and Cans and Cups', 'Borage GLA-240+'): 'Borage_GLA240Gamma_Tocopherol',
(15502, 'None', 'Bradshaw Intern'): 'Bradshaw_International_11642_7_Qt_MP_Plastic_Bowl',
(13840, 'None', 'Breyer Horse Of'): 'Breyer_Horse_Of_The_Year_2015',
(3634, 'Consumer Goods', 'Brisk Iced Tea,'): 'Brisk_Iced_Tea_Lemon_12_12_fl_oz_355_ml_cans_144_fl_oz_426_lt',
(4782, 'Consumer Goods', 'Brother Ink Car'): 'Brother_Ink_Cartridge_Magenta_LC75M',
(5762, 'Consumer Goods', 'Brother LC 1053'): 'Brother_LC_1053PKS_Ink_Cartridge_CyanMagentaYellow_1pack',
(4816, 'Consumer Goods', 'Brother Printin'): 'Brother_Printing_Cartridge_PC501',
(11652, 'Toys', 'CARS-II'): 'CARSII',
(25266, 'Toys', 'CAR CARRIER TRA'): 'CAR_CARRIER_TRAIN',
(22108, 'Toys', 'CASTLE BLOCKS\nE'): 'CASTLE_BLOCKS',
(11022, 'Toys', 'CHICKEN NESTING'): 'CHICKEN_NESTING',
(12808, 'Toys', 'CHICKEN RACER\nH'): 'CHICKEN_RACER',
(16054, 'Toys', "CHILDREN'S ROOM"): 'CHILDRENS_ROOM_NEO',
(12712, 'Toys', 'CHILDREN BEDROO'): 'CHILDREN_BEDROOM_CLASSIC',
(11192, 'Toys', 'CITY TAXI & POL'): 'CITY_TAXI_POLICE_CAR',
(41832, 'Shoe', 'CLIMACOOL BOAT '): 'CLIMACOOL_BOAT_BREEZE_IE6CyqSaDwN',
(9562, 'Toys', 'COAST GUARD BOA'): 'COAST_GUARD_BOAT',
(21962, 'Toys', 'CONE SORTING\nLe'): 'CONE_SORTING',
(5406, 'Toys', 'CONE SORTING\nLe'): 'CONE_SORTING_kg5fbARBwts',
(14610, 'Toys', 'CREATIVE BLOCKS'): 'CREATIVE_BLOCKS_35_MM',
(23540, 'Shoe', 'California Navy'): 'California_Navy_Tieks_Italian_Leather_Ballet_Flats',
(8262, 'None', 'Calphalon Kitch'): 'Calphalon_Kitchen_Essentials_12_Cast_Iron_Fry_Pan_Black',
(6292, 'Consumer Goods', 'Canon 225/226 I'): 'Canon_225226_Ink_Cartridges_BlackColor_Cyan_Magenta_Yellow_6_count',
(6052, 'Consumer Goods', 'Canon Ink Cartr'): 'Canon_Ink_Cartridge_Green_6',
(5132, 'Consumer Goods', 'Canon Pixma Chr'): 'Canon_Pixma_Chromalife_100_Magenta_8',
(6536, 'Consumer Goods', 'Canon Pixma Ink'): 'Canon_Pixma_Ink_Cartridge_251_M',
(5612, 'Consumer Goods', 'Canon Pixma Ink'): 'Canon_Pixma_Ink_Cartridge_8',
(5722, 'Consumer Goods', 'Canon Pixma Ink'): 'Canon_Pixma_Ink_Cartridge_8_Green',
(6218, 'Consumer Goods', 'Canon Pixma Ink'): 'Canon_Pixma_Ink_Cartridge_8_Red',
(5756, 'Consumer Goods', 'Canon Pixma Ink'): 'Canon_Pixma_Ink_Cartridge_Cyan_251',
(42288, 'Shoe', 'Cascadia 8, Col'): 'Cascadia_8_Color_AquariusHibscsBearingSeaBlk_Size_50',
(7768, 'Consumer Goods', 'Central Garden '): 'Central_Garden_Flower_Pot_Goo_425',
(4436, 'None', 'Chef Style Roun'): 'Chef_Style_Round_Cake_Pan_9_inch_pan',
(9320, 'None', 'Chefmate 8" Fry'): 'Chefmate_8_Frypan',
(15226, 'Shoe', 'Chelsea Blk.Hee'): 'Chelsea_BlkHeelPMP_DwxLtZNxLZZ',
(7624, 'Shoe', 'Chelsea lo fl r'): 'Chelsea_lo_fl_rdheel_nQ0LPNF1oMw',
(7910, 'Shoe', 'Chelsea lo fl r'): 'Chelsea_lo_fl_rdheel_zAQrnhlEfw8',
(18510, 'Consumer Goods', 'Circo Fish Toot'): 'Circo_Fish_Toothbrush_Holder_14995988',
(28482, 'Shoe', 'ClimaCool Aerat'): 'ClimaCool_Aerate_2_W_Wide',
(10368, 'None', 'Clorox Premium '): 'Clorox_Premium_Choice_Gloves_SM_1_pair',
(12158, 'None', 'Closetmaid Prem'): 'Closetmaid_Premium_Fabric_Cube_Red',
(4450, 'Board Games', 'Clue Board Game'): 'Clue_Board_Game_Classic_Edition',
(10490, 'Bottles and Cans and Cups', 'Co-Q10'): 'CoQ10',
(9298, 'Bottles and Cans and Cups', 'Co-Q10'): 'CoQ10_BjTLbuRVt1t',
(10984, 'Bottles and Cans and Cups', 'Co-Q10'): 'CoQ10_wSSVoxVppVD',
(4484, 'None', 'Cole Hardware A'): 'Cole_Hardware_Antislip_Surfacing_Material_White',
(5650, 'None', 'Cole Hardware A'): 'Cole_Hardware_Antislip_Surfacing_White_2_x_60',
(10342, 'None', 'Cole Hardware B'): 'Cole_Hardware_Bowl_Scirocco_YellowBlue',
(34140, 'Consumer Goods', 'Cole Hardware B'): 'Cole_Hardware_Butter_Dish_Square_Red',
(10364, 'None', 'Cole Hardware D'): 'Cole_Hardware_Deep_Bowl_Good_Earth_1075',
(18694, 'None', 'Cole Hardware D'): 'Cole_Hardware_Dishtowel_Blue',
(17596, 'None', 'Cole Hardware D'): 'Cole_Hardware_Dishtowel_BlueWhite',
(21206, 'None', 'Cole Hardware D'): 'Cole_Hardware_Dishtowel_Multicolors',
(21290, 'None', 'Cole Hardware D'): 'Cole_Hardware_Dishtowel_Red',
(14942, 'None', 'Cole Hardware D'): 'Cole_Hardware_Dishtowel_Stripe',
(8752, 'None', 'Cole Hardware E'): 'Cole_Hardware_Electric_Pot_Assortment_55',
(7674, 'None', 'Cole Hardware E'): 'Cole_Hardware_Electric_Pot_Cabana_55',
(5820, 'None', 'Cole Hardware F'): 'Cole_Hardware_Flower_Pot_1025',
(7836, 'None', 'Cole Hardware H'): 'Cole_Hardware_Hammer_Black',
(6458, 'Consumer Goods', 'Cole Hardware M'): 'Cole_Hardware_Mini_Honey_Dipper',
(8716, 'None', 'Cole Hardware M'): 'Cole_Hardware_Mug_Classic_Blue',
(6834, 'None', 'Cole Hardware O'): 'Cole_Hardware_Orchid_Pot_85',
(4302, 'None', 'Cole Hardware P'): 'Cole_Hardware_Plant_Saucer_Brown_125',
(4126, 'None', 'Cole Hardware P'): 'Cole_Hardware_Plant_Saucer_Glazed_9',
(6796, 'None', 'Cole Hardware S'): 'Cole_Hardware_Saucer_Electric',
(5248, 'None', 'Cole Hardware S'): 'Cole_Hardware_Saucer_Glazed_6',
(8752, 'Consumer Goods', 'Cole Hardware S'): 'Cole_Hardware_School_Bell_Solid_Brass_38',
(26766, 'Shoe', 'Colton Wntr Chu'): 'Colton_Wntr_Chukka_y4jO0I8JQFW',
(2544, 'Board Games', 'Connect 4 Launc'): 'Connect_4_Launchers',
(28192, 'Consumer Goods', 'Cootie Game'): 'Cootie_Game',
(2454, 'Consumer Goods', 'Cootie Game'): 'Cootie_Game_tDhURNbfU5J',
(30854, 'Shoe', 'Copperhead Snak'): 'Copperhead_Snake_Tieks_Brown_Snake_Print_Ballet_Flats',
(4612, 'None', 'Corningware CW '): 'Corningware_CW_by_Corningware_3qt_Oblong_Casserole_Dish_Blue',
(37954, 'Shoe', 'Court Attitude'): 'Court_Attitude',
(5610, 'None', 'Craftsman Grip '): 'Craftsman_Grip_Screwdriver_Phillips_Cushion',
(5558, 'None', 'Crayola Bonus 6'): 'Crayola_Bonus_64_Crayons',
(3250, 'Consumer Goods', 'Crayola Crayons'): 'Crayola_Crayons_120_crayons',
(7562, 'Consumer Goods', 'Crayola Crayons'): 'Crayola_Crayons_24_count',
(7522, 'Consumer Goods', 'Crayola Crayons'): 'Crayola_Crayons_Washable_24_crayons',
(4150, 'Consumer Goods', 'Crayola Model M'): 'Crayola_Model_Magic_Modeling_Material_Single_Packs_6_pack_05_oz_packs',
(2756, 'Consumer Goods', 'Crayola Model M'): 'Crayola_Model_Magic_Modeling_Material_White_3_oz',
(7342, 'None', 'Crayola Washabl'): 'Crayola_Washable_Fingerpaint_Red_Blue_Yellow_3_count_8_fl_oz_bottes_each',
(5898, 'Consumer Goods', 'Crayola Washabl'): 'Crayola_Washable_Sidewalk_Chalk_16_pack',
(9010, 'Consumer Goods', 'Crayola Washabl'): 'Crayola_Washable_Sidewalk_Chalk_16_pack_wDZECiw7J6s',
(25056, 'Shoe', 'Crazy 8\nFW-HIGH'): 'Crazy_8',
(39326, 'Shoe', 'Crazy Shadow 2'): 'Crazy_Shadow_2',
(23866, 'Shoe', 'Crazy Shadow 2'): 'Crazy_Shadow_2_oW4Jd10HFFr',
(17216, 'Shoe', 'Cream Tieks - I'): 'Cream_Tieks_Italian_Leather_Ballet_Flats',
(9888, 'Bottles and Cans and Cups', 'Creatine Monohy'): 'Creatine_Monohydrate',
(10248, 'Consumer Goods', 'Crosley Alarm C'): 'Crosley_Alarm_Clock_Vintage_Metal',
(3682, 'Consumer Goods', 'Crunch Girl Sco'): 'Crunch_Girl_Scouts_Candy_Bars_Peanut_Butter_Creme_78_oz_box',
(86044, 'None', 'Curver Storage '): 'Curver_Storage_Bin_Black_Small',
(20484, 'Toys', 'DANCING ALLIGAT'): 'DANCING_ALLIGATOR',
(16340, 'Toys', 'DANCING ALLIGAT'): 'DANCING_ALLIGATOR_zoWBjc0jbTs',
(9242, 'Bottles and Cans and Cups', 'DIM + CDG'): 'DIM_CDG',
(12230, 'Toys', 'DINING ROOM - C'): 'DINING_ROOM_CLASSIC',
(9792, 'Toys', 'DINING ROOM - C'): 'DINING_ROOM_CLASSIC_UJuxQ0hv5XU',
(9412, 'Toys', 'DINNING ROOM (F'): 'DINNING_ROOM_FURNITURE_SET_1',
(35812, 'Toys', 'DOLL FAMILY'): 'DOLL_FAMILY',
(22828, 'Hat', 'DPC Handmade Ha'): 'DPC_Handmade_Hat_Brown',
(34294, 'None', 'DPC Thinsulate '): 'DPC_Thinsulate_Isolate_Gloves_Brown',
(55206, 'Hat', 'DPC tropical Tr'): 'DPC_tropical_Trends_Hat',
(18932, 'Shoe', 'DRAGON W'): 'DRAGON_W',
(30974, 'Shoe', 'D ROSE 4.5\nFW-H'): 'D_ROSE_45',
(47688, 'Shoe', 'D ROSE 773 II'): 'D_ROSE_773_II_Kqclsph05pE',
(45804, 'Shoe', 'D ROSE 773 II'): 'D_ROSE_773_II_hvInJwJ5HUD',
(35868, 'Shoe', 'D ROSE ENGLEWOO'): 'D_ROSE_ENGLEWOOD_II',
(5510, 'Consumer Goods', 'Dell Ink Cartri'): 'Dell_Ink_Cartridge',
(3768, 'Consumer Goods', 'Dell Ink Cartri'): 'Dell_Ink_Cartridge_Yellow_31',
(4150, 'Consumer Goods', 'Dell Series 9 C'): 'Dell_Series_9_Color_Ink_Cartridge_MK993_High_Yield',
(1936, 'None', 'Design Ideas Dr'): 'Design_Ideas_Drawer_Store_Organizer',
(2656, 'Consumer Goods', 'Deskstar Desk T'): 'Deskstar_Desk_Top_Hard_Drive_1_TB',
(6816, 'Consumer Goods', 'Diamond Visions'): 'Diamond_Visions_Scissors_Red',
(1990, 'Consumer Goods', 'Diet Pepsi Soda'): 'Diet_Pepsi_Soda_Cola12_Pack_12_oz_Cans',
(16358, 'Bag', 'Digital Camo Do'): 'Digital_Camo_Double_Decker_Lunch_Bag',
(17722, 'Action Figures', 'Dino 3'): 'Dino_3',
(21900, 'Action Figures', 'Dino 4'): 'Dino_4',
(16162, 'Action Figures', 'Dino 5'): 'Dino_5',
(25548, 'None', 'Dixie 10 ounce '): 'Dixie_10_ounce_Bowls_35_ct',
(67204, 'None', 'Dog\nDog'): 'Dog',
(9452, 'Bottles and Cans and Cups', "Don Francisco's"): 'Don_Franciscos_Gourmet_Coffee_Medium_Decaf_100_Colombian_12_oz_340_g',
(23934, 'None', 'Down To Earth C'): 'Down_To_Earth_Ceramic_Orchid_Pot_Asst_Blue',
(20260, 'Consumer Goods', 'Down To Earth O'): 'Down_To_Earth_Orchid_Pot_Ceramic_Lime',
(24492, 'Consumer Goods', 'Down To Earth O'): 'Down_To_Earth_Orchid_Pot_Ceramic_Red',
(35714, 'Shoe', 'ENFR MID (ENFOR'): 'ENFR_MID_ENFORCER',
(3812, 'Consumer Goods', 'Eat to Live: Th'): 'Eat_to_Live_The_Amazing_NutrientRich_Program_for_Fast_and_Sustained_Weight_Loss_Revised_Edition_Book',
(7542, 'None', 'Ecoforms Cup, B'): 'Ecoforms_Cup_B4_SAN',
(9126, 'None', 'Ecoforms Garden'): 'Ecoforms_Garden_Pot_GP16ATurquois',
(9524, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Bowl_Atlas_Low',
(6254, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Bowl_Turquoise_7',
(8288, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_12_Pot_Nova',
(8754, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_B4_Har',
(12316, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_FB6_Tur',
(11020, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_GP16AMOCHA',
(10040, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_GP16A_Coral',
(5320, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_QP6CORAL',
(3962, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_QP6HARVEST',
(7442, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_QP_Harvest',
(14776, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_QP_Turquoise',
(3844, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_Quadra_Sand_QP6',
(5032, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_Quadra_Turquoise_QP12',
(4592, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_S14Turquoise',
(4256, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_S24NATURAL',
(4244, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_S24Turquoise',
(6820, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_SB9Turquoise',
(4926, 'Consumer Goods', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_URN_NAT',
(4930, 'Consumer Goods', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_URN_SAN',
(4978, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_Urn_55_Avocado',
(6268, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Container_Urn_55_Mocha',
(4966, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Plate_S11Turquoise',
(11092, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Pot_GP9AAvocado',
(15368, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Pot_GP9_SAND',
(5174, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Saucer_S14MOCHA',
(4974, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Saucer_S14NATURAL',
(6504, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Saucer_S17MOCHA',
(5718, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Saucer_S20MOCHA',
(7360, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Saucer_SQ1HARVEST',
(7760, 'None', 'Ecoforms Plant '): 'Ecoforms_Plant_Saucer_SQ8COR',
(6464, 'None', 'Ecoforms Plante'): 'Ecoforms_Planter_Bowl_Cole_Hardware',
(10104, 'None', 'Ecoforms Plante'): 'Ecoforms_Planter_Pot_GP12AAvocado',
(7618, 'None', 'Ecoforms Plante'): 'Ecoforms_Planter_Pot_QP6Ebony',
(4340, 'None', 'Ecoforms Plate,'): 'Ecoforms_Plate_S20Avocado',
(8176, 'None', 'Ecoforms Pot, N'): 'Ecoforms_Pot_Nova_6_Turquoise',
(4762, 'None', 'Ecoforms Quadra'): 'Ecoforms_Quadra_Saucer_SQ1_Avocado',
(2358, 'None', 'Ecoforms Saucer'): 'Ecoforms_Saucer_SQ3_Turquoise',
(52216, 'None', 'Elephant\nElepha'): 'Elephant',
(25084, 'None', 'Embark Lunch Co'): 'Embark_Lunch_Cooler_Blue',
(19994, 'None', 'Envision Home D'): 'Envision_Home_Dish_Drying_Mat_Red_6_x_18',
(5578, 'Consumer Goods', 'Epson 273XL Ink'): 'Epson_273XL_Ink_Cartridge_Magenta',
(6800, 'Consumer Goods', 'Epson DURABrite'): 'Epson_DURABrite_Ultra_786_Black_Ink_Cartridge_T786120S',
(4032, 'Consumer Goods', 'Epson Ink Cartr'): 'Epson_Ink_Cartridge_126_Yellow',
(5978, 'Consumer Goods', 'Epson Ink Cartr'): 'Epson_Ink_Cartridge_Black_200',
(4320, 'Consumer Goods', 'Epson LabelWork'): 'Epson_LabelWorks_LC4WBN9_Tape_reel_labels_047_x_295_Roll_Black_on_White',
(4454, 'Consumer Goods', 'Epson LabelWork'): 'Epson_LabelWorks_LC5WBN9_Tape_reel_labels_071_x_295_Roll_Black_on_White',
(4704, 'Consumer Goods', 'Epson T5803 Ink'): 'Epson_T5803_Ink_Cartridge_Magenta_1pack',
(3562, 'Consumer Goods', 'Epson UltraChro'): 'Epson_UltraChrome_T0543_Ink_Cartridge_Magenta_1pack',
(3888, 'Consumer Goods', 'Epson UltraChro'): 'Epson_UltraChrome_T0548_Ink_Cartridge_Matte_Black_1pack',
(14708, 'Shoe', 'F10 TRX FG'): 'F10_TRX_FG_ssscuo9tGxb',
(19658, 'Shoe', 'F10 TRX TF'): 'F10_TRX_TF_rH7tmKCdUJq',
(14248, 'Shoe', 'F5 TRX FG'): 'F5_TRX_FG',
(23734, 'Toys', 'FAIRY TALE BLOC'): 'FAIRY_TALE_BLOCKS',
(25032, 'Toys', 'FARM ANIMAL\nThe'): 'FARM_ANIMAL',
(28266, 'Toys', 'FARM ANIMAL\nThe'): 'FARM_ANIMAL_9GyfdcPyESK',
(23904, 'Toys', 'FIRE ENGINE'): 'FIRE_ENGINE',
(20576, 'Toys', 'FIRE TRUCK\nThis'): 'FIRE_TRUCK',
(18240, 'Toys', 'FISHING GAME\nGo'): 'FISHING_GAME',
(7730, 'Toys', 'FOOD & BEVERAGE'): 'FOOD_BEVERAGE_SET',
(6278, 'Toys', 'FRACTION FUN\nFe'): 'FRACTION_FUN_n4h4qte23QR',
(12556, 'Toys', 'FRUIT & VEGGIE '): 'FRUIT_VEGGIE_DOMINO_GRADIENT',
(23218, 'Toys', 'FRUIT & VEGGIE '): 'FRUIT_VEGGIE_MEMO_GRADIENT',
(33206, 'Shoe', 'FYW ALTERNATION'): 'FYW_ALTERNATION',
(36812, 'Shoe', 'FYW DIVISION\nFW'): 'FYW_DIVISION',
(3272, 'Consumer Goods', 'Fem-Dophilus\nFe'): 'FemDophilus',
(6888, 'Media Cases', 'Final Fantasy X'): 'Final_Fantasy_XIV_A_Realm_Reborn_60Day_Subscription',
(1818, 'Consumer Goods', 'Firefly Clue Bo'): 'Firefly_Clue_Board_Game',
(2064, 'Consumer Goods', 'Fisher-Price Ma'): 'FisherPrice_Make_A_Match_Game_Thomas_Friends',
(12592, 'None', 'Fisher price Cl'): 'Fisher_price_Classic_Toys_Buzzy_Bee',
(6770, 'None', 'Focus 8643 Lime'): 'Focus_8643_Lime_Squeezer_10x35x188_Enamelled_Aluminum_Light',
(10924, 'Bottles and Cans and Cups', 'Folic Acid'): 'Folic_Acid',
(9468, 'Consumer Goods', 'Footed Bowl San'): 'Footed_Bowl_Sand',
(3138, 'Consumer Goods', 'Fresca Peach Ci'): 'Fresca_Peach_Citrus_Sparkling_Flavored_Soda_12_PK',
(1428, 'Board Games', "Frozen Olaf's I"): 'Frozen_Olafs_In_Trouble_PopOMatic_Game',
(19718, 'Board Games', "Frozen Olaf's I"): 'Frozen_Olafs_In_Trouble_PopOMatic_Game_OEu83W9T8pD',
(1462, 'Board Games', 'Frozen Scrabble'): 'Frozen_Scrabble_Jr',
(17626, 'Consumer Goods', 'Fruity Friends'): 'Fruity_Friends',
(6364, 'None', 'Fujifilm instax'): 'Fujifilm_instax_SHARE_SP1_10_photos',
(7518, 'None', 'Full Circle Hap'): 'Full_Circle_Happy_Scraps_Out_Collector_Gray',
(31476, 'Toys', 'GARDEN SWING\nTh'): 'GARDEN_SWING',
(25342, 'Toys', 'GEARS & PUZZLES'): 'GEARS_PUZZLES_STANDARD_gcYxhNHhKlI',
(11730, 'Toys', 'GEOMETRIC PEG B'): 'GEOMETRIC_PEG_BOARD',
(11274, 'Toys', 'GEOMETRIC SORTI'): 'GEOMETRIC_SORTING_BOARD',
(8370, 'Toys', 'GEOMETRIC SORTI'): 'GEOMETRIC_SORTING_BOARD_MNi4Rbuz9vj',
(18796, 'Shoe', 'GIRLS DECKHAND\n'): 'GIRLS_DECKHAND',
(15920, 'Toys', 'GRANDFATHER DOL'): 'GRANDFATHER_DOLL',
(15340, 'Toys', 'GRANDMOTHER'): 'GRANDMOTHER',
(9102, 'Bottles and Cans and Cups', 'Germanium GE-13'): 'Germanium_GE132',
(59036, 'Shoe', 'Ghost 6, Color:'): 'Ghost_6_Color_BlckWhtLavaSlvrCitrus_Size_80',
(57462, 'Shoe', 'Ghost 6, Color:'): 'Ghost_6_Color_MdngtDenmPomBrtePnkSlvBlk_Size_50',
(58118, 'Shoe', 'Ghost 6 GTX, Co'): 'Ghost_6_GTX_Color_AnthBlckSlvrFernSulphSprng_Size_80',
(12256, 'None', 'Gigabyte GA-78L'): 'Gigabyte_GA78LMTUSB3_50_Motherboard_Micro_ATX_Socket_AM3',
(4776, 'None', 'Gigabyte GA-970'): 'Gigabyte_GA970AUD3P_10_Motherboard_ATX_Socket_AM3',
(25798, 'None', 'Gigabyte GA-Z97'): 'Gigabyte_GAZ97XSLI_10_motherboard_ATX_LGA1150_Socket_Z97',
(36936, 'Shoe', 'Glycerin 11, Co'): 'Glycerin_11_Color_AqrsDrsdnBluBlkSlvShckOrng_Size_50',
(42844, 'Shoe', 'Glycerin 11, Co'): 'Glycerin_11_Color_BrllntBluSkydvrSlvrBlckWht_Size_80',
(22696, 'None', 'GoPro HERO3 Com'): 'GoPro_HERO3_Composite_Cable',
(5108, 'Consumer Goods', 'Google Cardboar'): 'Google_Cardboard_Original_package',
(23248, 'Shoe', 'Grand Prix'): 'Grand_Prix',
(12556, 'None', 'Granimals 20 Wo'): 'Granimals_20_Wooden_ABC_Blocks_Wagon',
(12112, 'None', 'Granimals 20 Wo'): 'Granimals_20_Wooden_ABC_Blocks_Wagon_85VdSftGsLi',
(12336, 'None', 'Granimals 20 Wo'): 'Granimals_20_Wooden_ABC_Blocks_Wagon_g2TinmUGGHI',
(10310, 'None', 'Great Dinos Tri'): 'Great_Dinos_Triceratops_Toy',
(18656, 'Shoe', 'Great Jones Win'): 'Great_Jones_Wingtip',
(22786, 'Shoe', 'Great Jones Win'): 'Great_Jones_Wingtip_j5NV8GRnitM',
(22530, 'Shoe', 'Great Jones Win'): 'Great_Jones_Wingtip_kAqSg6EgG0I',
(18654, 'Shoe', 'Great Jones Win'): 'Great_Jones_Wingtip_wxH3dbtlvBC',
(8194, 'None', 'Grreat Choice D'): 'Grreat_Choice_Dog_Double_Dish_Plastic_Blue',
(8862, 'None', 'Grreatv Choice '): 'Grreatv_Choice_Dog_Bowl_Gray_Bones_Plastic_20_fl_oz_total',
(25030, 'Action Figures', 'Guardians of th'): 'Guardians_of_the_Galaxy_Galactic_Battlers_Rocket_Raccoon_Figure',
(12474, 'Toys', 'HAMMER BALL\nThi'): 'HAMMER_BALL',
(7254, 'Toys', 'HAMMER PEG\nA fo'): 'HAMMER_PEG',
(15304, 'Toys', 'HAPPY ENGINE\nHa'): 'HAPPY_ENGINE',
(11472, 'Toys', 'HELICOPTER\nThis'): 'HELICOPTER',
(1652, 'None', 'HP 1800 Tablet,'): 'HP_1800_Tablet_8GB_7',
(2586, 'Consumer Goods', 'HP Card & Invit'): 'HP_Card_Invitation_Kit',
(1502, 'Consumer Goods', 'Hasbro Cranium '): 'Hasbro_Cranium_Performance_and_Acting_Game',
(1150, 'Consumer Goods', "Hasbro Don't Wa"): 'Hasbro_Dont_Wake_Daddy_Board_Game',
(8756, 'Consumer Goods', "Hasbro Don't Wa"): 'Hasbro_Dont_Wake_Daddy_Board_Game_NJnjGna4u1a',
(1260, 'Consumer Goods', 'Hasbro Life Boa'): 'Hasbro_Life_Board_Game',
(4016, 'Board Games', 'Hasbro Monopoly'): 'Hasbro_Monopoly_Hotels_Game',
(4712, 'Board Games', 'Hasbro Trivial '): 'Hasbro_Trivial_Pursuit_Family_Edition_Game',
(17748, 'None', 'Heavy-Duty Flas'): 'HeavyDuty_Flashlight',
(13430, 'None', 'Hefty Waste Bas'): 'Hefty_Waste_Basket_Decorative_Bronze_85_liter',
(6462, 'Consumer Goods', 'Hey You, Pikach'): 'Hey_You_Pikachu_Nintendo_64',
(12072, 'Shoe', 'Hilary'): 'Hilary',
(43926, 'None', 'Home Fashions W'): 'Home_Fashions_Washcloth_Linen',
(48028, 'None', 'Home Fashions W'): 'Home_Fashions_Washcloth_Olive_Green',
(12128, 'Bag', 'Horse Dreams Pe'): 'Horse_Dreams_Pencil_Case',
(12696, 'Bag', 'Horses in Pink '): 'Horses_in_Pink_Pencil_Case',
(3506, 'Media Cases', 'House of Cards:'): 'House_of_Cards_The_Complete_First_Season_4_Discs_DVD',
(8834, 'Bottles and Cans and Cups', 'Hyaluronic Acid'): 'Hyaluronic_Acid',
(4036, 'Headphones', 'HyperX Cloud II'): 'HyperX_Cloud_II_Headset_Gun_Metal',
(3990, 'Headphones', 'HyperX Cloud II'): 'HyperX_Cloud_II_Headset_Red',
(5168, 'None', 'INTERNATIONAL P'): 'INTERNATIONAL_PAPER_Willamette_4_Brown_Bag_500Count',
(27334, 'Action Figures', 'Imaginext Castl'): 'Imaginext_Castle_Ogre',
(18272, 'None', 'In Green Compan'): 'In_Green_Company_Surface_Saver_Ring_10_Terra_Cotta',
(9522, 'Bottles and Cans and Cups', 'Inositol'): 'Inositol',
(9408, 'None', 'InterDesign Ove'): 'InterDesign_Over_Door',
(9094, 'Bottles and Cans and Cups', 'Iso-Rich Soy'): 'IsoRich_Soy',
(15856, 'None', 'J.A. Henckels I'): 'JA_Henckels_International_Premio_Cutlery_Block_Set_14Piece',
(6928, 'Consumer Goods', 'JBL Charge Spea'): 'JBL_Charge_Speaker_portable_wireless_wired_Green',