jimchen2 commited on
Commit
06b3545
·
verified ·
1 Parent(s): 0e6efbb

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. clevrer_lite/__init__.py +8 -0
  2. clevrer_lite/config.py +50 -0
  3. clevrer_lite/env.py +164 -0
  4. clevrer_lite/events.py +73 -0
  5. clevrer_lite/generate_dataset.py +124 -0
  6. clevrer_lite/physics.py +98 -0
  7. clevrer_lite/questions.py +451 -0
  8. clevrer_lite/renderer.py +104 -0
  9. clevrer_lite/simulate.py +153 -0
  10. demo_episode.gif +3 -0
  11. output/annotations.json +3237 -0
  12. output/dataset_100/annotations.json +0 -0
  13. output/dataset_100/videos/video_00000.gif +3 -0
  14. output/dataset_100/videos/video_00001.gif +3 -0
  15. output/dataset_100/videos/video_00002.gif +3 -0
  16. output/dataset_100/videos/video_00003.gif +3 -0
  17. output/dataset_100/videos/video_00004.gif +3 -0
  18. output/dataset_100/videos/video_00005.gif +3 -0
  19. output/dataset_100/videos/video_00006.gif +3 -0
  20. output/dataset_100/videos/video_00007.gif +3 -0
  21. output/dataset_100/videos/video_00008.gif +3 -0
  22. output/dataset_100/videos/video_00009.gif +3 -0
  23. output/dataset_100/videos/video_00010.gif +3 -0
  24. output/dataset_100/videos/video_00011.gif +3 -0
  25. output/dataset_100/videos/video_00012.gif +3 -0
  26. output/dataset_100/videos/video_00013.gif +3 -0
  27. output/dataset_100/videos/video_00014.gif +3 -0
  28. output/dataset_100/videos/video_00015.gif +3 -0
  29. output/dataset_100/videos/video_00016.gif +3 -0
  30. output/dataset_100/videos/video_00017.gif +3 -0
  31. output/dataset_100/videos/video_00018.gif +3 -0
  32. output/dataset_100/videos/video_00019.gif +3 -0
  33. output/dataset_100/videos/video_00020.gif +3 -0
  34. output/dataset_100/videos/video_00021.gif +3 -0
  35. output/dataset_100/videos/video_00022.gif +3 -0
  36. output/dataset_100/videos/video_00023.gif +3 -0
  37. output/dataset_100/videos/video_00024.gif +3 -0
  38. output/dataset_100/videos/video_00025.gif +3 -0
  39. output/dataset_100/videos/video_00026.gif +3 -0
  40. output/dataset_100/videos/video_00027.gif +3 -0
  41. output/dataset_100/videos/video_00028.gif +3 -0
  42. output/dataset_100/videos/video_00029.gif +3 -0
  43. output/dataset_100/videos/video_00030.gif +3 -0
  44. output/dataset_100/videos/video_00031.gif +3 -0
  45. output/dataset_100/videos/video_00032.gif +3 -0
  46. output/dataset_100/videos/video_00033.gif +3 -0
  47. output/dataset_100/videos/video_00034.gif +3 -0
  48. output/dataset_100/videos/video_00035.gif +3 -0
  49. output/dataset_100/videos/video_00036.gif +3 -0
  50. output/dataset_100/videos/video_00037.gif +3 -0
