Skip to content

Commit 051ac45

Browse files
bazilinskyyclaude
andcommitted
propose_segments: walks in any batch, by people close by or never standing still
A video that bobs like a walk (walk_near) and whose title names no drive is left out as probably a walk when a big person is close by in 15%+ of its frames (LfMGsG0GyyY, a market walk among motorbikes, and IDri46YanKg) or when, 8 min or longer at step_bob 0.5+, it never stands still a second (ZFJlelufPRA). Reviewed videos so judged: 3 + 55 rejected, none approved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 91608bb commit 051ac45

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

‎propose_segments.py‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,15 @@ def sheet_scores(sheet_path, scenes, prefix='', bottom=False):
382382
# 2026-11-05): of the reviewed videos of walk batches so judged, 15 rejected (272 min) and no approved one
383383
# (approved: 0.43 at most, but for a traffic jam in Mykolaiv at 0.57 with nobody close by)
384384
WALK_BATCH_BOB_NEAR, WALK_BATCH_HINT = 0.47, 0.5
385+
# ... and in any batch with a big person close by in WALK_NEAR_ALONE of the frames, the title naming no drive (a
386+
# market walk among motorbikes, so with traffic ahead: LfMGsG0GyyY of ppccityview at 38%; user, 2026-11-08): of the
387+
# reviewed videos so judged 3 rejected and no approved one (approved: 12% at most; 2 approved drives at 15%+ say
388+
# "Drive" in their titles)
389+
WALK_NEAR_ALONE = 0.15
390+
# ... or, at WALK_NEVER_BOB+ step_bob, never standing a second in a video of WALK_NEVER_MIN minutes or more, as a
391+
# walker in a crowd never stands while a car waits at lights (ZFJlelufPRA of wanderer_youtube; user, 2026-11-09):
392+
# of the reviewed videos so judged 55 rejected and no approved one (one 5-min approved clip never stood)
393+
WALK_NEVER_BOB, WALK_NEVER_MIN = 0.5, 8
385394
# ... and, batch or not, from WALK_SHEET_FEW frames on foot with that bob (user, 2026-10-30): of 408 reviewed videos
386395
# at step_bob 0.5-0.65, 14 walks or rejected and no approved one (2 frames alone: 6 approved)
387396
WALK_SHEET_FEW = 2
@@ -458,6 +467,15 @@ def walk_no_stop(sig, p=None):
458467
return max(stops, default=0) < NO_STOP_S
459468

460469

470+
def never_stands(sig, p=None):
471+
"""Whether a video bobs at WALK_NEVER_BOB+ and, WALK_NEVER_MIN minutes or longer, never stands a second."""
472+
p = p or PARAMS
473+
if float(sig.get('step_bob', 0)) < WALK_NEVER_BOB or len(sig.get('motion', [])) < WALK_NEVER_MIN * 60 * FPS:
474+
return False
475+
sm = _rolling_median(sig['motion'], p['smooth_s'] * FPS)
476+
return not any(b - a >= FPS for a, b in _runs(sm <= p['moving_flow']) if a > 0 and b < len(sm))
477+
478+
461479
BOB_EVERY_S = 45 # step_bob_track: one 15-s reading this often through the video
462480
# a camera on a bicycle's handlebar rolls side to side as the rider pedals and steers, a car's does not, however bumpy
463481
# the road (VzU9Sf-Y-Ac, -CNqMp219OE: robertlogger's bicycle rides, proposed as cars from the channel's history;
@@ -10127,6 +10145,21 @@ def has_signals(v):
1012710145
'exclude': f'probably a walk: {share[0]} of {share[1]} long videos of this batch were walks, '
1012810146
f"and it bobs like one ({float(sigs[v]['step_bob']):.0%} of its shake)"}
1012910147
touched.append(v)
10148+
for v, p in list(plan.items()): # any batch: a walk among people close by (WALK_NEAR_ALONE)
10149+
if ('entries' not in p or not undecided(p) or v not in sigs or gps_drive(sigs[v])
10150+
or MOVING_TITLE.search(title_text(p.get('title') or '')) or not walk_near(p, sigs[v])):
10151+
continue
10152+
wv = np.asarray(sigs[v].get('walk_view', np.zeros((0, 2)))).reshape(-1, 2)
10153+
near = len(wv) and wv[:, 0].mean() >= WALK_NEAR_ALONE
10154+
if not near and not never_stands(sigs[v]):
10155+
continue
10156+
why = (f'people close by in {wv[:, 0].mean():.0%} of the frames' if near
10157+
else 'it never stands still a second, as a car at lights does')
10158+
committed.setdefault(v, json.dumps(p, sort_keys=True)) # replaced only if nobody changed it since
10159+
plan[v] = {'video': v, 'title': p['title'], 'analysed': True,
10160+
'exclude': f"probably a walk: {why}, and it bobs like one ({float(sigs[v]['step_bob']):.0%} of "
10161+
'its shake)'}
10162+
touched.append(v)
1013010163
if (inset := batch_inset(plan, out_dir)): # the batch's inset, faint in its other videos (PIP_BATCH_N)
1013110164
for v, p in list(plan.items()):
1013210165
frames = sheet_frames(os.path.join(out_dir, f'{v}.jpg')) if 'entries' in p and undecided(p) else []

0 commit comments

Comments
 (0)