ReactWindowDataset: default min_motion_fraction 0.5 -> 0.25 (a window passes if >=25 % of frames per active sensor are above the speed threshold).
Browse files- examples/README.md +2 -2
- examples/demo_react_window.py +1 -1
- examples/react_window_dataset.py +4 -4
examples/README.md
CHANGED
|
@@ -51,7 +51,7 @@ ds = ReactWindowDataset(
|
|
| 51 |
# (4) — motion content (recommended for dynamics learning)
|
| 52 |
require_motion = True,
|
| 53 |
min_motion_mps = 0.01, # 10 mm/s
|
| 54 |
-
min_motion_fraction = 0.
|
| 55 |
which_sensors_must_move = "all_active",
|
| 56 |
)
|
| 57 |
loader = DataLoader(ds, batch_size=8, shuffle=True, num_workers=2)
|
|
@@ -97,7 +97,7 @@ moving_R = np.concatenate([[speed_R[0]], speed_R]) >= 0.01
|
|
| 97 |
def good(t, L):
|
| 98 |
if mask[t:t + L].any():
|
| 99 |
return False
|
| 100 |
-
return moving_L[t:t + L].mean() >= 0.
|
| 101 |
```
|
| 102 |
|
| 103 |
## Coordinates note
|
|
|
|
| 51 |
# (4) — motion content (recommended for dynamics learning)
|
| 52 |
require_motion = True,
|
| 53 |
min_motion_mps = 0.01, # 10 mm/s
|
| 54 |
+
min_motion_fraction = 0.25,
|
| 55 |
which_sensors_must_move = "all_active",
|
| 56 |
)
|
| 57 |
loader = DataLoader(ds, batch_size=8, shuffle=True, num_workers=2)
|
|
|
|
| 97 |
def good(t, L):
|
| 98 |
if mask[t:t + L].any():
|
| 99 |
return False
|
| 100 |
+
return moving_L[t:t + L].mean() >= 0.25 and moving_R[t:t + L].mean() >= 0.25
|
| 101 |
```
|
| 102 |
|
| 103 |
## Coordinates note
|
examples/demo_react_window.py
CHANGED
|
@@ -139,7 +139,7 @@ def main():
|
|
| 139 |
respect_active_sensors = True,
|
| 140 |
require_motion = not args.no_motion_filter,
|
| 141 |
min_motion_mps = 0.01,
|
| 142 |
-
min_motion_fraction = 0.
|
| 143 |
which_sensors_must_move = "all_active",
|
| 144 |
)
|
| 145 |
|
|
|
|
| 139 |
respect_active_sensors = True,
|
| 140 |
require_motion = not args.no_motion_filter,
|
| 141 |
min_motion_mps = 0.01,
|
| 142 |
+
min_motion_fraction = 0.25,
|
| 143 |
which_sensors_must_move = "all_active",
|
| 144 |
)
|
| 145 |
|
examples/react_window_dataset.py
CHANGED
|
@@ -67,7 +67,7 @@ ds = ReactWindowDataset(
|
|
| 67 |
# motion filter (recommended on for dynamics learning)
|
| 68 |
require_motion = True,
|
| 69 |
min_motion_mps = 0.01, # 10 mm/s — below typical slow manipulation
|
| 70 |
-
min_motion_fraction = 0.
|
| 71 |
which_sensors_must_move = "all_active",
|
| 72 |
)
|
| 73 |
loader = DataLoader(ds, batch_size=8, shuffle=True, num_workers=2)
|
|
@@ -151,7 +151,7 @@ class ReactWindowDataset(Dataset):
|
|
| 151 |
min_motion_mps : float, default 0.03
|
| 152 |
Per-frame translation speed (in m/s) above which a frame counts as
|
| 153 |
"moving" for a given sensor.
|
| 154 |
-
min_motion_fraction : float in [0, 1], default 0.
|
| 155 |
An active sensor passes the motion filter if ≥ this fraction of
|
| 156 |
the window's frames have speed ≥ `min_motion_mps`.
|
| 157 |
which_sensors_must_move : {"any", "all_active"}, default "all_active"
|
|
@@ -185,7 +185,7 @@ class ReactWindowDataset(Dataset):
|
|
| 185 |
respect_active_sensors: bool = True,
|
| 186 |
require_motion: bool = False,
|
| 187 |
min_motion_mps: float = 0.01,
|
| 188 |
-
min_motion_fraction: float = 0.
|
| 189 |
which_sensors_must_move: str = "all_active",
|
| 190 |
fps: float = 30.0,
|
| 191 |
):
|
|
@@ -385,7 +385,7 @@ if __name__ == "__main__":
|
|
| 385 |
ap.add_argument("--which_sensors", default="any", choices=["any", "both", "left", "right"])
|
| 386 |
ap.add_argument("--require_motion", action="store_true")
|
| 387 |
ap.add_argument("--min_motion_mps", type=float, default=0.01)
|
| 388 |
-
ap.add_argument("--min_motion_fraction", type=float, default=0.
|
| 389 |
ap.add_argument("--which_sensors_must_move", default="all_active",
|
| 390 |
choices=["any", "all_active"])
|
| 391 |
args = ap.parse_args()
|
|
|
|
| 67 |
# motion filter (recommended on for dynamics learning)
|
| 68 |
require_motion = True,
|
| 69 |
min_motion_mps = 0.01, # 10 mm/s — below typical slow manipulation
|
| 70 |
+
min_motion_fraction = 0.25,
|
| 71 |
which_sensors_must_move = "all_active",
|
| 72 |
)
|
| 73 |
loader = DataLoader(ds, batch_size=8, shuffle=True, num_workers=2)
|
|
|
|
| 151 |
min_motion_mps : float, default 0.03
|
| 152 |
Per-frame translation speed (in m/s) above which a frame counts as
|
| 153 |
"moving" for a given sensor.
|
| 154 |
+
min_motion_fraction : float in [0, 1], default 0.25
|
| 155 |
An active sensor passes the motion filter if ≥ this fraction of
|
| 156 |
the window's frames have speed ≥ `min_motion_mps`.
|
| 157 |
which_sensors_must_move : {"any", "all_active"}, default "all_active"
|
|
|
|
| 185 |
respect_active_sensors: bool = True,
|
| 186 |
require_motion: bool = False,
|
| 187 |
min_motion_mps: float = 0.01,
|
| 188 |
+
min_motion_fraction: float = 0.25,
|
| 189 |
which_sensors_must_move: str = "all_active",
|
| 190 |
fps: float = 30.0,
|
| 191 |
):
|
|
|
|
| 385 |
ap.add_argument("--which_sensors", default="any", choices=["any", "both", "left", "right"])
|
| 386 |
ap.add_argument("--require_motion", action="store_true")
|
| 387 |
ap.add_argument("--min_motion_mps", type=float, default=0.01)
|
| 388 |
+
ap.add_argument("--min_motion_fraction", type=float, default=0.25)
|
| 389 |
ap.add_argument("--which_sensors_must_move", default="all_active",
|
| 390 |
choices=["any", "all_active"])
|
| 391 |
args = ap.parse_args()
|