clevrer_lite/__init__.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ """CLEVRER-lite: a small CLEVRER-like video-reasoning environment with a gym API."""
2
+
3
+ from .env import CLEVRERLiteEnv
4
+ from . import config, physics, renderer, simulate, events, questions
5
+
6
+ __all__ = ["CLEVRERLiteEnv", "config", "physics", "renderer", "simulate",
7
+ "events", "questions"]
8
+ __version__ = "0.1.0"
clevrer_lite/config.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Global configuration: CLEVRER-style attributes, palette and physics constants."""
2
+
3
+ # ---------------------------------------------------------------- attributes
4
+ # The 8 CLEVRER colors (RGB, roughly matched to CLEVRER's palette).
5
+ COLORS = {
6
+ "gray": (144, 144, 148),
7
+ "red": (196, 44, 38),
8
+ "blue": ( 46, 71, 190),
9
+ "green": ( 62, 131, 55),
10
+ "brown": ( 96, 58, 33),
11
+ "purple": (110, 46, 150),
12
+ "cyan": ( 63, 156, 158),
13
+ "yellow": (196, 150, 18),
14
+ }
15
+ COLOR_NAMES = list(COLORS.keys())
16
+
17
+ SHAPES = ["cube", "sphere", "cylinder"]
18
+ MATERIALS = ["rubber", "metal"]
19
+ SIZES = ["small", "large"]
20
+
21
+ # physical radius range for each size class (world units)
22
+ SIZE_RADIUS = {"small": (0.14, 0.20), "large": (0.26, 0.34)}
23
+
24
+ # ---------------------------------------------------------------- world
25
+ WORLD_HALF = 2.0 # arena is [-WORLD_HALF, WORLD_HALF]^2 (top-down view)
26
+ SPAWN_HALF = 1.55 # objects spawn inside [-SPAWN_HALF, SPAWN_HALF]^2
27
+
28
+ # ---------------------------------------------------------------- physics
29
+ FRAME_DT = 1.0 / 25.0 # one rendered frame = 40 ms (25 fps)
30
+ SUBSTEPS = 5 # physics substeps per rendered frame
31
+ SUB_DT = FRAME_DT / SUBSTEPS # physics integration step
32
+
33
+ SPEED_RANGE = (0.7, 1.7) # initial speed range for moving objects
34
+ RESTITUTION = 0.95 # object-object bounciness
35
+ WALL_RESTITUTION = 0.90 # object-wall bounciness
36
+ DRAG = 0.9992 # velocity decay per substep (tiny air drag)
37
+
38
+ DENSITY = {"rubber": 1.0, "metal": 2.5}
39
+
40
+ MOVE_THRESH = 0.12 # |v| above this counts as "moving"
41
+ MIN_RUN_FRAMES = 4 # a motion segment must last this many frames
42
+ MIN_EVENT_GAP_FRAMES = 6 # same-pair contacts within this window = 1 event
43
+ CAUSE_WINDOW_FRAMES = 4 # collision this close to a start-of-motion explains it
44
+
45
+ # ---------------------------------------------------------------- probe (gym agent)
46
+ PROBE_COLOR = "gray"
47
+ PROBE_SIZE = "medium"
48
+ PROBE_RADIUS = 0.22
49
+ PROBE_IMPULSE = 1.1 # delta-v applied to the probe ball per action
50
+ ACTION_LABELS = ["noop", "push_east", "push_north", "push_west", "push_south"]
clevrer_lite/env.py ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """OpenAI Gym wrapper for the CLEVRER-lite environment.
2
+
3
+ env = CLEVRERLiteEnv()
4
+ obs, info = env.reset(seed=0)
5
+ obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
6
+
7
+ Observation: (frame_size, frame_size, 3) uint8 RGB frame (top-down view).
8
+ Action: Discrete(5) - {noop, push probe ball E/N/W/S}.
9
+ With ``probe=False`` every action is a no-op, giving the purely
10
+ passive CLEVRER dynamics.
11
+ Reward: 0.0 (the task is video reasoning, not control).
12
+ Info: per-frame physics state + collisions so far.
13
+
14
+ The env records the full trajectory, so after an episode you can call
15
+ ``extract_events()`` / ``build_questions()`` to get CLEVRER-style annotations.
16
+ """
17
+
18
+ import numpy as np
19
+
20
+ try:
21
+ import gym
22
+ except ImportError: # pragma: no cover
23
+ import gymnasium as gym
24
+ from gym import spaces
25
+
26
+ from . import config, renderer, simulate, events as events_mod, questions as questions_mod
27
+
28
+
29
+ class CLEVRERLiteEnv(gym.Env):
30
+ """A CLEVRER-like world of colliding objects as a gym environment."""
31
+
32
+ metadata = {
33
+ "render_modes": ["rgb_array"],
34
+ "render_fps": int(round(1.0 / config.FRAME_DT)),
35
+ }
36
+
37
+ def __init__(self, num_objects=(3, 6), num_frames=64, frame_size=128,
38
+ probe=False, min_collisions=2, min_initially_moving=2,
39
+ render_mode=None):
40
+ self.num_objects = (tuple(num_objects) if isinstance(num_objects, (tuple, list))
41
+ else (int(num_objects), int(num_objects)))
42
+ self.num_frames = int(num_frames)
43
+ self.frame_size = int(frame_size)
44
+ self.probe = bool(probe)
45
+ self.min_collisions = int(min_collisions)
46
+ self.min_initially_moving = int(min_initially_moving)
47
+ self.render_mode = render_mode
48
+
49
+ self.observation_space = spaces.Box(0, 255, (self.frame_size, self.frame_size, 3),
50
+ np.uint8)
51
+ self.action_space = spaces.Discrete(len(config.ACTION_LABELS))
52
+
53
+ # episode state
54
+ self._spec = None
55
+ self._bodies = None
56
+ self._t = 0
57
+ self._last_obs = None
58
+ self._trajectory = None
59
+ self._collisions = []
60
+ self._wall_hits = []
61
+
62
+ # ------------------------------------------------------------------ api
63
+ def reset(self, *, seed=None, options=None):
64
+ super().reset(seed=seed)
65
+ rng = self.np_random
66
+
67
+ # sample a scene that is rich enough for causal questions
68
+ for _ in range(60):
69
+ spec = simulate.sample_spec(rng, rng.integers(self.num_objects[0],
70
+ self.num_objects[1] + 1),
71
+ probe=self.probe)
72
+ bodies = simulate.bodies_from_spec(spec)
73
+ out = simulate.rollout(bodies, self.num_frames)
74
+ ev = events_mod.extract_events(out["states"], out["collisions"],
75
+ out["wall_hits"], n=len(bodies))
76
+ stationary = [i for i in range(len(bodies))
77
+ if i not in ev["initially_moving"]]
78
+ if (len(ev["collisions"]) >= self.min_collisions
79
+ and len(ev["initially_moving"]) >= self.min_initially_moving
80
+ and (not self.probe or len(stationary) >= 1)):
81
+ break
82
+ else:
83
+ pass # keep the last sample even if not ideal
84
+
85
+ self._spec = spec
86
+ self._bodies = simulate.bodies_from_spec(spec)
87
+ self._t = 0
88
+ self._collisions = []
89
+ self._wall_hits = []
90
+ self._trajectory = np.zeros((self.num_frames, len(self._bodies), 4))
91
+ self._last_obs = self._render()
92
+ return self._last_obs, self._info()
93
+
94
+ def step(self, action):
95
+ if self._bodies is None:
96
+ raise RuntimeError("call reset() before step()")
97
+ action = int(action)
98
+
99
+ def action_fn(t, bodies):
100
+ if self.probe and action != 0:
101
+ dirs = {1: (1, 0), 2: (0, 1), 3: (-1, 0), 4: (0, -1)}
102
+ dx, dy = dirs[action]
103
+ for b in bodies:
104
+ if b.is_probe:
105
+ b.vel = b.vel + np.array([dx, dy]) * (config.PROBE_IMPULSE / b.mass)
106
+
107
+ out = simulate.rollout(self._bodies, 1, render_fn=None, action_fn=action_fn)
108
+ t = self._t
109
+ self._trajectory[t] = out["states"][0]
110
+ for c in out["collisions"]:
111
+ self._collisions.append((t, c[1], c[2]))
112
+ for (_, i, ax, s) in out["wall_hits"]:
113
+ self._wall_hits.append((t, i, ax, s))
114
+
115
+ self._t += 1
116
+ self._last_obs = self._render()
117
+ truncated = bool(self._t >= self.num_frames)
118
+ info = self._info()
119
+ info.update({
120
+ "frame": self._t - 1,
121
+ "collisions_so_far": len(self._collisions),
122
+ "latest_collision": self._collisions[-1] if self._collisions else None,
123
+ "truncated": truncated,
124
+ })
125
+ return self._last_obs, 0.0, False, truncated, info
126
+
127
+ def render(self):
128
+ return self._last_obs
129
+
130
+ def close(self):
131
+ self._bodies = None
132
+
133
+ # ------------------------------------------------------------ utilities
134
+ @property
135
+ def scene(self):
136
+ """Scene spec (list of dicts) of the current episode."""
137
+ return self._spec
138
+
139
+ @property
140
+ def trajectory(self):
141
+ """(T, n, 4) array of (x, y, vx, vy) recorded so far."""
142
+ return self._trajectory
143
+
144
+ def extract_events(self):
145
+ return events_mod.extract_events(self._trajectory, self._collisions,
146
+ self._wall_hits, n=len(self._bodies))
147
+
148
+ def build_questions(self, ev=None, max_questions=8):
149
+ ev = ev if ev is not None else self.extract_events()
150
+ return questions_mod.build_questions(self._spec, ev, self.np_random,
151
+ self.num_frames,
152
+ max_questions=max_questions)
153
+
154
+ # ------------------------------------------------------------ internals
155
+ def _render(self):
156
+ return renderer.render(self._bodies, size=self.frame_size)
157
+
158
+ def _info(self):
159
+ return {
160
+ "t": self._t,
161
+ "objects": [b.idx for b in self._bodies],
162
+ "positions": np.array([b.pos for b in self._bodies]),
163
+ "speeds": np.array([b.speed for b in self._bodies]),
164
+ }
clevrer_lite/events.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Extract causal events (collisions, starts/stops of motion) from a trajectory.
2
+
3
+ This is what makes question generation *grounded*: every question/answer is
4
+ derived from events that verifiably happened in the recorded physics rollout.
5
+ """
6
+
7
+ import numpy as np
8
+
9
+ from . import config
10
+
11
+
12
+ def extract_events(states, collisions, wall_hits, n):
13
+ """Args:
14
+ states: (T, n, 4) per-frame (x, y, vx, vy)
15
+ collisions: [(t, i, j)] substep-level contact log
16
+ wall_hits: [(t, i, axis, side)]
17
+ n: number of objects
18
+
19
+ Returns dict with:
20
+ collisions: [{frame, objects:[i,j]}] grouped collision events
21
+ starts: {obj_idx: [frames]} times each object starts moving
22
+ stops: {obj_idx: [frames]}
23
+ initially_moving: [obj_idx]
24
+ moving: (T, n) bool mask
25
+ speeds: (T, n)
26
+ """
27
+ T = states.shape[0]
28
+ speeds = np.linalg.norm(states[:, :, 2:], axis=-1) # (T, n)
29
+ moving = speeds > config.MOVE_THRESH
30
+
31
+ # ---- group the contact log into collision events ----
32
+ grouped = []
33
+ for (t, i, j) in sorted(collisions, key=lambda c: c[0]):
34
+ if grouped and grouped[-1]["objects"] == [i, j] and \
35
+ t - grouped[-1]["end"] <= config.MIN_EVENT_GAP_FRAMES:
36
+ grouped[-1]["end"] = t
37
+ else:
38
+ grouped.append({"frame": t, "end": t, "objects": [i, j]})
39
+ collision_events = [{"frame": g["frame"], "objects": g["objects"]} for g in grouped]
40
+
41
+ # ---- start / stop of motion per object ----
42
+ starts, stops, initially_moving = {}, {}, []
43
+ min_run = config.MIN_RUN_FRAMES
44
+ for o in range(n):
45
+ m = moving[:, o]
46
+ sts, sps = [], []
47
+ t = 0
48
+ while t < T:
49
+ if m[t]:
50
+ t2 = t
51
+ while t2 < T and m[t2]:
52
+ t2 += 1
53
+ if t2 - t >= min_run:
54
+ if t == 0:
55
+ initially_moving.append(o)
56
+ else:
57
+ sts.append(t)
58
+ sps.append(t2) # frame where it (first) stops
59
+ t = t2
60
+ else:
61
+ t += 1
62
+ starts[o] = sts
63
+ stops[o] = [s for s in sps if s < T - 1] # ignore end-of-video "stop"
64
+
65
+ return {
66
+ "collisions": collision_events,
67
+ "starts": starts,
68
+ "stops": stops,
69
+ "initially_moving": sorted(initially_moving),
70
+ "moving": moving,
71
+ "speeds": speeds,
72
+ "wall_hits": wall_hits,
73
+ }
clevrer_lite/generate_dataset.py ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Generate a small CLEVRER-lite dataset (GIF videos + JSON annotations).
3
+
4
+ Examples:
5
+ python -m clevrer_lite.generate_dataset --num-videos 8 --num-frames 64 --frame-size 128
6
+ python -m clevrer_lite.generate_dataset --out data/big --num-videos 1000 --num-frames 128
7
+ """
8
+
9
+ import argparse
10
+ import json
11
+ import os
12
+ import time
13
+
14
+ import numpy as np
15
+ from PIL import Image
16
+
17
+ from . import CLEVRERLiteEnv, config, simulate
18
+
19
+
20
+ def describe_events(spec, ev):
21
+ """Human-readable event descriptions for the annotation file."""
22
+ objs = {o["idx"]: o for o in spec}
23
+
24
+ def ref(i):
25
+ return "the {} {}".format(objs[i]["color"], objs[i]["shape"])
26
+
27
+ collisions = [{
28
+ "frame": e["frame"],
29
+ "objects": e["objects"],
30
+ "description": f"{ref(e['objects'][0])} collided with {ref(e['objects'][1])}",
31
+ } for e in ev["collisions"]]
32
+
33
+ motion = []
34
+ for o, sts in ev["starts"].items():
35
+ for s in sts:
36
+ cause = None
37
+ for e in ev["collisions"]:
38
+ a, b = e["objects"]
39
+ if o in (a, b) and abs(e["frame"] - s) <= config.CAUSE_WINDOW_FRAMES:
40
+ cause = e
41
+ break
42
+ motion.append({"object": o, "type": "start", "frame": s,
43
+ "cause_collision": cause})
44
+ return {"collision_events": collisions, "motion_events": motion,
45
+ "initially_moving": ev["initially_moving"]}
46
+
47
+
48
+ def main():
49
+ ap = argparse.ArgumentParser(description="Generate a CLEVRER-lite dataset")
50
+ ap.add_argument("--out", default="output")
51
+ ap.add_argument("--num-videos", type=int, default=8)
52
+ ap.add_argument("--num-frames", type=int, default=64)
53
+ ap.add_argument("--frame-size", type=int, default=128)
54
+ ap.add_argument("--seed", type=int, default=0)
55
+ ap.add_argument("--gif-fps", type=int, default=12)
56
+ ap.add_argument("--max-questions", type=int, default=8)
57
+ args = ap.parse_args()
58
+
59
+ video_dir = os.path.join(args.out, "videos")
60
+ os.makedirs(video_dir, exist_ok=True)
61
+
62
+ env = CLEVRERLiteEnv(num_frames=args.num_frames, frame_size=args.frame_size)
63
+ annotations = []
64
+ t0 = time.time()
65
+
66
+ for v in range(args.num_videos):
67
+ obs, info = env.reset(seed=args.seed + v)
68
+ frames = [obs]
69
+ while True:
70
+ obs, reward, terminated, truncated, info = env.step(0) # passive
71
+ frames.append(obs)
72
+ if truncated:
73
+ break
74
+
75
+ ev = env.extract_events()
76
+ qs = env.build_questions(ev, max_questions=args.max_questions)
77
+ ev_public = {k: v for k, v in ev.items() if k not in ("moving", "speeds")}
78
+
79
+ fname = f"video_{v:05d}.gif"
80
+ imgs = [Image.fromarray(f) for f in frames]
81
+ imgs[0].save(os.path.join(video_dir, fname), save_all=True,
82
+ append_images=imgs[1:], duration=int(1000 / args.gif_fps),
83
+ loop=0)
84
+
85
+ record = {
86
+ "video_index": v,
87
+ "video_filename": f"videos/{fname}",
88
+ "num_frames": args.num_frames,
89
+ "frame_size": args.frame_size,
90
+ "fps": env.metadata["render_fps"],
91
+ "scene": {"objects": env.scene},
92
+ "events": describe_events(env.scene, ev),
93
+ "raw_events": {
94
+ "collisions": ev_public["collisions"],
95
+ "starts": {str(k): v for k, v in ev_public["starts"].items()},
96
+ "stops": {str(k): v for k, v in ev_public["stops"].items()},
97
+ "initially_moving": ev_public["initially_moving"],
98
+ "wall_hits": [list(map(int, w)) for w in ev_public["wall_hits"]],
99
+ },
100
+ "questions": qs,
101
+ }
102
+ annotations.append(record)
103
+ n_col = len(ev["collisions"])
104
+ print(f"[{v + 1}/{args.num_videos}] {fname}: "
105
+ f"{len(env.scene)} objects, {n_col} collisions, {len(qs)} questions")
106
+
107
+ with open(os.path.join(args.out, "annotations.json"), "w") as f:
108
+ json.dump(annotations, f, indent=2)
109
+
110
+ dt = time.time() - t0
111
+ print(f"\nDone: {args.num_videos} videos in {dt:.1f}s "
112
+ f"({dt / args.num_videos:.2f}s/video) -> {args.out}/")
113
+ print(f"Total questions: {sum(len(a['questions']) for a in annotations)}")
114
+
115
+ # quick distribution summary
116
+ from collections import Counter
117
+ types = Counter(q["question_type"] for a in annotations for q in a["questions"])
118
+ print("Question types:", dict(types))
119
+ answers = Counter(q["answer"] for a in annotations for q in a["questions"])
120
+ print("Top answers:", dict(answers.most_common(8)))
121
+
122
+
123
+ if __name__ == "__main__":
124
+ main()
clevrer_lite/physics.py ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Minimal 2D rigid-body physics: discs in a box with elastic collisions.
2
+
3
+ Cubes and cylinders are *rendered* as squares / rings (top-down view, like
4
+ looking down on the CLEVRER scene) but use a circular footprint for physics.
5
+ This keeps the engine tiny, stable and fast while preserving the causal event
6
+ structure (collisions, starts/stops of motion) that CLEVRER questions need.
7
+ """
8
+
9
+ from dataclasses import dataclass, field
10
+ import numpy as np
11
+
12
+ from . import config
13
+
14
+
15
+ @dataclass
16
+ class Body:
17
+ idx: int
18
+ color: str
19
+ shape: str
20
+ material: str
21
+ size: str
22
+ radius: float
23
+ pos: np.ndarray # (2,) world coordinates
24
+ vel: np.ndarray # (2,)
25
+ spin: float = 0.0 # visual angular velocity (rad/s)
26
+ angle: float = 0.0 # visual rotation angle (rad)
27
+ mass: float = 1.0
28
+ is_probe: bool = False
29
+
30
+ @property
31
+ def speed(self) -> float:
32
+ return float(np.linalg.norm(self.vel))
33
+
34
+
35
+ def mass_of(radius: float, material: str) -> float:
36
+ # all shapes use a circular footprint: m = density * pi * r^2
37
+ return config.DENSITY[material] * np.pi * radius ** 2
38
+
39
+
40
+ class World:
41
+ """A box arena with elastic object-object and object-wall collisions."""
42
+
43
+ def __init__(self, bodies, half: float = config.WORLD_HALF):
44
+ self.bodies = list(bodies)
45
+ self.half = half
46
+
47
+ def step(self, h: float):
48
+ """Advance physics by h seconds.
49
+
50
+ Returns:
51
+ contacts: list of (idx_a, idx_b) pairs that collided this step
52
+ wall_hits: list of (idx, axis, side) with side in {-1, +1}
53
+ """
54
+ contacts, wall_hits = [], []
55
+
56
+ # integrate
57
+ for b in self.bodies:
58
+ b.pos = b.pos + b.vel * h
59
+ b.vel = b.vel * config.DRAG
60
+ b.angle = (b.angle + b.spin * h) % (2.0 * np.pi)
61
+
62
+ # pairwise object collisions
63
+ bs = self.bodies
64
+ for i in range(len(bs)):
65
+ for j in range(i + 1, len(bs)):
66
+ A, B = bs[i], bs[j]
67
+ d = B.pos - A.pos
68
+ dist = float(np.linalg.norm(d))
69
+ rsum = A.radius + B.radius
70
+ if dist < rsum and dist > 1e-9:
71
+ n = d / dist
72
+ # impulse along the normal if approaching
73
+ v_rel_n = float(np.dot(B.vel - A.vel, n))
74
+ if v_rel_n < 0.0:
75
+ e = config.RESTITUTION
76
+ jimp = -(1.0 + e) * v_rel_n / (1.0 / A.mass + 1.0 / B.mass)
77
+ A.vel = A.vel - (jimp / A.mass) * n
78
+ B.vel = B.vel + (jimp / B.mass) * n
79
+ contacts.append((A.idx, B.idx))
80
+ # positional correction so objects never sink into each other
81
+ push = n * (0.5 * (rsum - dist))
82
+ A.pos = A.pos - push
83
+ B.pos = B.pos + push
84
+
85
+ # walls
86
+ for b in self.bodies:
87
+ for ax in range(2):
88
+ lim = self.half - b.radius
89
+ if b.pos[ax] > lim and b.vel[ax] > 0:
90
+ b.pos[ax] = lim
91
+ b.vel[ax] = -b.vel[ax] * config.WALL_RESTITUTION
92
+ wall_hits.append((b.idx, ax, +1))
93
+ elif b.pos[ax] < -lim and b.vel[ax] < 0:
94
+ b.pos[ax] = -lim
95
+ b.vel[ax] = -b.vel[ax] * config.WALL_RESTITUTION
96
+ wall_hits.append((b.idx, ax, -1))
97
+
98
+ return contacts, wall_hits
clevrer_lite/questions.py ADDED
@@ -0,0 +1,451 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """CLEVRER-style question generation.
2
+
3
+ Every question is generated from the *extracted events* of the recorded
4
+ trajectory, so questions and answers are grounded in what actually happened.
5
+ Question types mirror CLEVRER:
6
+
7
+ descriptive - single/multi-step perception on the first frame
8
+ ("How many red objects?", "What color is the sphere?")
9
+ explanatory - causal/temporal reasoning about collision & motion events
10
+ ("What happened right after ... collided?")
11
+ predictive - "Will A collide with B by the end of the video?"
12
+ counterfactual - answered by *re-simulating* the scene with one object
13
+ removed, exactly like the real CLEVRER pipeline.
14
+
15
+ Each question carries: text, answer, multiple-choice list + answer index,
16
+ type, template id, and a simplified functional program.
17
+ """
18
+
19
+ import numpy as np
20
+
21
+ from . import config, simulate
22
+
23
+ _NOTHING = "nothing happened"
24
+
25
+ _ATTR_ORDER = ["size", "material", "color", "shape"]
26
+
27
+
28
+ # --------------------------------------------------------------------------
29
+ # helpers
30
+ # --------------------------------------------------------------------------
31
+
32
+ def _ref(obj, objs):
33
+ """Shortest unambiguous CLEVRER-style reference, e.g. 'the red sphere'."""
34
+ for attrs in (("color", "shape"), ("color",), ("shape",),
35
+ ("size", "color", "shape"), ("material", "color", "shape"),
36
+ ("size", "material", "color", "shape")):
37
+ vals = tuple(obj[a] for a in attrs)
38
+ if sum(1 for o in objs if tuple(o[a] for a in attrs) == vals) == 1:
39
+ ordered = [a for a in _ATTR_ORDER if a in attrs]
40
+ return "the " + " ".join(obj[a] for a in ordered)
41
+ return f"the object {obj['idx']}"
42
+
43
+
44
+ def _shuffle_choices(ans, distractors, rng):
45
+ """Build a shuffled choice list; returns (choices, answer_index)."""
46
+ choices = [ans] + [d for d in distractors if d != ans]
47
+ choices = list(dict.fromkeys(choices)) # dedupe, keep order
48
+ perm = rng.permutation(len(choices))
49
+ choices = [choices[i] for i in perm]
50
+ return choices, int(choices.index(ans))
51
+
52
+
53
+ def _numeric_choices(ans, lo, hi, rng, k=6):
54
+ vals = {ans}
55
+ pool = [v for v in range(lo, hi + 1) if v != ans]
56
+ if pool:
57
+ vals |= set(int(x) for x in rng.choice(pool, size=min(k - 1, len(pool)),
58
+ replace=False))
59
+ return [str(v) for v in sorted(vals)]
60
+
61
+
62
+ def _q(question, answer, choices, answer_index, qtype, template, program):
63
+ answer = str(answer)
64
+ if answer_index is None:
65
+ answer_index = choices.index(answer)
66
+ return {"question": question, "answer": answer, "choices": choices,
67
+ "answer_index": answer_index, "question_type": qtype,
68
+ "template": template, "program": program}
69
+
70
+
71
+ def _col_choices(ans, rng):
72
+ names = list(config.COLOR_NAMES)
73
+ perm = rng.permutation(len(names))
74
+ choices = [names[i] for i in perm]
75
+ return choices, choices.index(ans)
76
+
77
+
78
+ # --------------------------------------------------------------------------
79
+ # descriptive questions (about the first frame)
80
+ # --------------------------------------------------------------------------
81
+
82
+ def _descriptive(objs, ev, rng):
83
+ out = []
84
+ n = len(objs)
85
+ pos0 = {o["idx"]: o["position"] for o in objs}
86
+
87
+ out.append(_q("How many objects are there?", str(n),
88
+ _numeric_choices(n, 0, max(6, n), rng), None,
89
+ "descriptive", "count_all",
90
+ [{"op": "count"}]))
91
+
92
+ # count by attribute
93
+ for key, noun in (("color", "objects"), ("shape", "objects"),
94
+ ("material", "objects")):
95
+ values = sorted({o[key] for o in objs})
96
+ for v in values:
97
+ cnt = sum(1 for o in objs if o[key] == v)
98
+ phrase = f"How many {v} {noun} are there?"
99
+ prog = [{"op": f"filter_{key}", "value": v}, {"op": "count"}]
100
+ ch = _numeric_choices(cnt, 0, max(6, n), rng)
101
+ out.append(_q(phrase, str(cnt), ch, None, "descriptive",
102
+ f"count_{key}", prog))
103
+
104
+ # query color of a unique shape
105
+ for sh in config.SHAPES:
106
+ same = [o for o in objs if o["shape"] == sh]
107
+ if len(same) == 1:
108
+ o = same[0]
109
+ ch, ai = _col_choices(o["color"], rng)
110
+ out.append(_q(f"What color is the {sh}?", o["color"], ch, ai,
111
+ "descriptive", "query_color",
112
+ [{"op": "filter_shape", "value": sh},
113
+ {"op": "query_color"}]))
114
+
115
+ # query shape of a unique color
116
+ for col in config.COLOR_NAMES:
117
+ same = [o for o in objs if o["color"] == col]
118
+ if len(same) == 1:
119
+ o = same[0]
120
+ ch = list(config.SHAPES)
121
+ perm = rng.permutation(len(ch))
122
+ ch = [ch[i] for i in perm]
123
+ out.append(_q(f"What shape is the {col} object?", o["shape"], ch,
124
+ list(ch).index(o["shape"]), "descriptive",
125
+ "query_shape",
126
+ [{"op": "filter_color", "value": col},
127
+ {"op": "query_shape"}]))
128
+
129
+ # query material of a unique color+shape
130
+ for o in objs:
131
+ same = [x for x in objs if x["color"] == o["color"] and x["shape"] == o["shape"]]
132
+ if len(same) == 1:
133
+ ch = list(config.MATERIALS)
134
+ perm = rng.permutation(len(ch))
135
+ ch = [ch[i] for i in perm]
136
+ out.append(_q(f"What material is the {o['color']} {o['shape']} made of?",
137
+ o["material"], ch, ch.index(o["material"]),
138
+ "descriptive", "query_material",
139
+ [{"op": "filter_color", "value": o["color"]},
140
+ {"op": "filter_shape", "value": o["shape"]},
141
+ {"op": "query_material"}]))
142
+
143
+ # spatial relations (margin so 'left of' is unambiguous, exactly one match)
144
+ margin = 0.6
145
+ dirs = {
146
+ "left of": lambda a, b: (b[0] - a[0]) >= margin, # a is left of b
147
+ "right of": lambda a, b: (a[0] - b[0]) >= margin,
148
+ "behind": lambda a, b: (a[1] - b[1]) >= margin, # +y is far/back
149
+ "in front of": lambda a, b: (b[1] - a[1]) >= margin,
150
+ }
151
+ for rb in objs:
152
+ for name, fn in dirs.items():
153
+ cands = [o for o in objs if o["idx"] != rb["idx"] and
154
+ fn(pos0[o["idx"]], pos0[rb["idx"]])]
155
+ if len(cands) == 1:
156
+ o = cands[0]
157
+ ch, ai = _col_choices(o["color"], rng)
158
+ out.append(_q(f"What color is the object {name} {_ref(rb, objs)}?",
159
+ o["color"], ch, ai, "descriptive", "query_color_rel",
160
+ [{"op": "filter_color", "value": rb["color"]},
161
+ {"op": "relate", "direction": name.replace(" ", "_")},
162
+ {"op": "query_color"}]))
163
+ return out
164
+
165
+
166
+ # --------------------------------------------------------------------------
167
+ # explanatory questions (causal / temporal)
168
+ # --------------------------------------------------------------------------
169
+
170
+ def _coll_desc(objs, a, b):
171
+ return f"{_ref(a, objs)} collided with {_ref(b, objs)}"
172
+
173
+
174
+ def _explanatory(objs, ev, rng):
175
+ out = []
176
+ cev = ev["collisions"]
177
+ idx_of = {o["idx"]: o for o in objs}
178
+ refc = {o["idx"]: _ref(o, objs) for o in objs}
179
+
180
+ if not cev:
181
+ return out
182
+
183
+ def ev_desc(e):
184
+ a, b = e["objects"]
185
+ return _coll_desc(objs, idx_of[a], idx_of[b])
186
+
187
+ # what happened right after / before a collision
188
+ for k, e in enumerate(cev):
189
+ for direction, other in (("after", k + 1), ("before", k - 1)):
190
+ ans = ev_desc(cev[other]) if 0 <= other < len(cev) else _NOTHING
191
+ distractors = [ev_desc(x) for i, x in enumerate(cev)
192
+ if i not in (k, other)]
193
+ for (t, i, ax, s) in ev["wall_hits"][:40]:
194
+ d = f"{refc[i]} collided with the wall"
195
+ if d not in distractors:
196
+ distractors.append(d)
197
+ for o, sts in ev["starts"].items():
198
+ if o in refc and sts:
199
+ d = f"{refc[o]} started moving"
200
+ if d not in distractors:
201
+ distractors.append(d)
202
+ if ans != _NOTHING and _NOTHING not in distractors:
203
+ distractors.append(_NOTHING)
204
+ if len(distractors) < 3:
205
+ continue
206
+ rng.shuffle(distractors)
207
+ distractors = distractors[:3]
208
+ a, b = e["objects"]
209
+ ch, ai = _shuffle_choices(ans, distractors, rng)
210
+ out.append(_q(f"What happened right {direction} "
211
+ f"{ev_desc(e)}?", ans, ch, ai, "explanatory",
212
+ f"what_happened_{direction}",
213
+ [{"op": "find_collision", "objects": [a, b]},
214
+ {"op": f"query_{direction}_event"}]))
215
+
216
+ # what caused an object to start moving
217
+ for o_idx, sts in ev["starts"].items():
218
+ if o_idx not in idx_of:
219
+ continue
220
+ for s in sts:
221
+ cause = None
222
+ for e in cev:
223
+ a, b = e["objects"]
224
+ if o_idx in (a, b) and abs(e["frame"] - s) <= config.CAUSE_WINDOW_FRAMES:
225
+ cause = b if a == o_idx else a
226
+ break
227
+ if cause is None:
228
+ continue
229
+ ans = f"the collision with {refc[cause]}"
230
+ others = [p for e in cev for p in e["objects"]
231
+ if p not in (o_idx, cause) and p in refc]
232
+ distractors = [f"the collision with {refc[p]}" for p in dict.fromkeys(others)]
233
+ distractors += ["it was pushed by the wall", "nothing - it was already moving"]
234
+ rng.shuffle(distractors)
235
+ ch, ai = _shuffle_choices(ans, distractors[:3], rng)
236
+ out.append(_q(f"What caused {refc[o_idx]} to start moving?", ans, ch, ai,
237
+ "explanatory", "cause_of_motion",
238
+ [{"op": "filter_object", "idx": o_idx},
239
+ {"op": "query_motion_cause"}]))
240
+
241
+ # which object started moving right before / after a collision
242
+ for e in cev:
243
+ a, b = e["objects"]
244
+ t = e["frame"]
245
+ for direction, lo, hi, pick in (("after", t + 1, t + 12, min),
246
+ ("before", max(1, t - 12), t, max)):
247
+ cands = [(s, o) for o, ss in ev["starts"].items()
248
+ if o not in (a, b) and o in idx_of for s in ss
249
+ if lo <= s <= hi]
250
+ if not cands:
251
+ continue
252
+ _, ans_o = pick(cands)
253
+ ans = refc[ans_o]
254
+ others = [o for o in objs if o["idx"] not in (ans_o, a, b)]
255
+ distractors = [_ref(o, objs) for o in others]
256
+ distractors.append("none of them")
257
+ rng.shuffle(distractors)
258
+ ch, ai = _shuffle_choices(ans, distractors[:3], rng)
259
+ out.append(_q(f"Which object started moving right {direction} "
260
+ f"{ev_desc(e)}?", ans, ch, ai, "explanatory",
261
+ f"who_started_{direction}",
262
+ [{"op": "find_collision", "objects": [a, b]},
263
+ {"op": f"query_{direction}_motion_start"}]))
264
+
265
+ # how many objects were moving when a collision happened
266
+ for e in cev:
267
+ a, b = e["objects"]
268
+ t = min(e["frame"], ev["moving"].shape[0] - 1)
269
+ cnt = int(ev["moving"][t].sum())
270
+ ch = _numeric_choices(cnt, 0, len(objs), rng)
271
+ out.append(_q(f"How many objects were moving when {ev_desc(e)}?",
272
+ str(cnt), ch, None, "explanatory", "count_moving_at",
273
+ [{"op": "find_collision", "objects": [a, b]},
274
+ {"op": "count_moving_at_collision"}]))
275
+
276
+ # total number of collisions
277
+ if len(cev) >= 2:
278
+ ch = _numeric_choices(len(cev), 0, max(6, len(cev) + 1), rng)
279
+ out.append(_q("How many collisions happened in the video?",
280
+ str(len(cev)), ch, None, "explanatory",
281
+ "count_collisions",
282
+ [{"op": "filter_event", "type": "collision"}, {"op": "count"}]))
283
+ return out
284
+
285
+
286
+ # --------------------------------------------------------------------------
287
+ # predictive questions (binary, grounded in the full recorded trajectory)
288
+ # --------------------------------------------------------------------------
289
+
290
+ def _predictive(objs, ev, rng):
291
+ out = []
292
+ cev = ev["collisions"]
293
+ idx_of = {o["idx"]: o for o in objs}
294
+ pairs_collided = {tuple(sorted(e["objects"])) for e in cev}
295
+ all_pairs = [tuple(sorted((a["idx"], b["idx"])))
296
+ for i, a in enumerate(objs) for b in objs[i + 1:]]
297
+
298
+ def binary_q(pair, ans_yes, template):
299
+ a, b = pair
300
+ ch = ["yes", "no"]
301
+ rng.shuffle(ch)
302
+ ans = "yes" if ans_yes else "no"
303
+ return _q(f"Will {_ref(idx_of[a], objs)} collide with "
304
+ f"{_ref(idx_of[b], objs)} by the end of the video?",
305
+ ans, ch, ch.index(ans), "predictive", template,
306
+ [{"op": "find_collision", "objects": [a, b]},
307
+ {"op": "query_existence"}])
308
+
309
+ yes_pairs = [p for p in pairs_collided]
310
+ no_pairs = [p for p in all_pairs if p not in pairs_collided]
311
+ if yes_pairs:
312
+ p = yes_pairs[int(rng.integers(len(yes_pairs)))]
313
+ out.append(binary_q(p, True, "will_collide"))
314
+ if no_pairs:
315
+ p = no_pairs[int(rng.integers(len(no_pairs)))]
316
+ out.append(binary_q(p, False, "will_collide"))
317
+
318
+ # after colliding with b, will a collide with something else?
319
+ for e in cev:
320
+ a, b = e["objects"]
321
+ later = [x for x in cev if x is not e and a in x["objects"]
322
+ and x["frame"] > e["frame"]]
323
+ if not later and len(cev) < 2:
324
+ continue
325
+ ans = "yes" if later else "no"
326
+ ch = ["yes", "no"]
327
+ rng.shuffle(ch)
328
+ out.append(_q(f"After {_coll_desc(objs, idx_of[a], idx_of[b])}, "
329
+ f"will {_ref(idx_of[a], objs)} collide with something else?",
330
+ ans, ch, ch.index(ans), "predictive", "will_collide_again",
331
+ [{"op": "find_collision", "objects": [a, b]},
332
+ {"op": "query_subsequent_collision"}]))
333
+ return out
334
+
335
+
336
+ # --------------------------------------------------------------------------
337
+ # counterfactual questions (re-simulate the scene with one object removed)
338
+ # --------------------------------------------------------------------------
339
+
340
+ def _counterfactual(objs, ev, rng, num_frames):
341
+ out = []
342
+ cev = ev["collisions"]
343
+ if not cev or len(objs) < 3:
344
+ return out
345
+ idx_of = {o["idx"]: o for o in objs}
346
+ refc = {o["idx"]: _ref(o, objs) for o in objs}
347
+
348
+ cache = {}
349
+
350
+ def cf_events(z):
351
+ if z not in cache:
352
+ cache[z] = simulate.resimulate_without(
353
+ [dict(s) for s in objs], z, num_frames)
354
+ return cache[z]
355
+
356
+ def binary(ans_yes, question, template, program):
357
+ ch = ["yes", "no"]
358
+ rng.shuffle(ch)
359
+ ans = "yes" if ans_yes else "no"
360
+ out.append(_q(question, ans, ch, ch.index(ans), "counterfactual",
361
+ template, program))
362
+
363
+ # would a still collide with b without z?
364
+ for e in cev:
365
+ a, b = e["objects"]
366
+ others = [o["idx"] for o in objs if o["idx"] not in (a, b)]
367
+ for z in others:
368
+ cf = cf_events(z)
369
+ still = any(set(x["objects"]) == {a, b} for x in cf["collisions"])
370
+ binary(still,
371
+ f"If {refc[z]} were removed, would {refc[a]} still collide "
372
+ f"with {refc[b]}?",
373
+ "cf_collision",
374
+ [{"op": "remove_object", "idx": z},
375
+ {"op": "find_collision", "objects": [a, b]},
376
+ {"op": "query_existence"}])
377
+
378
+ # would o still start moving without z (z can be its collision partner)?
379
+ for o_idx, sts in ev["starts"].items():
380
+ if not sts or o_idx not in idx_of:
381
+ continue
382
+ partners = set()
383
+ for e in cev:
384
+ if o_idx in e["objects"]:
385
+ partners |= {p for p in e["objects"] if p != o_idx}
386
+ others = list(partners) + [o["idx"] for o in objs
387
+ if o["idx"] not in {o_idx} | partners]
388
+ for z in dict.fromkeys(others):
389
+ cf = cf_events(z)
390
+ still = (o_idx in cf["initially_moving"]) or bool(cf["starts"].get(o_idx))
391
+ binary(still,
392
+ f"If {refc[z]} were removed, would {refc[o_idx]} still "
393
+ f"start moving?",
394
+ "cf_motion",
395
+ [{"op": "remove_object", "idx": z},
396
+ {"op": "filter_object", "idx": o_idx},
397
+ {"op": "query_motion_start"}])
398
+ return out
399
+
400
+
401
+ # --------------------------------------------------------------------------
402
+ # orchestration
403
+ # --------------------------------------------------------------------------
404
+
405
+ def build_questions(spec, ev, rng, num_frames, max_questions=8):
406
+ """Return a list of question dicts sampled across the 4 CLEVRER types."""
407
+ objs = [s for s in spec if not s.get("is_probe")]
408
+ probe_idx = {s["idx"] for s in spec if s.get("is_probe")}
409
+
410
+ if probe_idx: # drop probe objects from question-relevant events
411
+ ev = {
412
+ "collisions": [e for e in ev["collisions"] if not probe_idx & set(e["objects"])],
413
+ "starts": {k: v for k, v in ev["starts"].items() if k not in probe_idx},
414
+ "stops": {k: v for k, v in ev["stops"].items() if k not in probe_idx},
415
+ "initially_moving": [k for k in ev["initially_moving"] if k not in probe_idx],
416
+ "moving": ev["moving"],
417
+ "speeds": ev["speeds"],
418
+ "wall_hits": [w for w in ev["wall_hits"] if w[1] not in probe_idx],
419
+ }
420
+
421
+ pools = {
422
+ "descriptive": _descriptive(objs, ev, rng),
423
+ "explanatory": _explanatory(objs, ev, rng),
424
+ "predictive": _predictive(objs, ev, rng),
425
+ "counterfactual": _counterfactual(objs, ev, rng, num_frames),
426
+ }
427
+
428
+ quotas = [("descriptive", 3), ("explanatory", 2),
429
+ ("predictive", 1), ("counterfactual", 2)]
430
+ picked, seen = [], set()
431
+
432
+ def take(pool, k):
433
+ pool = [q for q in pool if q["question"] not in seen]
434
+ rng.shuffle(pool)
435
+ for q in pool[:k]:
436
+ seen.add(q["question"])
437
+ picked.append(q)
438
+
439
+ for qtype, k in quotas:
440
+ take(pools[qtype], k)
441
+ leftover = [q for pool in pools.values() for q in pool
442
+ if q["question"] not in seen]
443
+ rng.shuffle(leftover)
444
+ for q in leftover:
445
+ if len(picked) >= max_questions:
446
+ break
447
+ seen.add(q["question"])
448
+ picked.append(q)
449
+
450
+ rng.shuffle(picked)
451
+ return picked
clevrer_lite/renderer.py ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Top-down PIL renderer for the 2D CLEVRER-lite world.
2
+
3
+ Sphere -> shaded disc with a specular highlight
4
+ Cube -> rotated square with beveled edges
5
+ Cylinder-> ring (dark side + lighter top face), as seen from above
6
+ Metal -> brighter material with a strong specular; rubber is matte.
7
+ """
8
+
9
+ import numpy as np
10
+ from PIL import Image, ImageDraw
11
+
12
+ from . import config
13
+
14
+ _LIGHT = np.array([-0.6, -0.8]) # light comes from top-left
15
+
16
+
17
+ def _shade(rgb, factor):
18
+ return tuple(int(min(255, max(0, c * factor))) for c in rgb)
19
+
20
+
21
+ def _background(size):
22
+ top = np.array([128.0, 128.0, 133.0])
23
+ bot = np.array([100.0, 100.0, 106.0])
24
+ rows = np.linspace(0.0, 1.0, size)[:, None]
25
+ grad = top[None, :] * (1.0 - rows) + bot[None, :] * rows # (size, 3)
26
+ arr = np.repeat(grad[:, None, :], size, axis=1) # (size, size, 3)
27
+ return arr.astype(np.uint8)
28
+
29
+
30
+ def render(bodies, size: int = 128, half: float = config.WORLD_HALF) -> np.ndarray:
31
+ """Render a list of Body objects into an (size, size, 3) uint8 array."""
32
+ ss = 2 # 2x supersampling for anti-aliasing
33
+ S = size * ss
34
+ scale = S / (2.0 * half)
35
+
36
+ def to_px(p):
37
+ return (p[0] + half) * scale, (half - p[1]) * scale # flip y: +y is "behind"
38
+
39
+ img = Image.fromarray(_background(S), "RGB")
40
+
41
+ # ---- soft ground shadows (drawn on an RGBA overlay) ----
42
+ shadow = Image.new("RGBA", (S, S), (0, 0, 0, 0))
43
+ sd = ImageDraw.Draw(shadow)
44
+ off = 0.05 * scale
45
+ for b in bodies:
46
+ cx, cy = to_px(b.pos)
47
+ r = b.radius * scale
48
+ sd.ellipse([cx - r + off, cy - r + off * 0.5, cx + r + off, cy + r + off * 0.5],
49
+ fill=(15, 15, 20, 60))
50
+ img = Image.alpha_composite(img.convert("RGBA"), shadow).convert("RGB")
51
+
52
+ d = ImageDraw.Draw(img)
53
+ spec = Image.new("RGBA", (S, S), (0, 0, 0, 0))
54
+ spd = ImageDraw.Draw(spec)
55
+
56
+ for b in sorted(bodies, key=lambda x: -x.radius):
57
+ base = np.array(config.COLORS[b.color], dtype=float)
58
+ if b.material == "metal":
59
+ base = np.clip(base * 1.25 + 28, 0, 255)
60
+ base = tuple(int(c) for c in base)
61
+ cx, cy = to_px(b.pos)
62
+ r = b.radius * scale
63
+
64
+ if b.shape == "sphere":
65
+ d.ellipse([cx - r, cy - r, cx + r, cy + r], fill=_shade(base, 0.72))
66
+ d.ellipse([cx - 0.92 * r, cy - 0.92 * r, cx + 0.92 * r, cy + 0.92 * r],
67
+ fill=base)
68
+ hi_a = 210 if b.material == "metal" else 90
69
+ spd.ellipse([cx - 0.45 * r, cy - 0.55 * r, cx - 0.05 * r, cy - 0.15 * r],
70
+ fill=(255, 255, 255, hi_a))
71
+
72
+ elif b.shape == "cube":
73
+ hs = r * 0.88 # half side s.t. area ~ circle
74
+ ang = b.angle
75
+ ca, sa = np.cos(ang), np.sin(ang)
76
+ corners = []
77
+ for dx, dy in ((-1, -1), (1, -1), (1, 1), (-1, 1)):
78
+ corners.append((cx + hs * (dx * ca - dy * sa),
79
+ cy + hs * (dx * sa + dy * ca)))
80
+ d.polygon(corners, fill=base)
81
+ # bevel: edges facing the light are bright, others dark
82
+ for k in range(4):
83
+ a_, b_ = corners[k], corners[(k + 1) % 4]
84
+ ex, ey = b_[0] - a_[0], b_[1] - a_[1]
85
+ ln = np.hypot(ex, ey) + 1e-9
86
+ nx, ny = -ey / ln, ex / ln # outward normal (polygon is CCW on screen)
87
+ if nx * _LIGHT[0] + ny * _LIGHT[1] < 0:
88
+ col = _shade(base, 1.45 if b.material == "metal" else 1.22)
89
+ else:
90
+ col = _shade(base, 0.55)
91
+ d.line([a_, b_], fill=col, width=max(2, int(0.06 * r)))
92
+
93
+ else: # cylinder seen from above: dark rim + lighter top face
94
+ d.ellipse([cx - r, cy - r, cx + r, cy + r], fill=_shade(base, 0.62))
95
+ d.ellipse([cx - 0.78 * r, cy - 0.78 * r, cx + 0.78 * r, cy + 0.78 * r],
96
+ fill=base)
97
+ spd.ellipse([cx - 0.5 * r, cy - 0.55 * r, cx - 0.1 * r, cy - 0.2 * r],
98
+ fill=(255, 255, 255, 200 if b.material == "metal" else 70))
99
+
100
+ img = Image.alpha_composite(img.convert("RGBA"), spec).convert("RGB")
101
+
102
+ # downsample for anti-aliasing
103
+ img = img.resize((size, size), Image.LANCZOS)
104
+ return np.asarray(img, dtype=np.uint8)
clevrer_lite/simulate.py ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Scene sampling, deterministic rollout, and counterfactual re-simulation."""
2
+
3
+ import numpy as np
4
+
5
+ from . import config, physics, events as events_mod
6
+
7
+
8
+ # --------------------------------------------------------------------------
9
+ # scene specification (serializable dicts) <-> Body objects
10
+ # --------------------------------------------------------------------------
11
+
12
+ def sample_spec(rng, n_objects=None, probe=False):
13
+ """Sample a random CLEVRER-style scene spec (list of dicts)."""
14
+ n = int(n_objects if n_objects is not None else rng.integers(3, 7)) # 3..6
15
+ colors = rng.permutation(config.COLOR_NAMES)[:n] # unique colors
16
+ shapes = rng.choice(config.SHAPES, size=n)
17
+ materials = rng.choice(config.MATERIALS, size=n)
18
+ sizes = rng.choice(config.SIZES, size=n)
19
+
20
+ # non-overlapping positions (rejection sampling)
21
+ radii = np.array([rng.uniform(*config.SIZE_RADIUS[s]) for s in sizes])
22
+ positions = np.zeros((n, 2))
23
+ placed = 0
24
+ tries = 0
25
+ while placed < n:
26
+ tries += 1
27
+ if tries > 4000:
28
+ raise RuntimeError("could not place objects without overlap")
29
+ p = rng.uniform(-config.SPAWN_HALF, config.SPAWN_HALF, size=2)
30
+ ok = True
31
+ for k in range(placed):
32
+ if np.linalg.norm(p - positions[k]) < radii[k] + radii[placed] + 0.22:
33
+ ok = False
34
+ break
35
+ if ok:
36
+ positions[placed] = p
37
+ placed += 1
38
+
39
+ # at least 2 objects moving, at least one stationary (for causal questions)
40
+ n_moving = int(rng.integers(2, min(n, 4) + 1))
41
+ moving_idx = set(rng.permutation(n)[:n_moving].tolist())
42
+
43
+ spec = []
44
+ for i in range(n):
45
+ v = np.zeros(2)
46
+ if i in moving_idx:
47
+ theta = rng.uniform(0, 2 * np.pi)
48
+ speed = rng.uniform(*config.SPEED_RANGE)
49
+ v = np.array([np.cos(theta), np.sin(theta)]) * speed
50
+ spec.append({
51
+ "idx": i,
52
+ "color": str(colors[i]),
53
+ "shape": str(shapes[i]),
54
+ "material": str(materials[i]),
55
+ "size": str(sizes[i]),
56
+ "radius": float(radii[i]),
57
+ "position": positions[i].tolist(),
58
+ "velocity": v.tolist(),
59
+ "spin": float(rng.uniform(-1.5, 1.5)),
60
+ "is_probe": False,
61
+ })
62
+
63
+ if probe:
64
+ theta = rng.uniform(0, 2 * np.pi)
65
+ spec.append({
66
+ "idx": n, "color": config.PROBE_COLOR, "shape": "sphere",
67
+ "material": "metal", "size": config.PROBE_SIZE,
68
+ "radius": config.PROBE_RADIUS,
69
+ "position": rng.uniform(-config.SPAWN_HALF, config.SPAWN_HALF, size=2).tolist(),
70
+ "velocity": [0.0, 0.0],
71
+ "spin": 0.0, "is_probe": True,
72
+ })
73
+ return spec
74
+
75
+
76
+ def bodies_from_spec(spec):
77
+ from dataclasses import fields as dc_fields
78
+ bodies = []
79
+ for s in spec:
80
+ kwargs = {k: s[k] for k in ("idx", "color", "shape", "material", "size",
81
+ "radius", "spin", "is_probe")}
82
+ kwargs["pos"] = np.array(s["position"], dtype=float)
83
+ kwargs["vel"] = np.array(s["velocity"], dtype=float)
84
+ kwargs["mass"] = physics.mass_of(s["radius"], s["material"])
85
+ kwargs["angle"] = 0.0
86
+ bodies.append(physics.Body(**kwargs))
87
+ return bodies
88
+
89
+
90
+ def spec_of(bodies):
91
+ return [{
92
+ "idx": b.idx, "color": b.color, "shape": b.shape, "material": b.material,
93
+ "size": b.size, "radius": float(b.radius),
94
+ "position": b.pos.tolist(), "velocity": b.vel.tolist(),
95
+ "spin": float(b.spin), "is_probe": b.is_probe,
96
+ } for b in bodies]
97
+
98
+
99
+ # --------------------------------------------------------------------------
100
+ # rollout
101
+ # --------------------------------------------------------------------------
102
+
103
+ def rollout(bodies, num_frames, render_fn=None, action_fn=None):
104
+ """Run a deterministic rollout (physics never uses RNG).
105
+
106
+ Args:
107
+ bodies: list[Body] (mutated in place).
108
+ num_frames: number of rendered frames.
109
+ render_fn: optional callable(bodies) -> frame array.
110
+ action_fn: optional callable(t, bodies) applied at the start of frame t
111
+ (used by the gym env for probe-ball actions).
112
+
113
+ Returns:
114
+ dict with states (T, n, 4), collisions [(t, i, j)], wall_hits [(t, i, ax, s)],
115
+ and frames (T, H, W, 3) if render_fn was given.
116
+ """
117
+ world = physics.World(bodies)
118
+ n = len(bodies)
119
+ states = np.zeros((num_frames, n, 4), dtype=float)
120
+ collisions, wall_hits = [], []
121
+ frames = [] if render_fn is not None else None
122
+
123
+ for t in range(num_frames):
124
+ if action_fn is not None:
125
+ action_fn(t, bodies)
126
+ for _ in range(config.SUBSTEPS):
127
+ contacts, hits = world.step(config.SUB_DT)
128
+ for (i, j) in contacts:
129
+ collisions.append((t, i, j))
130
+ for (i, ax, s) in hits:
131
+ wall_hits.append((t, i, ax, s))
132
+ for k, b in enumerate(bodies):
133
+ states[t, k] = (b.pos[0], b.pos[1], b.vel[0], b.vel[1])
134
+ if render_fn is not None:
135
+ frames.append(render_fn(bodies))
136
+
137
+ return {"states": states, "collisions": collisions, "wall_hits": wall_hits,
138
+ "frames": frames}
139
+
140
+
141
+ # --------------------------------------------------------------------------
142
+ # counterfactual re-simulation (the CLEVRER trick: remove an object, re-run)
143
+ # --------------------------------------------------------------------------
144
+
145
+ def resimulate_without(spec, removed_idx, num_frames):
146
+ """Deep-copy the scene minus one object, re-run physics, extract events."""
147
+ import copy
148
+ spec2 = copy.deepcopy([s for s in spec if s["idx"] != removed_idx])
149
+ bodies = bodies_from_spec(spec2)
150
+ out = rollout(bodies, num_frames, render_fn=None)
151
+ ev = events_mod.extract_events(out["states"], out["collisions"],
152
+ out["wall_hits"], n=len(bodies))
153
+ return ev
demo_episode.gif ADDED

Git LFS Details

  • SHA256: b5e50b9e5da560a88e1946781a54f1a5a84dd5f99bd977f9d86832fffe7a4474
  • Pointer size: 131 Bytes
  • Size of remote file: 145 kB
output/annotations.json ADDED
@@ -0,0 +1,3237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "video_index": 0,
4
+ "video_filename": "videos/video_00000.gif",
5
+ "num_frames": 64,
6
+ "frame_size": 128,
7
+ "fps": 25,
8
+ "scene": {
9
+ "objects": [
10
+ {
11
+ "idx": 0,
12
+ "color": "blue",
13
+ "shape": "cube",
14
+ "material": "metal",
15
+ "size": "small",
16
+ "radius": 0.14201513451832787,
17
+ "position": [
18
+ -0.23966961428725875,
19
+ -1.462209019449065
20
+ ],
21
+ "velocity": [
22
+ -0.8609936860984196,
23
+ -0.5796115807438419
24
+ ],
25
+ "spin": -0.3251429984155163,
26
+ "is_probe": false
27
+ },
28
+ {
29
+ "idx": 1,
30
+ "color": "brown",
31
+ "shape": "cylinder",
32
+ "material": "metal",
33
+ "size": "large",
34
+ "radius": 0.31837243571439555,
35
+ "position": [
36
+ -1.164721842851352,
37
+ 0.5289356855502538
38
+ ],
39
+ "velocity": [
40
+ 0.0,
41
+ 0.0
42
+ ],
43
+ "spin": 1.170823056014377,
44
+ "is_probe": false
45
+ },
46
+ {
47
+ "idx": 2,
48
+ "color": "green",
49
+ "shape": "sphere",
50
+ "material": "metal",
51
+ "size": "large",
52
+ "radius": 0.27405244964820474,
53
+ "position": [
54
+ 0.4562874858801751,
55
+ 0.357693845591887
56
+ ],
57
+ "velocity": [
58
+ 0.18925657454551104,
59
+ 1.3095824406480492
60
+ ],
61
+ "spin": -1.2479539692528454,
62
+ "is_probe": false
63
+ },
64
+ {
65
+ "idx": 3,
66
+ "color": "cyan",
67
+ "shape": "cylinder",
68
+ "material": "metal",
69
+ "size": "small",
70
+ "radius": 0.1917907353409932,
71
+ "position": [
72
+ -0.3605995817881613,
73
+ 1.5413508009465542
74
+ ],
75
+ "velocity": [
76
+ 0.0,
77
+ 0.0
78
+ ],
79
+ "spin": 0.9979324429601935,
80
+ "is_probe": false
81
+ },
82
+ {
83
+ "idx": 4,
84
+ "color": "purple",
85
+ "shape": "sphere",
86
+ "material": "metal",
87
+ "size": "small",
88
+ "radius": 0.1724876732149455,
89
+ "position": [
90
+ 1.4905895502063131,
91
+ 0.5751801518901536
92
+ ],
93
+ "velocity": [
94
+ 0.0,
95
+ 0.0
96
+ ],
97
+ "spin": 0.8612949224660502,
98
+ "is_probe": false
99
+ },
100
+ {
101
+ "idx": 5,
102
+ "color": "gray",
103
+ "shape": "sphere",
104
+ "material": "metal",
105
+ "size": "large",
106
+ "radius": 0.28397695124299077,
107
+ "position": [
108
+ 1.2074122864819008,
109
+ 1.345534899464374
110
+ ],
111
+ "velocity": [
112
+ 0.10522102901322228,
113
+ 1.5729688697009279
114
+ ],
115
+ "spin": -1.324295895584417,
116
+ "is_probe": false
117
+ }
118
+ ]
119
+ },
120
+ "events": {
121
+ "collision_events": [
122
+ {
123
+ "frame": 19,
124
+ "objects": [
125
+ 4,
126
+ 5
127
+ ],
128
+ "description": "the purple sphere collided with the gray sphere"
129
+ },
130
+ {
131
+ "frame": 61,
132
+ "objects": [
133
+ 2,
134
+ 5
135
+ ],
136
+ "description": "the green sphere collided with the gray sphere"
137
+ }
138
+ ],
139
+ "motion_events": [
140
+ {
141
+ "object": 4,
142
+ "type": "start",
143
+ "frame": 19,
144
+ "cause_collision": {
145
+ "frame": 19,
146
+ "objects": [
147
+ 4,
148
+ 5
149
+ ]
150
+ }
151
+ }
152
+ ],
153
+ "initially_moving": [
154
+ 0,
155
+ 2,
156
+ 5
157
+ ]
158
+ },
159
+ "raw_events": {
160
+ "collisions": [
161
+ {
162
+ "frame": 19,
163
+ "objects": [
164
+ 4,
165
+ 5
166
+ ]
167
+ },
168
+ {
169
+ "frame": 61,
170
+ "objects": [
171
+ 2,
172
+ 5
173
+ ]
174
+ }
175
+ ],
176
+ "starts": {
177
+ "0": [],
178
+ "1": [],
179
+ "2": [],
180
+ "3": [],
181
+ "4": [
182
+ 19
183
+ ],
184
+ "5": []
185
+ },
186
+ "stops": {
187
+ "0": [],
188
+ "1": [],
189
+ "2": [],
190
+ "3": [],
191
+ "4": [],
192
+ "5": []
193
+ },
194
+ "initially_moving": [
195
+ 0,
196
+ 2,
197
+ 5
198
+ ],
199
+ "wall_hits": [
200
+ [
201
+ 5,
202
+ 5,
203
+ 1,
204
+ 1
205
+ ],
206
+ [
207
+ 17,
208
+ 0,
209
+ 1,
210
+ -1
211
+ ],
212
+ [
213
+ 27,
214
+ 2,
215
+ 1,
216
+ 1
217
+ ],
218
+ [
219
+ 30,
220
+ 4,
221
+ 0,
222
+ 1
223
+ ],
224
+ [
225
+ 52,
226
+ 0,
227
+ 0,
228
+ -1
229
+ ],
230
+ [
231
+ 62,
232
+ 4,
233
+ 1,
234
+ -1
235
+ ]
236
+ ]
237
+ },
238
+ "questions": [
239
+ {
240
+ "question": "Will the green sphere collide with the gray sphere by the end of the video?",
241
+ "answer": "yes",
242
+ "choices": [
243
+ "yes",
244
+ "no"
245
+ ],
246
+ "answer_index": 0,
247
+ "question_type": "predictive",
248
+ "template": "will_collide",
249
+ "program": [
250
+ {
251
+ "op": "find_collision",
252
+ "objects": [
253
+ 2,
254
+ 5
255
+ ]
256
+ },
257
+ {
258
+ "op": "query_existence"
259
+ }
260
+ ]
261
+ },
262
+ {
263
+ "question": "If the cyan cylinder were removed, would the purple sphere still collide with the gray sphere?",
264
+ "answer": "yes",
265
+ "choices": [
266
+ "no",
267
+ "yes"
268
+ ],
269
+ "answer_index": 1,
270
+ "question_type": "counterfactual",
271
+ "template": "cf_collision",
272
+ "program": [
273
+ {
274
+ "op": "remove_object",
275
+ "idx": 3
276
+ },
277
+ {
278
+ "op": "find_collision",
279
+ "objects": [
280
+ 4,
281
+ 5
282
+ ]
283
+ },
284
+ {
285
+ "op": "query_existence"
286
+ }
287
+ ]
288
+ },
289
+ {
290
+ "question": "What happened right before the green sphere collided with the gray sphere?",
291
+ "answer": "the purple sphere collided with the gray sphere",
292
+ "choices": [
293
+ "the purple sphere collided with the wall",
294
+ "the purple sphere started moving",
295
+ "the purple sphere collided with the gray sphere",
296
+ "nothing happened"
297
+ ],
298
+ "answer_index": 2,
299
+ "question_type": "explanatory",
300
+ "template": "what_happened_before",
301
+ "program": [
302
+ {
303
+ "op": "find_collision",
304
+ "objects": [
305
+ 2,
306
+ 5
307
+ ]
308
+ },
309
+ {
310
+ "op": "query_before_event"
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "question": "What shape is the green object?",
316
+ "answer": "sphere",
317
+ "choices": [
318
+ "cube",
319
+ "sphere",
320
+ "cylinder"
321
+ ],
322
+ "answer_index": 1,
323
+ "question_type": "descriptive",
324
+ "template": "query_shape",
325
+ "program": [
326
+ {
327
+ "op": "filter_color",
328
+ "value": "green"
329
+ },
330
+ {
331
+ "op": "query_shape"
332
+ }
333
+ ]
334
+ },
335
+ {
336
+ "question": "What shape is the blue object?",
337
+ "answer": "cube",
338
+ "choices": [
339
+ "cylinder",
340
+ "sphere",
341
+ "cube"
342
+ ],
343
+ "answer_index": 2,
344
+ "question_type": "descriptive",
345
+ "template": "query_shape",
346
+ "program": [
347
+ {
348
+ "op": "filter_color",
349
+ "value": "blue"
350
+ },
351
+ {
352
+ "op": "query_shape"
353
+ }
354
+ ]
355
+ },
356
+ {
357
+ "question": "What color is the object left of the blue cube?",
358
+ "answer": "brown",
359
+ "choices": [
360
+ "cyan",
361
+ "green",
362
+ "gray",
363
+ "red",
364
+ "brown",
365
+ "blue",
366
+ "yellow",
367
+ "purple"
368
+ ],
369
+ "answer_index": 4,
370
+ "question_type": "descriptive",
371
+ "template": "query_color_rel",
372
+ "program": [
373
+ {
374
+ "op": "filter_color",
375
+ "value": "blue"
376
+ },
377
+ {
378
+ "op": "relate",
379
+ "direction": "left_of"
380
+ },
381
+ {
382
+ "op": "query_color"
383
+ }
384
+ ]
385
+ },
386
+ {
387
+ "question": "If the cyan cylinder were removed, would the purple sphere still start moving?",
388
+ "answer": "yes",
389
+ "choices": [
390
+ "no",
391
+ "yes"
392
+ ],
393
+ "answer_index": 1,
394
+ "question_type": "counterfactual",
395
+ "template": "cf_motion",
396
+ "program": [
397
+ {
398
+ "op": "remove_object",
399
+ "idx": 3
400
+ },
401
+ {
402
+ "op": "filter_object",
403
+ "idx": 4
404
+ },
405
+ {
406
+ "op": "query_motion_start"
407
+ }
408
+ ]
409
+ },
410
+ {
411
+ "question": "How many objects were moving when the purple sphere collided with the gray sphere?",
412
+ "answer": "4",
413
+ "choices": [
414
+ "0",
415
+ "1",
416
+ "2",
417
+ "3",
418
+ "4",
419
+ "5"
420
+ ],
421
+ "answer_index": 4,
422
+ "question_type": "explanatory",
423
+ "template": "count_moving_at",
424
+ "program": [
425
+ {
426
+ "op": "find_collision",
427
+ "objects": [
428
+ 4,
429
+ 5
430
+ ]
431
+ },
432
+ {
433
+ "op": "count_moving_at_collision"
434
+ }
435
+ ]
436
+ }
437
+ ]
438
+ },
439
+ {
440
+ "video_index": 1,
441
+ "video_filename": "videos/video_00001.gif",
442
+ "num_frames": 64,
443
+ "frame_size": 128,
444
+ "fps": 25,
445
+ "scene": {
446
+ "objects": [
447
+ {
448
+ "idx": 0,
449
+ "color": "purple",
450
+ "shape": "cylinder",
451
+ "material": "rubber",
452
+ "size": "small",
453
+ "radius": 0.17228859879315672,
454
+ "position": [
455
+ -0.14415654260998023,
456
+ -1.1344707385337893
457
+ ],
458
+ "velocity": [
459
+ 0.0,
460
+ 0.0
461
+ ],
462
+ "spin": -0.6693263878638875,
463
+ "is_probe": false
464
+ },
465
+ {
466
+ "idx": 1,
467
+ "color": "gray",
468
+ "shape": "sphere",
469
+ "material": "rubber",
470
+ "size": "small",
471
+ "radius": 0.15978390298994555,
472
+ "position": [
473
+ -0.7368286446302665,
474
+ 0.776130485153163
475
+ ],
476
+ "velocity": [
477
+ 0.8890070987191017,
478
+ 1.4136185002086372
479
+ ],
480
+ "spin": 0.04820575664363602,
481
+ "is_probe": false
482
+ },
483
+ {
484
+ "idx": 2,
485
+ "color": "red",
486
+ "shape": "cube",
487
+ "material": "metal",
488
+ "size": "large",
489
+ "radius": 0.32307429627427237,
490
+ "position": [
491
+ -0.6807328502432762,
492
+ -0.04590797926193124
493
+ ],
494
+ "velocity": [
495
+ 0.0,
496
+ 0.0
497
+ ],
498
+ "spin": -1.1524031625876892,
499
+ "is_probe": false
500
+ },
501
+ {
502
+ "idx": 3,
503
+ "color": "brown",
504
+ "shape": "cylinder",
505
+ "material": "metal",
506
+ "size": "large",
507
+ "radius": 0.2842555863433316,
508
+ "position": [
509
+ 1.4902853193838397,
510
+ 1.431137300357739
511
+ ],
512
+ "velocity": [
513
+ -1.0540337912642956,
514
+ -1.03421747570648
515
+ ],
516
+ "spin": 0.3390099031591214,
517
+ "is_probe": false
518
+ }
519
+ ]
520
+ },
521
+ "events": {
522
+ "collision_events": [
523
+ {
524
+ "frame": 40,
525
+ "objects": [
526
+ 2,
527
+ 3
528
+ ],
529
+ "description": "the red cube collided with the brown cylinder"
530
+ },
531
+ {
532
+ "frame": 55,
533
+ "objects": [
534
+ 0,
535
+ 3
536
+ ],
537
+ "description": "the purple cylinder collided with the brown cylinder"
538
+ }
539
+ ],
540
+ "motion_events": [
541
+ {
542
+ "object": 0,
543
+ "type": "start",
544
+ "frame": 55,
545
+ "cause_collision": {
546
+ "frame": 55,
547
+ "objects": [
548
+ 0,
549
+ 3
550
+ ]
551
+ }
552
+ },
553
+ {
554
+ "object": 2,
555
+ "type": "start",
556
+ "frame": 40,
557
+ "cause_collision": {
558
+ "frame": 40,
559
+ "objects": [
560
+ 2,
561
+ 3
562
+ ]
563
+ }
564
+ }
565
+ ],
566
+ "initially_moving": [
567
+ 1,
568
+ 3
569
+ ]
570
+ },
571
+ "raw_events": {
572
+ "collisions": [
573
+ {
574
+ "frame": 40,
575
+ "objects": [
576
+ 2,
577
+ 3
578
+ ]
579
+ },
580
+ {
581
+ "frame": 55,
582
+ "objects": [
583
+ 0,
584
+ 3
585
+ ]
586
+ }
587
+ ],
588
+ "starts": {
589
+ "0": [
590
+ 55
591
+ ],
592
+ "1": [],
593
+ "2": [
594
+ 40
595
+ ],
596
+ "3": []
597
+ },
598
+ "stops": {
599
+ "0": [],
600
+ "1": [],
601
+ "2": [],
602
+ "3": []
603
+ },
604
+ "initially_moving": [
605
+ 1,
606
+ 3
607
+ ],
608
+ "wall_hits": [
609
+ [
610
+ 19,
611
+ 1,
612
+ 1,
613
+ 1
614
+ ]
615
+ ]
616
+ },
617
+ "questions": [
618
+ {
619
+ "question": "After the red cube collided with the brown cylinder, will the red cube collide with something else?",
620
+ "answer": "no",
621
+ "choices": [
622
+ "no",
623
+ "yes"
624
+ ],
625
+ "answer_index": 0,
626
+ "question_type": "predictive",
627
+ "template": "will_collide_again",
628
+ "program": [
629
+ {
630
+ "op": "find_collision",
631
+ "objects": [
632
+ 2,
633
+ 3
634
+ ]
635
+ },
636
+ {
637
+ "op": "query_subsequent_collision"
638
+ }
639
+ ]
640
+ },
641
+ {
642
+ "question": "What caused the purple cylinder to start moving?",
643
+ "answer": "the collision with the brown cylinder",
644
+ "choices": [
645
+ "it was pushed by the wall",
646
+ "nothing - it was already moving",
647
+ "the collision with the red cube",
648
+ "the collision with the brown cylinder"
649
+ ],
650
+ "answer_index": 3,
651
+ "question_type": "explanatory",
652
+ "template": "cause_of_motion",
653
+ "program": [
654
+ {
655
+ "op": "filter_object",
656
+ "idx": 0
657
+ },
658
+ {
659
+ "op": "query_motion_cause"
660
+ }
661
+ ]
662
+ },
663
+ {
664
+ "question": "If the brown cylinder were removed, would the purple cylinder still start moving?",
665
+ "answer": "no",
666
+ "choices": [
667
+ "yes",
668
+ "no"
669
+ ],
670
+ "answer_index": 1,
671
+ "question_type": "counterfactual",
672
+ "template": "cf_motion",
673
+ "program": [
674
+ {
675
+ "op": "remove_object",
676
+ "idx": 3
677
+ },
678
+ {
679
+ "op": "filter_object",
680
+ "idx": 0
681
+ },
682
+ {
683
+ "op": "query_motion_start"
684
+ }
685
+ ]
686
+ },
687
+ {
688
+ "question": "If the gray sphere were removed, would the purple cylinder still collide with the brown cylinder?",
689
+ "answer": "yes",
690
+ "choices": [
691
+ "no",
692
+ "yes"
693
+ ],
694
+ "answer_index": 1,
695
+ "question_type": "counterfactual",
696
+ "template": "cf_collision",
697
+ "program": [
698
+ {
699
+ "op": "remove_object",
700
+ "idx": 1
701
+ },
702
+ {
703
+ "op": "find_collision",
704
+ "objects": [
705
+ 0,
706
+ 3
707
+ ]
708
+ },
709
+ {
710
+ "op": "query_existence"
711
+ }
712
+ ]
713
+ },
714
+ {
715
+ "question": "How many objects are there?",
716
+ "answer": "4",
717
+ "choices": [
718
+ "0",
719
+ "1",
720
+ "2",
721
+ "3",
722
+ "4",
723
+ "5"
724
+ ],
725
+ "answer_index": 4,
726
+ "question_type": "descriptive",
727
+ "template": "count_all",
728
+ "program": [
729
+ {
730
+ "op": "count"
731
+ }
732
+ ]
733
+ },
734
+ {
735
+ "question": "How many sphere objects are there?",
736
+ "answer": "1",
737
+ "choices": [
738
+ "0",
739
+ "1",
740
+ "3",
741
+ "4",
742
+ "5",
743
+ "6"
744
+ ],
745
+ "answer_index": 1,
746
+ "question_type": "descriptive",
747
+ "template": "count_shape",
748
+ "program": [
749
+ {
750
+ "op": "filter_shape",
751
+ "value": "sphere"
752
+ },
753
+ {
754
+ "op": "count"
755
+ }
756
+ ]
757
+ },
758
+ {
759
+ "question": "How many collisions happened in the video?",
760
+ "answer": "2",
761
+ "choices": [
762
+ "0",
763
+ "1",
764
+ "2",
765
+ "3",
766
+ "5",
767
+ "6"
768
+ ],
769
+ "answer_index": 2,
770
+ "question_type": "explanatory",
771
+ "template": "count_collisions",
772
+ "program": [
773
+ {
774
+ "op": "filter_event",
775
+ "type": "collision"
776
+ },
777
+ {
778
+ "op": "count"
779
+ }
780
+ ]
781
+ },
782
+ {
783
+ "question": "What shape is the gray object?",
784
+ "answer": "sphere",
785
+ "choices": [
786
+ "cube",
787
+ "cylinder",
788
+ "sphere"
789
+ ],
790
+ "answer_index": 2,
791
+ "question_type": "descriptive",
792
+ "template": "query_shape",
793
+ "program": [
794
+ {
795
+ "op": "filter_color",
796
+ "value": "gray"
797
+ },
798
+ {
799
+ "op": "query_shape"
800
+ }
801
+ ]
802
+ }
803
+ ]
804
+ },
805
+ {
806
+ "video_index": 2,
807
+ "video_filename": "videos/video_00002.gif",
808
+ "num_frames": 64,
809
+ "frame_size": 128,
810
+ "fps": 25,
811
+ "scene": {
812
+ "objects": [
813
+ {
814
+ "idx": 0,
815
+ "color": "blue",
816
+ "shape": "cylinder",
817
+ "material": "rubber",
818
+ "size": "large",
819
+ "radius": 0.33739487619949415,
820
+ "position": [
821
+ 1.2127491694517956,
822
+ 0.8542482216653375
823
+ ],
824
+ "velocity": [
825
+ -0.36715859956078306,
826
+ -0.9719919196853971
827
+ ],
828
+ "spin": 0.0684855117712917,
829
+ "is_probe": false
830
+ },
831
+ {
832
+ "idx": 1,
833
+ "color": "yellow",
834
+ "shape": "cube",
835
+ "material": "metal",
836
+ "size": "large",
837
+ "radius": 0.31464518578477,
838
+ "position": [
839
+ -0.5637455380923395,
840
+ 1.315072379171155
841
+ ],
842
+ "velocity": [
843
+ 0.16865636414440546,
844
+ 0.7827396049255161
845
+ ],
846
+ "spin": -1.3841876102370936,
847
+ "is_probe": false
848
+ },
849
+ {
850
+ "idx": 2,
851
+ "color": "cyan",
852
+ "shape": "sphere",
853
+ "material": "rubber",
854
+ "size": "large",
855
+ "radius": 0.2913299866464021,
856
+ "position": [
857
+ -0.09017935521115161,
858
+ 0.6006524108269133
859
+ ],
860
+ "velocity": [
861
+ -0.3438585017186605,
862
+ -1.104125496358226
863
+ ],
864
+ "spin": 1.1932024412795266,
865
+ "is_probe": false
866
+ },
867
+ {
868
+ "idx": 3,
869
+ "color": "purple",
870
+ "shape": "cube",
871
+ "material": "rubber",
872
+ "size": "small",
873
+ "radius": 0.1512351541832059,
874
+ "position": [
875
+ -1.2176573437938771,
876
+ -1.2259149688578814
877
+ ],
878
+ "velocity": [
879
+ 0.0,
880
+ 0.0
881
+ ],
882
+ "spin": 1.005549614076839,
883
+ "is_probe": false
884
+ },
885
+ {
886
+ "idx": 4,
887
+ "color": "red",
888
+ "shape": "cube",
889
+ "material": "metal",
890
+ "size": "small",
891
+ "radius": 0.160757639934304,
892
+ "position": [
893
+ 0.44775243453710445,
894
+ -0.2897185672058369
895
+ ],
896
+ "velocity": [
897
+ 0.0,
898
+ 0.0
899
+ ],
900
+ "spin": -0.3447145965575502,
901
+ "is_probe": false
902
+ },
903
+ {
904
+ "idx": 5,
905
+ "color": "green",
906
+ "shape": "sphere",
907
+ "material": "rubber",
908
+ "size": "large",
909
+ "radius": 0.3008852778855662,
910
+ "position": [
911
+ 1.1225657532136475,
912
+ -0.19162288490671253
913
+ ],
914
+ "velocity": [
915
+ 0.0,
916
+ 0.0
917
+ ],
918
+ "spin": 1.421036309115669,
919
+ "is_probe": false
920
+ }
921
+ ]
922
+ },
923
+ "events": {
924
+ "collision_events": [
925
+ {
926
+ "frame": 10,
927
+ "objects": [
928
+ 0,
929
+ 5
930
+ ],
931
+ "description": "the blue cylinder collided with the green sphere"
932
+ },
933
+ {
934
+ "frame": 48,
935
+ "objects": [
936
+ 0,
937
+ 4
938
+ ],
939
+ "description": "the blue cylinder collided with the red cube"
940
+ },
941
+ {
942
+ "frame": 57,
943
+ "objects": [
944
+ 0,
945
+ 1
946
+ ],
947
+ "description": "the blue cylinder collided with the yellow cube"
948
+ },
949
+ {
950
+ "frame": 61,
951
+ "objects": [
952
+ 0,
953
+ 4
954
+ ],
955
+ "description": "the blue cylinder collided with the red cube"
956
+ }
957
+ ],
958
+ "motion_events": [
959
+ {
960
+ "object": 4,
961
+ "type": "start",
962
+ "frame": 48,
963
+ "cause_collision": {
964
+ "frame": 48,
965
+ "objects": [
966
+ 0,
967
+ 4
968
+ ]
969
+ }
970
+ },
971
+ {
972
+ "object": 5,
973
+ "type": "start",
974
+ "frame": 10,
975
+ "cause_collision": {
976
+ "frame": 10,
977
+ "objects": [
978
+ 0,
979
+ 5
980
+ ]
981
+ }
982
+ }
983
+ ],
984
+ "initially_moving": [
985
+ 0,
986
+ 1,
987
+ 2
988
+ ]
989
+ },
990
+ "raw_events": {
991
+ "collisions": [
992
+ {
993
+ "frame": 10,
994
+ "objects": [
995
+ 0,
996
+ 5
997
+ ]
998
+ },
999
+ {
1000
+ "frame": 48,
1001
+ "objects": [
1002
+ 0,
1003
+ 4
1004
+ ]
1005
+ },
1006
+ {
1007
+ "frame": 57,
1008
+ "objects": [
1009
+ 0,
1010
+ 1
1011
+ ]
1012
+ },
1013
+ {
1014
+ "frame": 61,
1015
+ "objects": [
1016
+ 0,
1017
+ 4
1018
+ ]
1019
+ }
1020
+ ],
1021
+ "starts": {
1022
+ "0": [],
1023
+ "1": [],
1024
+ "2": [],
1025
+ "3": [],
1026
+ "4": [
1027
+ 48
1028
+ ],
1029
+ "5": [
1030
+ 10
1031
+ ]
1032
+ },
1033
+ "stops": {
1034
+ "0": [],
1035
+ "1": [],
1036
+ "2": [],
1037
+ "3": [],
1038
+ "4": [],
1039
+ "5": []
1040
+ },
1041
+ "initially_moving": [
1042
+ 0,
1043
+ 1,
1044
+ 2
1045
+ ],
1046
+ "wall_hits": [
1047
+ [
1048
+ 12,
1049
+ 1,
1050
+ 1,
1051
+ 1
1052
+ ],
1053
+ [
1054
+ 53,
1055
+ 5,
1056
+ 1,
1057
+ -1
1058
+ ],
1059
+ [
1060
+ 58,
1061
+ 2,
1062
+ 1,
1063
+ -1
1064
+ ]
1065
+ ]
1066
+ },
1067
+ "questions": [
1068
+ {
1069
+ "question": "What happened right after the blue cylinder collided with the red cube?",
1070
+ "answer": "nothing happened",
1071
+ "choices": [
1072
+ "the yellow cube collided with the wall",
1073
+ "nothing happened",
1074
+ "the cyan sphere collided with the wall",
1075
+ "the blue cylinder collided with the green sphere"
1076
+ ],
1077
+ "answer_index": 1,
1078
+ "question_type": "explanatory",
1079
+ "template": "what_happened_after",
1080
+ "program": [
1081
+ {
1082
+ "op": "find_collision",
1083
+ "objects": [
1084
+ 0,
1085
+ 4
1086
+ ]
1087
+ },
1088
+ {
1089
+ "op": "query_after_event"
1090
+ }
1091
+ ]
1092
+ },
1093
+ {
1094
+ "question": "If the green sphere were removed, would the blue cylinder still collide with the red cube?",
1095
+ "answer": "yes",
1096
+ "choices": [
1097
+ "yes",
1098
+ "no"
1099
+ ],
1100
+ "answer_index": 0,
1101
+ "question_type": "counterfactual",
1102
+ "template": "cf_collision",
1103
+ "program": [
1104
+ {
1105
+ "op": "remove_object",
1106
+ "idx": 5
1107
+ },
1108
+ {
1109
+ "op": "find_collision",
1110
+ "objects": [
1111
+ 0,
1112
+ 4
1113
+ ]
1114
+ },
1115
+ {
1116
+ "op": "query_existence"
1117
+ }
1118
+ ]
1119
+ },
1120
+ {
1121
+ "question": "If the red cube were removed, would the blue cylinder still collide with the yellow cube?",
1122
+ "answer": "yes",
1123
+ "choices": [
1124
+ "yes",
1125
+ "no"
1126
+ ],
1127
+ "answer_index": 0,
1128
+ "question_type": "counterfactual",
1129
+ "template": "cf_collision",
1130
+ "program": [
1131
+ {
1132
+ "op": "remove_object",
1133
+ "idx": 4
1134
+ },
1135
+ {
1136
+ "op": "find_collision",
1137
+ "objects": [
1138
+ 0,
1139
+ 1
1140
+ ]
1141
+ },
1142
+ {
1143
+ "op": "query_existence"
1144
+ }
1145
+ ]
1146
+ },
1147
+ {
1148
+ "question": "What material is the yellow cube made of?",
1149
+ "answer": "metal",
1150
+ "choices": [
1151
+ "rubber",
1152
+ "metal"
1153
+ ],
1154
+ "answer_index": 1,
1155
+ "question_type": "descriptive",
1156
+ "template": "query_material",
1157
+ "program": [
1158
+ {
1159
+ "op": "filter_color",
1160
+ "value": "yellow"
1161
+ },
1162
+ {
1163
+ "op": "filter_shape",
1164
+ "value": "cube"
1165
+ },
1166
+ {
1167
+ "op": "query_material"
1168
+ }
1169
+ ]
1170
+ },
1171
+ {
1172
+ "question": "How many purple objects are there?",
1173
+ "answer": "1",
1174
+ "choices": [
1175
+ "0",
1176
+ "1",
1177
+ "2",
1178
+ "3",
1179
+ "4",
1180
+ "6"
1181
+ ],
1182
+ "answer_index": 1,
1183
+ "question_type": "descriptive",
1184
+ "template": "count_color",
1185
+ "program": [
1186
+ {
1187
+ "op": "filter_color",
1188
+ "value": "purple"
1189
+ },
1190
+ {
1191
+ "op": "count"
1192
+ }
1193
+ ]
1194
+ },
1195
+ {
1196
+ "question": "After the blue cylinder collided with the red cube, will the blue cylinder collide with something else?",
1197
+ "answer": "yes",
1198
+ "choices": [
1199
+ "yes",
1200
+ "no"
1201
+ ],
1202
+ "answer_index": 0,
1203
+ "question_type": "predictive",
1204
+ "template": "will_collide_again",
1205
+ "program": [
1206
+ {
1207
+ "op": "find_collision",
1208
+ "objects": [
1209
+ 0,
1210
+ 4
1211
+ ]
1212
+ },
1213
+ {
1214
+ "op": "query_subsequent_collision"
1215
+ }
1216
+ ]
1217
+ },
1218
+ {
1219
+ "question": "How many objects were moving when the blue cylinder collided with the red cube?",
1220
+ "answer": "5",
1221
+ "choices": [
1222
+ "0",
1223
+ "1",
1224
+ "3",
1225
+ "4",
1226
+ "5",
1227
+ "6"
1228
+ ],
1229
+ "answer_index": 4,
1230
+ "question_type": "explanatory",
1231
+ "template": "count_moving_at",
1232
+ "program": [
1233
+ {
1234
+ "op": "find_collision",
1235
+ "objects": [
1236
+ 0,
1237
+ 4
1238
+ ]
1239
+ },
1240
+ {
1241
+ "op": "count_moving_at_collision"
1242
+ }
1243
+ ]
1244
+ },
1245
+ {
1246
+ "question": "What shape is the purple object?",
1247
+ "answer": "cube",
1248
+ "choices": [
1249
+ "cylinder",
1250
+ "sphere",
1251
+ "cube"
1252
+ ],
1253
+ "answer_index": 2,
1254
+ "question_type": "descriptive",
1255
+ "template": "query_shape",
1256
+ "program": [
1257
+ {
1258
+ "op": "filter_color",
1259
+ "value": "purple"
1260
+ },
1261
+ {
1262
+ "op": "query_shape"
1263
+ }
1264
+ ]
1265
+ }
1266
+ ]
1267
+ },
1268
+ {
1269
+ "video_index": 3,
1270
+ "video_filename": "videos/video_00003.gif",
1271
+ "num_frames": 64,
1272
+ "frame_size": 128,
1273
+ "fps": 25,
1274
+ "scene": {
1275
+ "objects": [
1276
+ {
1277
+ "idx": 0,
1278
+ "color": "yellow",
1279
+ "shape": "cube",
1280
+ "material": "metal",
1281
+ "size": "large",
1282
+ "radius": 0.3190270229833728,
1283
+ "position": [
1284
+ -1.545380741122608,
1285
+ 1.4677268517758797
1286
+ ],
1287
+ "velocity": [
1288
+ 0.653208134845669,
1289
+ -1.1901842959224622
1290
+ ],
1291
+ "spin": 0.5483967235810505,
1292
+ "is_probe": false
1293
+ },
1294
+ {
1295
+ "idx": 1,
1296
+ "color": "gray",
1297
+ "shape": "sphere",
1298
+ "material": "metal",
1299
+ "size": "large",
1300
+ "radius": 0.3365013803868879,
1301
+ "position": [
1302
+ -0.6249562086476854,
1303
+ -0.576643393693556
1304
+ ],
1305
+ "velocity": [
1306
+ 0.0,
1307
+ 0.0
1308
+ ],
1309
+ "spin": 0.960227250511605,
1310
+ "is_probe": false
1311
+ },
1312
+ {
1313
+ "idx": 2,
1314
+ "color": "blue",
1315
+ "shape": "sphere",
1316
+ "material": "rubber",
1317
+ "size": "small",
1318
+ "radius": 0.1570520698249275,
1319
+ "position": [
1320
+ 1.2143043183799873,
1321
+ 0.2640051136618149
1322
+ ],
1323
+ "velocity": [
1324
+ 0.0,
1325
+ 0.0
1326
+ ],
1327
+ "spin": -0.21428128710461403,
1328
+ "is_probe": false
1329
+ },
1330
+ {
1331
+ "idx": 3,
1332
+ "color": "red",
1333
+ "shape": "sphere",
1334
+ "material": "rubber",
1335
+ "size": "small",
1336
+ "radius": 0.1789128324247895,
1337
+ "position": [
1338
+ -0.08894003793632277,
1339
+ 0.847158729911331
1340
+ ],
1341
+ "velocity": [
1342
+ 0.0,
1343
+ 0.0
1344
+ ],
1345
+ "spin": 0.7761163834647569,
1346
+ "is_probe": false
1347
+ },
1348
+ {
1349
+ "idx": 4,
1350
+ "color": "brown",
1351
+ "shape": "cube",
1352
+ "material": "rubber",
1353
+ "size": "large",
1354
+ "radius": 0.31569727973361245,
1355
+ "position": [
1356
+ 0.49755020902647407,
1357
+ 1.3375379496981992
1358
+ ],
1359
+ "velocity": [
1360
+ 0.0,
1361
+ 0.0
1362
+ ],
1363
+ "spin": 1.1354405539987615,
1364
+ "is_probe": false
1365
+ },
1366
+ {
1367
+ "idx": 5,
1368
+ "color": "cyan",
1369
+ "shape": "cube",
1370
+ "material": "rubber",
1371
+ "size": "large",
1372
+ "radius": 0.283417659920999,
1373
+ "position": [
1374
+ -0.9077073789488962,
1375
+ 0.40327961933456313
1376
+ ],
1377
+ "velocity": [
1378
+ 1.2403780112124232,
1379
+ 0.9291094064281774
1380
+ ],
1381
+ "spin": -0.31821800210299456,
1382
+ "is_probe": false
1383
+ }
1384
+ ]
1385
+ },
1386
+ "events": {
1387
+ "collision_events": [
1388
+ {
1389
+ "frame": 7,
1390
+ "objects": [
1391
+ 3,
1392
+ 5
1393
+ ],
1394
+ "description": "the red sphere collided with the cyan cube"
1395
+ },
1396
+ {
1397
+ "frame": 11,
1398
+ "objects": [
1399
+ 3,
1400
+ 4
1401
+ ],
1402
+ "description": "the red sphere collided with the brown cube"
1403
+ },
1404
+ {
1405
+ "frame": 31,
1406
+ "objects": [
1407
+ 0,
1408
+ 1
1409
+ ],
1410
+ "description": "the yellow cube collided with the gray sphere"
1411
+ }
1412
+ ],
1413
+ "motion_events": [
1414
+ {
1415
+ "object": 1,
1416
+ "type": "start",
1417
+ "frame": 31,
1418
+ "cause_collision": {
1419
+ "frame": 31,
1420
+ "objects": [
1421
+ 0,
1422
+ 1
1423
+ ]
1424
+ }
1425
+ },
1426
+ {
1427
+ "object": 3,
1428
+ "type": "start",
1429
+ "frame": 7,
1430
+ "cause_collision": {
1431
+ "frame": 7,
1432
+ "objects": [
1433
+ 3,
1434
+ 5
1435
+ ]
1436
+ }
1437
+ },
1438
+ {
1439
+ "object": 4,
1440
+ "type": "start",
1441
+ "frame": 11,
1442
+ "cause_collision": {
1443
+ "frame": 11,
1444
+ "objects": [
1445
+ 3,
1446
+ 4
1447
+ ]
1448
+ }
1449
+ }
1450
+ ],
1451
+ "initially_moving": [
1452
+ 0,
1453
+ 5
1454
+ ]
1455
+ },
1456
+ "raw_events": {
1457
+ "collisions": [
1458
+ {
1459
+ "frame": 7,
1460
+ "objects": [
1461
+ 3,
1462
+ 5
1463
+ ]
1464
+ },
1465
+ {
1466
+ "frame": 11,
1467
+ "objects": [
1468
+ 3,
1469
+ 4
1470
+ ]
1471
+ },
1472
+ {
1473
+ "frame": 31,
1474
+ "objects": [
1475
+ 0,
1476
+ 1
1477
+ ]
1478
+ }
1479
+ ],
1480
+ "starts": {
1481
+ "0": [],
1482
+ "1": [
1483
+ 31
1484
+ ],
1485
+ "2": [],
1486
+ "3": [
1487
+ 7
1488
+ ],
1489
+ "4": [
1490
+ 11
1491
+ ],
1492
+ "5": []
1493
+ },
1494
+ "stops": {
1495
+ "0": [],
1496
+ "1": [],
1497
+ "2": [],
1498
+ "3": [],
1499
+ "4": [],
1500
+ "5": []
1501
+ },
1502
+ "initially_moving": [
1503
+ 0,
1504
+ 5
1505
+ ],
1506
+ "wall_hits": [
1507
+ [
1508
+ 26,
1509
+ 4,
1510
+ 1,
1511
+ 1
1512
+ ],
1513
+ [
1514
+ 51,
1515
+ 5,
1516
+ 1,
1517
+ 1
1518
+ ],
1519
+ [
1520
+ 59,
1521
+ 1,
1522
+ 1,
1523
+ -1
1524
+ ]
1525
+ ]
1526
+ },
1527
+ "questions": [
1528
+ {
1529
+ "question": "If the cyan cube were removed, would the red sphere still start moving?",
1530
+ "answer": "no",
1531
+ "choices": [
1532
+ "yes",
1533
+ "no"
1534
+ ],
1535
+ "answer_index": 1,
1536
+ "question_type": "counterfactual",
1537
+ "template": "cf_motion",
1538
+ "program": [
1539
+ {
1540
+ "op": "remove_object",
1541
+ "idx": 5
1542
+ },
1543
+ {
1544
+ "op": "filter_object",
1545
+ "idx": 3
1546
+ },
1547
+ {
1548
+ "op": "query_motion_start"
1549
+ }
1550
+ ]
1551
+ },
1552
+ {
1553
+ "question": "If the blue sphere were removed, would the red sphere still collide with the cyan cube?",
1554
+ "answer": "yes",
1555
+ "choices": [
1556
+ "yes",
1557
+ "no"
1558
+ ],
1559
+ "answer_index": 0,
1560
+ "question_type": "counterfactual",
1561
+ "template": "cf_collision",
1562
+ "program": [
1563
+ {
1564
+ "op": "remove_object",
1565
+ "idx": 2
1566
+ },
1567
+ {
1568
+ "op": "find_collision",
1569
+ "objects": [
1570
+ 3,
1571
+ 5
1572
+ ]
1573
+ },
1574
+ {
1575
+ "op": "query_existence"
1576
+ }
1577
+ ]
1578
+ },
1579
+ {
1580
+ "question": "How many red objects are there?",
1581
+ "answer": "1",
1582
+ "choices": [
1583
+ "1",
1584
+ "2",
1585
+ "3",
1586
+ "4",
1587
+ "5",
1588
+ "6"
1589
+ ],
1590
+ "answer_index": 0,
1591
+ "question_type": "descriptive",
1592
+ "template": "count_color",
1593
+ "program": [
1594
+ {
1595
+ "op": "filter_color",
1596
+ "value": "red"
1597
+ },
1598
+ {
1599
+ "op": "count"
1600
+ }
1601
+ ]
1602
+ },
1603
+ {
1604
+ "question": "What happened right after the red sphere collided with the cyan cube?",
1605
+ "answer": "the red sphere collided with the brown cube",
1606
+ "choices": [
1607
+ "the red sphere collided with the brown cube",
1608
+ "the yellow cube collided with the gray sphere",
1609
+ "nothing happened",
1610
+ "the cyan cube collided with the wall"
1611
+ ],
1612
+ "answer_index": 0,
1613
+ "question_type": "explanatory",
1614
+ "template": "what_happened_after",
1615
+ "program": [
1616
+ {
1617
+ "op": "find_collision",
1618
+ "objects": [
1619
+ 3,
1620
+ 5
1621
+ ]
1622
+ },
1623
+ {
1624
+ "op": "query_after_event"
1625
+ }
1626
+ ]
1627
+ },
1628
+ {
1629
+ "question": "Will the red sphere collide with the cyan cube by the end of the video?",
1630
+ "answer": "yes",
1631
+ "choices": [
1632
+ "no",
1633
+ "yes"
1634
+ ],
1635
+ "answer_index": 1,
1636
+ "question_type": "predictive",
1637
+ "template": "will_collide",
1638
+ "program": [
1639
+ {
1640
+ "op": "find_collision",
1641
+ "objects": [
1642
+ 3,
1643
+ 5
1644
+ ]
1645
+ },
1646
+ {
1647
+ "op": "query_existence"
1648
+ }
1649
+ ]
1650
+ },
1651
+ {
1652
+ "question": "What happened right after the red sphere collided with the brown cube?",
1653
+ "answer": "the yellow cube collided with the gray sphere",
1654
+ "choices": [
1655
+ "nothing happened",
1656
+ "the gray sphere started moving",
1657
+ "the brown cube started moving",
1658
+ "the yellow cube collided with the gray sphere"
1659
+ ],
1660
+ "answer_index": 3,
1661
+ "question_type": "explanatory",
1662
+ "template": "what_happened_after",
1663
+ "program": [
1664
+ {
1665
+ "op": "find_collision",
1666
+ "objects": [
1667
+ 3,
1668
+ 4
1669
+ ]
1670
+ },
1671
+ {
1672
+ "op": "query_after_event"
1673
+ }
1674
+ ]
1675
+ },
1676
+ {
1677
+ "question": "What material is the brown cube made of?",
1678
+ "answer": "rubber",
1679
+ "choices": [
1680
+ "metal",
1681
+ "rubber"
1682
+ ],
1683
+ "answer_index": 1,
1684
+ "question_type": "descriptive",
1685
+ "template": "query_material",
1686
+ "program": [
1687
+ {
1688
+ "op": "filter_color",
1689
+ "value": "brown"
1690
+ },
1691
+ {
1692
+ "op": "filter_shape",
1693
+ "value": "cube"
1694
+ },
1695
+ {
1696
+ "op": "query_material"
1697
+ }
1698
+ ]
1699
+ },
1700
+ {
1701
+ "question": "What color is the object in front of the blue sphere?",
1702
+ "answer": "gray",
1703
+ "choices": [
1704
+ "blue",
1705
+ "yellow",
1706
+ "gray",
1707
+ "brown",
1708
+ "cyan",
1709
+ "red",
1710
+ "purple",
1711
+ "green"
1712
+ ],
1713
+ "answer_index": 2,
1714
+ "question_type": "descriptive",
1715
+ "template": "query_color_rel",
1716
+ "program": [
1717
+ {
1718
+ "op": "filter_color",
1719
+ "value": "blue"
1720
+ },
1721
+ {
1722
+ "op": "relate",
1723
+ "direction": "in_front_of"
1724
+ },
1725
+ {
1726
+ "op": "query_color"
1727
+ }
1728
+ ]
1729
+ }
1730
+ ]
1731
+ },
1732
+ {
1733
+ "video_index": 4,
1734
+ "video_filename": "videos/video_00004.gif",
1735
+ "num_frames": 64,
1736
+ "frame_size": 128,
1737
+ "fps": 25,
1738
+ "scene": {
1739
+ "objects": [
1740
+ {
1741
+ "idx": 0,
1742
+ "color": "red",
1743
+ "shape": "sphere",
1744
+ "material": "metal",
1745
+ "size": "small",
1746
+ "radius": 0.1658297766637648,
1747
+ "position": [
1748
+ 1.3299818020728005,
1749
+ -0.9991529841378586
1750
+ ],
1751
+ "velocity": [
1752
+ 0.0,
1753
+ 0.0
1754
+ ],
1755
+ "spin": -0.07188326857379423,
1756
+ "is_probe": false
1757
+ },
1758
+ {
1759
+ "idx": 1,
1760
+ "color": "cyan",
1761
+ "shape": "sphere",
1762
+ "material": "metal",
1763
+ "size": "large",
1764
+ "radius": 0.3231157374035464,
1765
+ "position": [
1766
+ 0.3374400122180976,
1767
+ 0.635080711250702
1768
+ ],
1769
+ "velocity": [
1770
+ 0.0,
1771
+ 0.0
1772
+ ],
1773
+ "spin": -0.8490599207340147,
1774
+ "is_probe": false
1775
+ },
1776
+ {
1777
+ "idx": 2,
1778
+ "color": "blue",
1779
+ "shape": "cube",
1780
+ "material": "rubber",
1781
+ "size": "small",
1782
+ "radius": 0.1990491799958673,
1783
+ "position": [
1784
+ 1.3726914053004184,
1785
+ 0.5135379925938357
1786
+ ],
1787
+ "velocity": [
1788
+ -0.519380992006974,
1789
+ -1.3758624215162312
1790
+ ],
1791
+ "spin": -0.9276344842243871,
1792
+ "is_probe": false
1793
+ },
1794
+ {
1795
+ "idx": 3,
1796
+ "color": "gray",
1797
+ "shape": "sphere",
1798
+ "material": "metal",
1799
+ "size": "large",
1800
+ "radius": 0.28957806341219433,
1801
+ "position": [
1802
+ -1.1364731580997514,
1803
+ -0.006610443765339147
1804
+ ],
1805
+ "velocity": [
1806
+ -1.0283166962197308,
1807
+ 0.26460535465147544
1808
+ ],
1809
+ "spin": -0.9878105416611754,
1810
+ "is_probe": false
1811
+ },
1812
+ {
1813
+ "idx": 4,
1814
+ "color": "yellow",
1815
+ "shape": "sphere",
1816
+ "material": "metal",
1817
+ "size": "small",
1818
+ "radius": 0.1981359721589741,
1819
+ "position": [
1820
+ 0.254248982005842,
1821
+ -0.7197164900960757
1822
+ ],
1823
+ "velocity": [
1824
+ 0.2976426213341292,
1825
+ 1.6356465885638267
1826
+ ],
1827
+ "spin": 1.152669154895344,
1828
+ "is_probe": false
1829
+ }
1830
+ ]
1831
+ },
1832
+ "events": {
1833
+ "collision_events": [
1834
+ {
1835
+ "frame": 13,
1836
+ "objects": [
1837
+ 1,
1838
+ 4
1839
+ ],
1840
+ "description": "the cyan sphere collided with the yellow sphere"
1841
+ },
1842
+ {
1843
+ "frame": 50,
1844
+ "objects": [
1845
+ 0,
1846
+ 4
1847
+ ],
1848
+ "description": "the red sphere collided with the yellow sphere"
1849
+ }
1850
+ ],
1851
+ "motion_events": [
1852
+ {
1853
+ "object": 0,
1854
+ "type": "start",
1855
+ "frame": 50,
1856
+ "cause_collision": {
1857
+ "frame": 50,
1858
+ "objects": [
1859
+ 0,
1860
+ 4
1861
+ ]
1862
+ }
1863
+ },
1864
+ {
1865
+ "object": 1,
1866
+ "type": "start",
1867
+ "frame": 13,
1868
+ "cause_collision": {
1869
+ "frame": 13,
1870
+ "objects": [
1871
+ 1,
1872
+ 4
1873
+ ]
1874
+ }
1875
+ }
1876
+ ],
1877
+ "initially_moving": [
1878
+ 2,
1879
+ 3,
1880
+ 4
1881
+ ]
1882
+ },
1883
+ "raw_events": {
1884
+ "collisions": [
1885
+ {
1886
+ "frame": 13,
1887
+ "objects": [
1888
+ 1,
1889
+ 4
1890
+ ]
1891
+ },
1892
+ {
1893
+ "frame": 50,
1894
+ "objects": [
1895
+ 0,
1896
+ 4
1897
+ ]
1898
+ }
1899
+ ],
1900
+ "starts": {
1901
+ "0": [
1902
+ 50
1903
+ ],
1904
+ "1": [
1905
+ 13
1906
+ ],
1907
+ "2": [],
1908
+ "3": [],
1909
+ "4": []
1910
+ },
1911
+ "stops": {
1912
+ "0": [],
1913
+ "1": [],
1914
+ "2": [],
1915
+ "3": [],
1916
+ "4": []
1917
+ },
1918
+ "initially_moving": [
1919
+ 2,
1920
+ 3,
1921
+ 4
1922
+ ],
1923
+ "wall_hits": [
1924
+ [
1925
+ 14,
1926
+ 3,
1927
+ 0,
1928
+ -1
1929
+ ],
1930
+ [
1931
+ 46,
1932
+ 2,
1933
+ 1,
1934
+ -1
1935
+ ],
1936
+ [
1937
+ 48,
1938
+ 1,
1939
+ 1,
1940
+ 1
1941
+ ]
1942
+ ]
1943
+ },
1944
+ "questions": [
1945
+ {
1946
+ "question": "What happened right after the cyan sphere collided with the yellow sphere?",
1947
+ "answer": "the red sphere collided with the yellow sphere",
1948
+ "choices": [
1949
+ "the red sphere started moving",
1950
+ "the red sphere collided with the yellow sphere",
1951
+ "the cyan sphere started moving",
1952
+ "the gray sphere collided with the wall"
1953
+ ],
1954
+ "answer_index": 1,
1955
+ "question_type": "explanatory",
1956
+ "template": "what_happened_after",
1957
+ "program": [
1958
+ {
1959
+ "op": "find_collision",
1960
+ "objects": [
1961
+ 1,
1962
+ 4
1963
+ ]
1964
+ },
1965
+ {
1966
+ "op": "query_after_event"
1967
+ }
1968
+ ]
1969
+ },
1970
+ {
1971
+ "question": "If the cyan sphere were removed, would the red sphere still start moving?",
1972
+ "answer": "no",
1973
+ "choices": [
1974
+ "no",
1975
+ "yes"
1976
+ ],
1977
+ "answer_index": 0,
1978
+ "question_type": "counterfactual",
1979
+ "template": "cf_motion",
1980
+ "program": [
1981
+ {
1982
+ "op": "remove_object",
1983
+ "idx": 1
1984
+ },
1985
+ {
1986
+ "op": "filter_object",
1987
+ "idx": 0
1988
+ },
1989
+ {
1990
+ "op": "query_motion_start"
1991
+ }
1992
+ ]
1993
+ },
1994
+ {
1995
+ "question": "What shape is the cyan object?",
1996
+ "answer": "sphere",
1997
+ "choices": [
1998
+ "sphere",
1999
+ "cylinder",
2000
+ "cube"
2001
+ ],
2002
+ "answer_index": 0,
2003
+ "question_type": "descriptive",
2004
+ "template": "query_shape",
2005
+ "program": [
2006
+ {
2007
+ "op": "filter_color",
2008
+ "value": "cyan"
2009
+ },
2010
+ {
2011
+ "op": "query_shape"
2012
+ }
2013
+ ]
2014
+ },
2015
+ {
2016
+ "question": "What shape is the red object?",
2017
+ "answer": "sphere",
2018
+ "choices": [
2019
+ "cube",
2020
+ "cylinder",
2021
+ "sphere"
2022
+ ],
2023
+ "answer_index": 2,
2024
+ "question_type": "descriptive",
2025
+ "template": "query_shape",
2026
+ "program": [
2027
+ {
2028
+ "op": "filter_color",
2029
+ "value": "red"
2030
+ },
2031
+ {
2032
+ "op": "query_shape"
2033
+ }
2034
+ ]
2035
+ },
2036
+ {
2037
+ "question": "If the yellow sphere were removed, would the red sphere still start moving?",
2038
+ "answer": "no",
2039
+ "choices": [
2040
+ "yes",
2041
+ "no"
2042
+ ],
2043
+ "answer_index": 1,
2044
+ "question_type": "counterfactual",
2045
+ "template": "cf_motion",
2046
+ "program": [
2047
+ {
2048
+ "op": "remove_object",
2049
+ "idx": 4
2050
+ },
2051
+ {
2052
+ "op": "filter_object",
2053
+ "idx": 0
2054
+ },
2055
+ {
2056
+ "op": "query_motion_start"
2057
+ }
2058
+ ]
2059
+ },
2060
+ {
2061
+ "question": "What caused the red sphere to start moving?",
2062
+ "answer": "the collision with the yellow sphere",
2063
+ "choices": [
2064
+ "the collision with the cyan sphere",
2065
+ "the collision with the yellow sphere",
2066
+ "nothing - it was already moving",
2067
+ "it was pushed by the wall"
2068
+ ],
2069
+ "answer_index": 1,
2070
+ "question_type": "explanatory",
2071
+ "template": "cause_of_motion",
2072
+ "program": [
2073
+ {
2074
+ "op": "filter_object",
2075
+ "idx": 0
2076
+ },
2077
+ {
2078
+ "op": "query_motion_cause"
2079
+ }
2080
+ ]
2081
+ },
2082
+ {
2083
+ "question": "What shape is the yellow object?",
2084
+ "answer": "sphere",
2085
+ "choices": [
2086
+ "sphere",
2087
+ "cube",
2088
+ "cylinder"
2089
+ ],
2090
+ "answer_index": 0,
2091
+ "question_type": "descriptive",
2092
+ "template": "query_shape",
2093
+ "program": [
2094
+ {
2095
+ "op": "filter_color",
2096
+ "value": "yellow"
2097
+ },
2098
+ {
2099
+ "op": "query_shape"
2100
+ }
2101
+ ]
2102
+ },
2103
+ {
2104
+ "question": "Will the red sphere collide with the cyan sphere by the end of the video?",
2105
+ "answer": "no",
2106
+ "choices": [
2107
+ "yes",
2108
+ "no"
2109
+ ],
2110
+ "answer_index": 1,
2111
+ "question_type": "predictive",
2112
+ "template": "will_collide",
2113
+ "program": [
2114
+ {
2115
+ "op": "find_collision",
2116
+ "objects": [
2117
+ 0,
2118
+ 1
2119
+ ]
2120
+ },
2121
+ {
2122
+ "op": "query_existence"
2123
+ }
2124
+ ]
2125
+ }
2126
+ ]
2127
+ },
2128
+ {
2129
+ "video_index": 5,
2130
+ "video_filename": "videos/video_00005.gif",
2131
+ "num_frames": 64,
2132
+ "frame_size": 128,
2133
+ "fps": 25,
2134
+ "scene": {
2135
+ "objects": [
2136
+ {
2137
+ "idx": 0,
2138
+ "color": "red",
2139
+ "shape": "cylinder",
2140
+ "material": "rubber",
2141
+ "size": "small",
2142
+ "radius": 0.16609685313350853,
2143
+ "position": [
2144
+ -0.02162864193159808,
2145
+ 0.5477369906763048
2146
+ ],
2147
+ "velocity": [
2148
+ 0.0,
2149
+ 0.0
2150
+ ],
2151
+ "spin": -1.496400949239514,
2152
+ "is_probe": false
2153
+ },
2154
+ {
2155
+ "idx": 1,
2156
+ "color": "brown",
2157
+ "shape": "cube",
2158
+ "material": "rubber",
2159
+ "size": "large",
2160
+ "radius": 0.33793489546074046,
2161
+ "position": [
2162
+ -1.3615115898300263,
2163
+ 0.17234796245424255
2164
+ ],
2165
+ "velocity": [
2166
+ -1.1364131596450517,
2167
+ -0.02402328219120739
2168
+ ],
2169
+ "spin": -0.8902414916563056,
2170
+ "is_probe": false
2171
+ },
2172
+ {
2173
+ "idx": 2,
2174
+ "color": "blue",
2175
+ "shape": "cube",
2176
+ "material": "rubber",
2177
+ "size": "small",
2178
+ "radius": 0.19386065648651293,
2179
+ "position": [
2180
+ -0.7085000259566853,
2181
+ 1.1769186373382585
2182
+ ],
2183
+ "velocity": [
2184
+ 0.0,
2185
+ 0.0
2186
+ ],
2187
+ "spin": -0.5251720662731818,
2188
+ "is_probe": false
2189
+ },
2190
+ {
2191
+ "idx": 3,
2192
+ "color": "green",
2193
+ "shape": "sphere",
2194
+ "material": "rubber",
2195
+ "size": "large",
2196
+ "radius": 0.3275384830086993,
2197
+ "position": [
2198
+ 1.1472743572152606,
2199
+ -0.8453125720011849
2200
+ ],
2201
+ "velocity": [
2202
+ 0.0,
2203
+ 0.0
2204
+ ],
2205
+ "spin": 0.9186459930811308,
2206
+ "is_probe": false
2207
+ },
2208
+ {
2209
+ "idx": 4,
2210
+ "color": "gray",
2211
+ "shape": "sphere",
2212
+ "material": "rubber",
2213
+ "size": "large",
2214
+ "radius": 0.2913923731467823,
2215
+ "position": [
2216
+ 1.2258895421837905,
2217
+ 1.1538059508754384
2218
+ ],
2219
+ "velocity": [
2220
+ -0.34428904618230377,
2221
+ 0.7761002312894555
2222
+ ],
2223
+ "spin": 0.5955359709549324,
2224
+ "is_probe": false
2225
+ }
2226
+ ]
2227
+ },
2228
+ "events": {
2229
+ "collision_events": [
2230
+ {
2231
+ "frame": 43,
2232
+ "objects": [
2233
+ 0,
2234
+ 1
2235
+ ],
2236
+ "description": "the red cylinder collided with the brown cube"
2237
+ },
2238
+ {
2239
+ "frame": 52,
2240
+ "objects": [
2241
+ 0,
2242
+ 4
2243
+ ],
2244
+ "description": "the red cylinder collided with the gray sphere"
2245
+ }
2246
+ ],
2247
+ "motion_events": [
2248
+ {
2249
+ "object": 0,
2250
+ "type": "start",
2251
+ "frame": 43,
2252
+ "cause_collision": {
2253
+ "frame": 43,
2254
+ "objects": [
2255
+ 0,
2256
+ 1
2257
+ ]
2258
+ }
2259
+ }
2260
+ ],
2261
+ "initially_moving": [
2262
+ 1,
2263
+ 4
2264
+ ]
2265
+ },
2266
+ "raw_events": {
2267
+ "collisions": [
2268
+ {
2269
+ "frame": 43,
2270
+ "objects": [
2271
+ 0,
2272
+ 1
2273
+ ]
2274
+ },
2275
+ {
2276
+ "frame": 52,
2277
+ "objects": [
2278
+ 0,
2279
+ 4
2280
+ ]
2281
+ }
2282
+ ],
2283
+ "starts": {
2284
+ "0": [
2285
+ 43
2286
+ ],
2287
+ "1": [],
2288
+ "2": [],
2289
+ "3": [],
2290
+ "4": []
2291
+ },
2292
+ "stops": {
2293
+ "0": [],
2294
+ "1": [],
2295
+ "2": [],
2296
+ "3": [],
2297
+ "4": []
2298
+ },
2299
+ "initially_moving": [
2300
+ 1,
2301
+ 4
2302
+ ],
2303
+ "wall_hits": [
2304
+ [
2305
+ 6,
2306
+ 1,
2307
+ 0,
2308
+ -1
2309
+ ],
2310
+ [
2311
+ 18,
2312
+ 4,
2313
+ 1,
2314
+ 1
2315
+ ]
2316
+ ]
2317
+ },
2318
+ "questions": [
2319
+ {
2320
+ "question": "How many red objects are there?",
2321
+ "answer": "1",
2322
+ "choices": [
2323
+ "0",
2324
+ "1",
2325
+ "2",
2326
+ "3",
2327
+ "4",
2328
+ "6"
2329
+ ],
2330
+ "answer_index": 1,
2331
+ "question_type": "descriptive",
2332
+ "template": "count_color",
2333
+ "program": [
2334
+ {
2335
+ "op": "filter_color",
2336
+ "value": "red"
2337
+ },
2338
+ {
2339
+ "op": "count"
2340
+ }
2341
+ ]
2342
+ },
2343
+ {
2344
+ "question": "How many green objects are there?",
2345
+ "answer": "1",
2346
+ "choices": [
2347
+ "0",
2348
+ "1",
2349
+ "3",
2350
+ "4",
2351
+ "5",
2352
+ "6"
2353
+ ],
2354
+ "answer_index": 1,
2355
+ "question_type": "descriptive",
2356
+ "template": "count_color",
2357
+ "program": [
2358
+ {
2359
+ "op": "filter_color",
2360
+ "value": "green"
2361
+ },
2362
+ {
2363
+ "op": "count"
2364
+ }
2365
+ ]
2366
+ },
2367
+ {
2368
+ "question": "After the red cylinder collided with the gray sphere, will the red cylinder collide with something else?",
2369
+ "answer": "no",
2370
+ "choices": [
2371
+ "no",
2372
+ "yes"
2373
+ ],
2374
+ "answer_index": 0,
2375
+ "question_type": "predictive",
2376
+ "template": "will_collide_again",
2377
+ "program": [
2378
+ {
2379
+ "op": "find_collision",
2380
+ "objects": [
2381
+ 0,
2382
+ 4
2383
+ ]
2384
+ },
2385
+ {
2386
+ "op": "query_subsequent_collision"
2387
+ }
2388
+ ]
2389
+ },
2390
+ {
2391
+ "question": "If the gray sphere were removed, would the red cylinder still collide with the brown cube?",
2392
+ "answer": "yes",
2393
+ "choices": [
2394
+ "no",
2395
+ "yes"
2396
+ ],
2397
+ "answer_index": 1,
2398
+ "question_type": "counterfactual",
2399
+ "template": "cf_collision",
2400
+ "program": [
2401
+ {
2402
+ "op": "remove_object",
2403
+ "idx": 4
2404
+ },
2405
+ {
2406
+ "op": "find_collision",
2407
+ "objects": [
2408
+ 0,
2409
+ 1
2410
+ ]
2411
+ },
2412
+ {
2413
+ "op": "query_existence"
2414
+ }
2415
+ ]
2416
+ },
2417
+ {
2418
+ "question": "How many collisions happened in the video?",
2419
+ "answer": "2",
2420
+ "choices": [
2421
+ "0",
2422
+ "1",
2423
+ "2",
2424
+ "3",
2425
+ "4",
2426
+ "6"
2427
+ ],
2428
+ "answer_index": 2,
2429
+ "question_type": "explanatory",
2430
+ "template": "count_collisions",
2431
+ "program": [
2432
+ {
2433
+ "op": "filter_event",
2434
+ "type": "collision"
2435
+ },
2436
+ {
2437
+ "op": "count"
2438
+ }
2439
+ ]
2440
+ },
2441
+ {
2442
+ "question": "If the green sphere were removed, would the red cylinder still start moving?",
2443
+ "answer": "yes",
2444
+ "choices": [
2445
+ "yes",
2446
+ "no"
2447
+ ],
2448
+ "answer_index": 0,
2449
+ "question_type": "counterfactual",
2450
+ "template": "cf_motion",
2451
+ "program": [
2452
+ {
2453
+ "op": "remove_object",
2454
+ "idx": 3
2455
+ },
2456
+ {
2457
+ "op": "filter_object",
2458
+ "idx": 0
2459
+ },
2460
+ {
2461
+ "op": "query_motion_start"
2462
+ }
2463
+ ]
2464
+ },
2465
+ {
2466
+ "question": "What material is the brown cube made of?",
2467
+ "answer": "rubber",
2468
+ "choices": [
2469
+ "rubber",
2470
+ "metal"
2471
+ ],
2472
+ "answer_index": 0,
2473
+ "question_type": "descriptive",
2474
+ "template": "query_material",
2475
+ "program": [
2476
+ {
2477
+ "op": "filter_color",
2478
+ "value": "brown"
2479
+ },
2480
+ {
2481
+ "op": "filter_shape",
2482
+ "value": "cube"
2483
+ },
2484
+ {
2485
+ "op": "query_material"
2486
+ }
2487
+ ]
2488
+ },
2489
+ {
2490
+ "question": "What happened right before the red cylinder collided with the brown cube?",
2491
+ "answer": "nothing happened",
2492
+ "choices": [
2493
+ "the brown cube collided with the wall",
2494
+ "the gray sphere collided with the wall",
2495
+ "nothing happened",
2496
+ "the red cylinder collided with the gray sphere"
2497
+ ],
2498
+ "answer_index": 2,
2499
+ "question_type": "explanatory",
2500
+ "template": "what_happened_before",
2501
+ "program": [
2502
+ {
2503
+ "op": "find_collision",
2504
+ "objects": [
2505
+ 0,
2506
+ 1
2507
+ ]
2508
+ },
2509
+ {
2510
+ "op": "query_before_event"
2511
+ }
2512
+ ]
2513
+ }
2514
+ ]
2515
+ },
2516
+ {
2517
+ "video_index": 6,
2518
+ "video_filename": "videos/video_00006.gif",
2519
+ "num_frames": 64,
2520
+ "frame_size": 128,
2521
+ "fps": 25,
2522
+ "scene": {
2523
+ "objects": [
2524
+ {
2525
+ "idx": 0,
2526
+ "color": "gray",
2527
+ "shape": "cylinder",
2528
+ "material": "metal",
2529
+ "size": "large",
2530
+ "radius": 0.30582561130513064,
2531
+ "position": [
2532
+ 1.015313310209694,
2533
+ 1.530768557963947
2534
+ ],
2535
+ "velocity": [
2536
+ 0.9319215143021138,
2537
+ 1.3700450324185096
2538
+ ],
2539
+ "spin": 1.4610128175207322,
2540
+ "is_probe": false
2541
+ },
2542
+ {
2543
+ "idx": 1,
2544
+ "color": "green",
2545
+ "shape": "cube",
2546
+ "material": "rubber",
2547
+ "size": "small",
2548
+ "radius": 0.15881747166108884,
2549
+ "position": [
2550
+ 1.0384166676550775,
2551
+ -1.366283580995418
2552
+ ],
2553
+ "velocity": [
2554
+ -0.13504772072375007,
2555
+ 1.651824808022114
2556
+ ],
2557
+ "spin": -0.8753456925925228,
2558
+ "is_probe": false
2559
+ },
2560
+ {
2561
+ "idx": 2,
2562
+ "color": "yellow",
2563
+ "shape": "sphere",
2564
+ "material": "rubber",
2565
+ "size": "small",
2566
+ "radius": 0.18688395948884723,
2567
+ "position": [
2568
+ 1.1539508850452902,
2569
+ -0.025816298556336603
2570
+ ],
2571
+ "velocity": [
2572
+ 1.2339526958730866,
2573
+ 0.7270782658906909
2574
+ ],
2575
+ "spin": 0.9492184377530788,
2576
+ "is_probe": false
2577
+ }
2578
+ ]
2579
+ },
2580
+ "events": {
2581
+ "collision_events": [
2582
+ {
2583
+ "frame": 18,
2584
+ "objects": [
2585
+ 0,
2586
+ 2
2587
+ ],
2588
+ "description": "the gray cylinder collided with the yellow sphere"
2589
+ },
2590
+ {
2591
+ "frame": 30,
2592
+ "objects": [
2593
+ 0,
2594
+ 1
2595
+ ],
2596
+ "description": "the gray cylinder collided with the green cube"
2597
+ }
2598
+ ],
2599
+ "motion_events": [],
2600
+ "initially_moving": [
2601
+ 0,
2602
+ 1,
2603
+ 2
2604
+ ]
2605
+ },
2606
+ "raw_events": {
2607
+ "collisions": [
2608
+ {
2609
+ "frame": 18,
2610
+ "objects": [
2611
+ 0,
2612
+ 2
2613
+ ]
2614
+ },
2615
+ {
2616
+ "frame": 30,
2617
+ "objects": [
2618
+ 0,
2619
+ 1
2620
+ ]
2621
+ }
2622
+ ],
2623
+ "starts": {
2624
+ "0": [],
2625
+ "1": [],
2626
+ "2": []
2627
+ },
2628
+ "stops": {
2629
+ "0": [],
2630
+ "1": [],
2631
+ "2": []
2632
+ },
2633
+ "initially_moving": [
2634
+ 0,
2635
+ 1,
2636
+ 2
2637
+ ],
2638
+ "wall_hits": [
2639
+ [
2640
+ 2,
2641
+ 0,
2642
+ 1,
2643
+ 1
2644
+ ],
2645
+ [
2646
+ 13,
2647
+ 2,
2648
+ 0,
2649
+ 1
2650
+ ],
2651
+ [
2652
+ 18,
2653
+ 0,
2654
+ 0,
2655
+ 1
2656
+ ],
2657
+ [
2658
+ 46,
2659
+ 2,
2660
+ 1,
2661
+ -1
2662
+ ]
2663
+ ]
2664
+ },
2665
+ "questions": [
2666
+ {
2667
+ "question": "If the yellow sphere were removed, would the gray cylinder still collide with the green cube?",
2668
+ "answer": "no",
2669
+ "choices": [
2670
+ "yes",
2671
+ "no"
2672
+ ],
2673
+ "answer_index": 1,
2674
+ "question_type": "counterfactual",
2675
+ "template": "cf_collision",
2676
+ "program": [
2677
+ {
2678
+ "op": "remove_object",
2679
+ "idx": 2
2680
+ },
2681
+ {
2682
+ "op": "find_collision",
2683
+ "objects": [
2684
+ 0,
2685
+ 1
2686
+ ]
2687
+ },
2688
+ {
2689
+ "op": "query_existence"
2690
+ }
2691
+ ]
2692
+ },
2693
+ {
2694
+ "question": "After the gray cylinder collided with the yellow sphere, will the gray cylinder collide with something else?",
2695
+ "answer": "yes",
2696
+ "choices": [
2697
+ "yes",
2698
+ "no"
2699
+ ],
2700
+ "answer_index": 0,
2701
+ "question_type": "predictive",
2702
+ "template": "will_collide_again",
2703
+ "program": [
2704
+ {
2705
+ "op": "find_collision",
2706
+ "objects": [
2707
+ 0,
2708
+ 2
2709
+ ]
2710
+ },
2711
+ {
2712
+ "op": "query_subsequent_collision"
2713
+ }
2714
+ ]
2715
+ },
2716
+ {
2717
+ "question": "How many yellow objects are there?",
2718
+ "answer": "1",
2719
+ "choices": [
2720
+ "0",
2721
+ "1",
2722
+ "3",
2723
+ "4",
2724
+ "5",
2725
+ "6"
2726
+ ],
2727
+ "answer_index": 1,
2728
+ "question_type": "descriptive",
2729
+ "template": "count_color",
2730
+ "program": [
2731
+ {
2732
+ "op": "filter_color",
2733
+ "value": "yellow"
2734
+ },
2735
+ {
2736
+ "op": "count"
2737
+ }
2738
+ ]
2739
+ },
2740
+ {
2741
+ "question": "If the green cube were removed, would the gray cylinder still collide with the yellow sphere?",
2742
+ "answer": "yes",
2743
+ "choices": [
2744
+ "yes",
2745
+ "no"
2746
+ ],
2747
+ "answer_index": 0,
2748
+ "question_type": "counterfactual",
2749
+ "template": "cf_collision",
2750
+ "program": [
2751
+ {
2752
+ "op": "remove_object",
2753
+ "idx": 1
2754
+ },
2755
+ {
2756
+ "op": "find_collision",
2757
+ "objects": [
2758
+ 0,
2759
+ 2
2760
+ ]
2761
+ },
2762
+ {
2763
+ "op": "query_existence"
2764
+ }
2765
+ ]
2766
+ },
2767
+ {
2768
+ "question": "What color is the sphere?",
2769
+ "answer": "yellow",
2770
+ "choices": [
2771
+ "yellow",
2772
+ "blue",
2773
+ "purple",
2774
+ "brown",
2775
+ "red",
2776
+ "gray",
2777
+ "cyan",
2778
+ "green"
2779
+ ],
2780
+ "answer_index": 0,
2781
+ "question_type": "descriptive",
2782
+ "template": "query_color",
2783
+ "program": [
2784
+ {
2785
+ "op": "filter_shape",
2786
+ "value": "sphere"
2787
+ },
2788
+ {
2789
+ "op": "query_color"
2790
+ }
2791
+ ]
2792
+ },
2793
+ {
2794
+ "question": "How many objects were moving when the gray cylinder collided with the green cube?",
2795
+ "answer": "3",
2796
+ "choices": [
2797
+ "0",
2798
+ "1",
2799
+ "2",
2800
+ "3"
2801
+ ],
2802
+ "answer_index": 3,
2803
+ "question_type": "explanatory",
2804
+ "template": "count_moving_at",
2805
+ "program": [
2806
+ {
2807
+ "op": "find_collision",
2808
+ "objects": [
2809
+ 0,
2810
+ 1
2811
+ ]
2812
+ },
2813
+ {
2814
+ "op": "count_moving_at_collision"
2815
+ }
2816
+ ]
2817
+ },
2818
+ {
2819
+ "question": "What material is the gray cylinder made of?",
2820
+ "answer": "metal",
2821
+ "choices": [
2822
+ "rubber",
2823
+ "metal"
2824
+ ],
2825
+ "answer_index": 1,
2826
+ "question_type": "descriptive",
2827
+ "template": "query_material",
2828
+ "program": [
2829
+ {
2830
+ "op": "filter_color",
2831
+ "value": "gray"
2832
+ },
2833
+ {
2834
+ "op": "filter_shape",
2835
+ "value": "cylinder"
2836
+ },
2837
+ {
2838
+ "op": "query_material"
2839
+ }
2840
+ ]
2841
+ },
2842
+ {
2843
+ "question": "What happened right after the gray cylinder collided with the green cube?",
2844
+ "answer": "nothing happened",
2845
+ "choices": [
2846
+ "the gray cylinder collided with the wall",
2847
+ "the yellow sphere collided with the wall",
2848
+ "the gray cylinder collided with the yellow sphere",
2849
+ "nothing happened"
2850
+ ],
2851
+ "answer_index": 3,
2852
+ "question_type": "explanatory",
2853
+ "template": "what_happened_after",
2854
+ "program": [
2855
+ {
2856
+ "op": "find_collision",
2857
+ "objects": [
2858
+ 0,
2859
+ 1
2860
+ ]
2861
+ },
2862
+ {
2863
+ "op": "query_after_event"
2864
+ }
2865
+ ]
2866
+ }
2867
+ ]
2868
+ },
2869
+ {
2870
+ "video_index": 7,
2871
+ "video_filename": "videos/video_00007.gif",
2872
+ "num_frames": 64,
2873
+ "frame_size": 128,
2874
+ "fps": 25,
2875
+ "scene": {
2876
+ "objects": [
2877
+ {
2878
+ "idx": 0,
2879
+ "color": "green",
2880
+ "shape": "sphere",
2881
+ "material": "metal",
2882
+ "size": "small",
2883
+ "radius": 0.16276677029301875,
2884
+ "position": [
2885
+ 0.42778940044382985,
2886
+ 0.5469957558196439
2887
+ ],
2888
+ "velocity": [
2889
+ -0.435788272762294,
2890
+ -0.708289098056274
2891
+ ],
2892
+ "spin": 1.0352229626236586,
2893
+ "is_probe": false
2894
+ },
2895
+ {
2896
+ "idx": 1,
2897
+ "color": "gray",
2898
+ "shape": "sphere",
2899
+ "material": "rubber",
2900
+ "size": "small",
2901
+ "radius": 0.19872487306467332,
2902
+ "position": [
2903
+ -1.0825571405780572,
2904
+ -0.18502825171661863
2905
+ ],
2906
+ "velocity": [
2907
+ 0.0,
2908
+ 0.0
2909
+ ],
2910
+ "spin": 1.3348445134349385,
2911
+ "is_probe": false
2912
+ },
2913
+ {
2914
+ "idx": 2,
2915
+ "color": "red",
2916
+ "shape": "cube",
2917
+ "material": "metal",
2918
+ "size": "small",
2919
+ "radius": 0.17539950158063664,
2920
+ "position": [
2921
+ -1.2502173088115887,
2922
+ 1.4502669582513465
2923
+ ],
2924
+ "velocity": [
2925
+ 0.0,
2926
+ 0.0
2927
+ ],
2928
+ "spin": 1.2117503645877803,
2929
+ "is_probe": false
2930
+ },
2931
+ {
2932
+ "idx": 3,
2933
+ "color": "purple",
2934
+ "shape": "cube",
2935
+ "material": "rubber",
2936
+ "size": "large",
2937
+ "radius": 0.3084045003063881,
2938
+ "position": [
2939
+ -0.8834874841967719,
2940
+ 0.5324720040949835
2941
+ ],
2942
+ "velocity": [
2943
+ -0.7656290826407781,
2944
+ -0.358628834908836
2945
+ ],
2946
+ "spin": -0.9226095150950029,
2947
+ "is_probe": false
2948
+ }
2949
+ ]
2950
+ },
2951
+ "events": {
2952
+ "collision_events": [
2953
+ {
2954
+ "frame": 34,
2955
+ "objects": [
2956
+ 1,
2957
+ 3
2958
+ ],
2959
+ "description": "the gray sphere collided with the purple cube"
2960
+ },
2961
+ {
2962
+ "frame": 50,
2963
+ "objects": [
2964
+ 0,
2965
+ 1
2966
+ ],
2967
+ "description": "the green sphere collided with the gray sphere"
2968
+ }
2969
+ ],
2970
+ "motion_events": [
2971
+ {
2972
+ "object": 1,
2973
+ "type": "start",
2974
+ "frame": 34,
2975
+ "cause_collision": {
2976
+ "frame": 34,
2977
+ "objects": [
2978
+ 1,
2979
+ 3
2980
+ ]
2981
+ }
2982
+ }
2983
+ ],
2984
+ "initially_moving": [
2985
+ 0,
2986
+ 3
2987
+ ]
2988
+ },
2989
+ "raw_events": {
2990
+ "collisions": [
2991
+ {
2992
+ "frame": 34,
2993
+ "objects": [
2994
+ 1,
2995
+ 3
2996
+ ]
2997
+ },
2998
+ {
2999
+ "frame": 50,
3000
+ "objects": [
3001
+ 0,
3002
+ 1
3003
+ ]
3004
+ }
3005
+ ],
3006
+ "starts": {
3007
+ "0": [],
3008
+ "1": [
3009
+ 34
3010
+ ],
3011
+ "2": [],
3012
+ "3": []
3013
+ },
3014
+ "stops": {
3015
+ "0": [],
3016
+ "1": [],
3017
+ "2": [],
3018
+ "3": []
3019
+ },
3020
+ "initially_moving": [
3021
+ 0,
3022
+ 3
3023
+ ],
3024
+ "wall_hits": [
3025
+ [
3026
+ 27,
3027
+ 3,
3028
+ 0,
3029
+ -1
3030
+ ]
3031
+ ]
3032
+ },
3033
+ "questions": [
3034
+ {
3035
+ "question": "If the purple cube were removed, would the gray sphere still start moving?",
3036
+ "answer": "no",
3037
+ "choices": [
3038
+ "no",
3039
+ "yes"
3040
+ ],
3041
+ "answer_index": 0,
3042
+ "question_type": "counterfactual",
3043
+ "template": "cf_motion",
3044
+ "program": [
3045
+ {
3046
+ "op": "remove_object",
3047
+ "idx": 3
3048
+ },
3049
+ {
3050
+ "op": "filter_object",
3051
+ "idx": 1
3052
+ },
3053
+ {
3054
+ "op": "query_motion_start"
3055
+ }
3056
+ ]
3057
+ },
3058
+ {
3059
+ "question": "What happened right after the gray sphere collided with the purple cube?",
3060
+ "answer": "the green sphere collided with the gray sphere",
3061
+ "choices": [
3062
+ "the green sphere collided with the gray sphere",
3063
+ "the purple cube collided with the wall",
3064
+ "the gray sphere started moving",
3065
+ "nothing happened"
3066
+ ],
3067
+ "answer_index": 0,
3068
+ "question_type": "explanatory",
3069
+ "template": "what_happened_after",
3070
+ "program": [
3071
+ {
3072
+ "op": "find_collision",
3073
+ "objects": [
3074
+ 1,
3075
+ 3
3076
+ ]
3077
+ },
3078
+ {
3079
+ "op": "query_after_event"
3080
+ }
3081
+ ]
3082
+ },
3083
+ {
3084
+ "question": "How many red objects are there?",
3085
+ "answer": "1",
3086
+ "choices": [
3087
+ "0",
3088
+ "1",
3089
+ "2",
3090
+ "4",
3091
+ "5",
3092
+ "6"
3093
+ ],
3094
+ "answer_index": 1,
3095
+ "question_type": "descriptive",
3096
+ "template": "count_color",
3097
+ "program": [
3098
+ {
3099
+ "op": "filter_color",
3100
+ "value": "red"
3101
+ },
3102
+ {
3103
+ "op": "count"
3104
+ }
3105
+ ]
3106
+ },
3107
+ {
3108
+ "question": "If the red cube were removed, would the gray sphere still collide with the purple cube?",
3109
+ "answer": "yes",
3110
+ "choices": [
3111
+ "yes",
3112
+ "no"
3113
+ ],
3114
+ "answer_index": 0,
3115
+ "question_type": "counterfactual",
3116
+ "template": "cf_collision",
3117
+ "program": [
3118
+ {
3119
+ "op": "remove_object",
3120
+ "idx": 2
3121
+ },
3122
+ {
3123
+ "op": "find_collision",
3124
+ "objects": [
3125
+ 1,
3126
+ 3
3127
+ ]
3128
+ },
3129
+ {
3130
+ "op": "query_existence"
3131
+ }
3132
+ ]
3133
+ },
3134
+ {
3135
+ "question": "What color is the object in front of the purple cube?",
3136
+ "answer": "gray",
3137
+ "choices": [
3138
+ "gray",
3139
+ "red",
3140
+ "blue",
3141
+ "cyan",
3142
+ "purple",
3143
+ "green",
3144
+ "yellow",
3145
+ "brown"
3146
+ ],
3147
+ "answer_index": 0,
3148
+ "question_type": "descriptive",
3149
+ "template": "query_color_rel",
3150
+ "program": [
3151
+ {
3152
+ "op": "filter_color",
3153
+ "value": "purple"
3154
+ },
3155
+ {
3156
+ "op": "relate",
3157
+ "direction": "in_front_of"
3158
+ },
3159
+ {
3160
+ "op": "query_color"
3161
+ }
3162
+ ]
3163
+ },
3164
+ {
3165
+ "question": "How many cube objects are there?",
3166
+ "answer": "2",
3167
+ "choices": [
3168
+ "1",
3169
+ "2",
3170
+ "3",
3171
+ "4",
3172
+ "5",
3173
+ "6"
3174
+ ],
3175
+ "answer_index": 1,
3176
+ "question_type": "descriptive",
3177
+ "template": "count_shape",
3178
+ "program": [
3179
+ {
3180
+ "op": "filter_shape",
3181
+ "value": "cube"
3182
+ },
3183
+ {
3184
+ "op": "count"
3185
+ }
3186
+ ]
3187
+ },
3188
+ {
3189
+ "question": "How many collisions happened in the video?",
3190
+ "answer": "2",
3191
+ "choices": [
3192
+ "0",
3193
+ "1",
3194
+ "2",
3195
+ "3",
3196
+ "4",
3197
+ "6"
3198
+ ],
3199
+ "answer_index": 2,
3200
+ "question_type": "explanatory",
3201
+ "template": "count_collisions",
3202
+ "program": [
3203
+ {
3204
+ "op": "filter_event",
3205
+ "type": "collision"
3206
+ },
3207
+ {
3208
+ "op": "count"
3209
+ }
3210
+ ]
3211
+ },
3212
+ {
3213
+ "question": "Will the gray sphere collide with the red cube by the end of the video?",
3214
+ "answer": "no",
3215
+ "choices": [
3216
+ "no",
3217
+ "yes"
3218
+ ],
3219
+ "answer_index": 0,
3220
+ "question_type": "predictive",
3221
+ "template": "will_collide",
3222
+ "program": [
3223
+ {
3224
+ "op": "find_collision",
3225
+ "objects": [
3226
+ 1,
3227
+ 2
3228
+ ]
3229
+ },
3230
+ {
3231
+ "op": "query_existence"
3232
+ }
3233
+ ]
3234
+ }
3235
+ ]
3236
+ }
3237
+ ]
output/dataset_100/annotations.json ADDED
The diff for this file is too large to render. See raw diff
 
output/dataset_100/videos/video_00000.gif ADDED

Git LFS Details

  • SHA256: f114cb7d5c1084cb86adc4d1118ee190395042e6180c3b3b8be6fa6828c5fe13
  • Pointer size: 131 Bytes
  • Size of remote file: 123 kB
output/dataset_100/videos/video_00001.gif ADDED

Git LFS Details

  • SHA256: 2867d495d18e4cf84b45e122c74b09ba24f417d1e3a4ce655b7a277ccba15919
  • Pointer size: 131 Bytes
  • Size of remote file: 149 kB
output/dataset_100/videos/video_00002.gif ADDED

Git LFS Details

  • SHA256: c57cc553661e5c56dcc0e798c6629d5a15552d56a7b98baa9293c3def0abf21e
  • Pointer size: 131 Bytes
  • Size of remote file: 179 kB
output/dataset_100/videos/video_00003.gif ADDED

Git LFS Details

  • SHA256: 2cbf287483f5774fb040b69f2d79c60dd70bbff17b8841345c2d9d403c74c5f8
  • Pointer size: 131 Bytes
  • Size of remote file: 117 kB
output/dataset_100/videos/video_00004.gif ADDED

Git LFS Details

  • SHA256: efc349de5e3d5af30eb8a4a1607b20a0388c376b4b938841e3bdca1638f93cf5
  • Pointer size: 131 Bytes
  • Size of remote file: 153 kB
output/dataset_100/videos/video_00005.gif ADDED

Git LFS Details

  • SHA256: aafbc413b5ef046645048b8e72405d9a65404014baa89a2ebe109f524ad3fffb
  • Pointer size: 131 Bytes
  • Size of remote file: 159 kB
output/dataset_100/videos/video_00006.gif ADDED

Git LFS Details

  • SHA256: 6ba000cc700cf1f0c85fab93f4311ef05143858265f1a31fd894de9dc04f01f7
  • Pointer size: 131 Bytes
  • Size of remote file: 134 kB
output/dataset_100/videos/video_00007.gif ADDED

Git LFS Details

  • SHA256: 1ca2c53e50d09e920063897f6ed1a27f5e9137b6d1e5b5f3b6e373b7bcac2cf9
  • Pointer size: 131 Bytes
  • Size of remote file: 169 kB
output/dataset_100/videos/video_00008.gif ADDED

Git LFS Details

  • SHA256: 93dad149bea4e97d23f3f6e8e826404a1477a057bd11a600366c7b6c7bd7e25b
  • Pointer size: 131 Bytes
  • Size of remote file: 166 kB
output/dataset_100/videos/video_00009.gif ADDED

Git LFS Details

  • SHA256: cfa35655621140c3ffc4c0aeecbcd8d73fffa8b7eda13d4e069db9629c08a4fa
  • Pointer size: 131 Bytes
  • Size of remote file: 183 kB
output/dataset_100/videos/video_00010.gif ADDED

Git LFS Details

  • SHA256: 5f686f6c853c4b19c4f9dcce628697759354e50b603fba2b8dac92394b7ab9d7
  • Pointer size: 131 Bytes
  • Size of remote file: 181 kB
output/dataset_100/videos/video_00011.gif ADDED

Git LFS Details

  • SHA256: cd605598e0fa5cd223fddb49aea3bdbde1667b7c4f353d8eb6f2a790fff04616
  • Pointer size: 131 Bytes
  • Size of remote file: 152 kB
output/dataset_100/videos/video_00012.gif ADDED

Git LFS Details

  • SHA256: 145517239f4e0f9099a60796804d5b062fdcd59d3dc5de6223eb20597c8ad3b2
  • Pointer size: 131 Bytes
  • Size of remote file: 203 kB
output/dataset_100/videos/video_00013.gif ADDED

Git LFS Details

  • SHA256: 6591f5aa3231507f2e0f0454aa0338c3fbbce129cff4f95204c2f09506c51fcd
  • Pointer size: 131 Bytes
  • Size of remote file: 161 kB
output/dataset_100/videos/video_00014.gif ADDED

Git LFS Details

  • SHA256: cfa7b63aeee2beaef740725dad7aa751bb960df69d01723a688e8cf0528baae4
  • Pointer size: 131 Bytes
  • Size of remote file: 161 kB
output/dataset_100/videos/video_00015.gif ADDED

Git LFS Details

  • SHA256: 72cab7a4d7380755907ce663d34320b5e4db3b443bcc19d495a705ce70df7f2a
  • Pointer size: 131 Bytes
  • Size of remote file: 194 kB
output/dataset_100/videos/video_00016.gif ADDED

Git LFS Details

  • SHA256: 9e6abbf9480cea9edb5848af1ec6c216c165f178b5b471c576ffe2594128d19d
  • Pointer size: 131 Bytes
  • Size of remote file: 131 kB
output/dataset_100/videos/video_00017.gif ADDED

Git LFS Details

  • SHA256: a10546255a0d05ad68e388d9fa8a049bacfa7890684646c90fb4edbf5d4c68cf
  • Pointer size: 131 Bytes
  • Size of remote file: 127 kB
output/dataset_100/videos/video_00018.gif ADDED

Git LFS Details

  • SHA256: 64ad5a790518e1e36d049276486e26d0328f4d752ac59fc93f1885ab3dfde6ab
  • Pointer size: 131 Bytes
  • Size of remote file: 187 kB
output/dataset_100/videos/video_00019.gif ADDED

Git LFS Details

  • SHA256: 5a44fbafd25bab2262b9de5421cfdb576f977205d4d339b9db92fc06955a7e22
  • Pointer size: 131 Bytes
  • Size of remote file: 133 kB
output/dataset_100/videos/video_00020.gif ADDED

Git LFS Details

  • SHA256: 3338fe454325208c016913ca7ad8f131b102c25da319b928a83faaf574ee09a8
  • Pointer size: 131 Bytes
  • Size of remote file: 130 kB
output/dataset_100/videos/video_00021.gif ADDED

Git LFS Details

  • SHA256: 45605f289ae80b934fb9393e2f05203e82831bf92fb9dc5ef83b14e9262e0d7a
  • Pointer size: 131 Bytes
  • Size of remote file: 149 kB
output/dataset_100/videos/video_00022.gif ADDED

Git LFS Details

  • SHA256: 89471cb3d4d925d1667b193d6dbce072dafa591e85161799a0f2dd81e28526db
  • Pointer size: 131 Bytes
  • Size of remote file: 122 kB
output/dataset_100/videos/video_00023.gif ADDED

Git LFS Details

  • SHA256: b75d2868b30bb2d66230f0e282c5502c69e6c972ca2d279eef6794eae9a5a4a3
  • Pointer size: 131 Bytes
  • Size of remote file: 150 kB
output/dataset_100/videos/video_00024.gif ADDED

Git LFS Details

  • SHA256: 31a4b449569b8526bc57c4df9e7f39cc65b3e709b51aef016af59e262a63f11f
  • Pointer size: 131 Bytes
  • Size of remote file: 125 kB
output/dataset_100/videos/video_00025.gif ADDED

Git LFS Details

  • SHA256: 802fae82a38ae988d181de227f4328b7495389f78606cacf3462987b52b67a11
  • Pointer size: 131 Bytes
  • Size of remote file: 168 kB
output/dataset_100/videos/video_00026.gif ADDED

Git LFS Details

  • SHA256: 2917d06a76d4120ffe2c0f00442ebab456058424d30d007bc0aac56b6ad2fa64
  • Pointer size: 131 Bytes
  • Size of remote file: 157 kB
output/dataset_100/videos/video_00027.gif ADDED

Git LFS Details

  • SHA256: f24fbaeaf66889da6f16d6a46f82cf4d1b9b8b91f1a4fe6ae756d7898846af64
  • Pointer size: 131 Bytes
  • Size of remote file: 166 kB
output/dataset_100/videos/video_00028.gif ADDED

Git LFS Details

  • SHA256: 746065d75e5a215097fbbc029d1f7b3038be17450748cefc91f9e50fc9d31e9f
  • Pointer size: 131 Bytes
  • Size of remote file: 146 kB
output/dataset_100/videos/video_00029.gif ADDED

Git LFS Details

  • SHA256: 4eaf00a271d02cca2d0a10e0573abe6e2ea2441d707b14e5a5d4ce85ceab4ea9
  • Pointer size: 131 Bytes
  • Size of remote file: 165 kB
output/dataset_100/videos/video_00030.gif ADDED

Git LFS Details

  • SHA256: e1cecd76b692b8479505415e846c31160efe54d4e528d4b82a71fb7dd3781829
  • Pointer size: 131 Bytes
  • Size of remote file: 148 kB
output/dataset_100/videos/video_00031.gif ADDED

Git LFS Details

  • SHA256: 7ca826af0dd60b560ebd80a8d4cdb4f0337d603ce7ecd5065fd108f702958d07
  • Pointer size: 131 Bytes
  • Size of remote file: 157 kB
output/dataset_100/videos/video_00032.gif ADDED

Git LFS Details

  • SHA256: 47c85fb29c45fc88aa723d683d602a678c216dcd03c3a70960ace5230d5ca00e
  • Pointer size: 131 Bytes
  • Size of remote file: 141 kB
output/dataset_100/videos/video_00033.gif ADDED

Git LFS Details

  • SHA256: 324f51f6ad2a75bfedcf2c8e7e0563f903b783de0fbfc76cb758a313d90e6870
  • Pointer size: 131 Bytes
  • Size of remote file: 157 kB
output/dataset_100/videos/video_00034.gif ADDED

Git LFS Details

  • SHA256: f0b3d9191433e33c2c4a8b395dea04224688abc14d931b050c82dd8c437ef657
  • Pointer size: 131 Bytes
  • Size of remote file: 168 kB
output/dataset_100/videos/video_00035.gif ADDED

Git LFS Details

  • SHA256: abe5db42a84a5b952e332314759576159c701b5a8d357e498a2957fe20aba9da
  • Pointer size: 131 Bytes
  • Size of remote file: 156 kB
output/dataset_100/videos/video_00036.gif ADDED

Git LFS Details

  • SHA256: fc2a7af969e7f0b9997c84c5593cdaacb0233424b42a4f66941fb3a97fbf9dc9
  • Pointer size: 131 Bytes
  • Size of remote file: 144 kB
output/dataset_100/videos/video_00037.gif ADDED

Git LFS Details

  • SHA256: 440f45baede1369c6953a2aed62ab92f8e927654a301268d812da146e9facfe6
  • Pointer size: 131 Bytes
  • Size of remote file: 120 kB