Skip to content

Commit 802d86c

Browse files
bazilinskyyclaude
andcommitted
Highway: a one-town video that by day is all highway, with no town in the picture, keeps its highway cuts
A video guessed as one town gets no rural or highway cuts (a quiet street of the town is no highway), so a motorway drive guessed as a town was proposed all through (1AJ5FIkNWA4, g4shf; user, 2026-11-25: "videos like this are just highway driving. detect them and skip"). When the street signal says highway for 95% of the minutes, by day, CLIP sees no town scene and the town is under METRO_POP, the full cuts stay. On reviewed videos: 372 min rejected cut (22 videos), 16 min approved lost (4); user approved the trade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2776065 commit 802d86c

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

‎propose_segments.py‎

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10213,6 +10213,28 @@ def locate_now(p, df, home, sig_path=None, meta=None, boilerplate=frozenset()):
1021310213
# city of METRO_POP or more, whose freeways are its own (user, 2026-11-16): there such cuts held 3.4 h approved and
1021410214
# 5.2 h rejected (31 videos: Los Angeles, New York, Philadelphia, Istanbul), in smaller towns 4.3 h and 42.9 h
1021510215
ONE_PLACE_HIGHWAY = {**PARAMS, 'quiet_min_s': 600}
10216+
# ... and a one-town video that by day is all highway, with no town in the picture, keeps every rural and highway
10217+
# cut: "Calais to Croatia by Car - ... - Italy - Venice West to Meolo" (1AJ5FIkNWA4, g4shf; user, 2026-11-25: "videos
10218+
# like this are just highway driving. detect them and skip"), guessed as Venice, was proposed all through. Of reviewed
10219+
# one-town videos whose street signal says highway this share of the time, by day, with CLIP seeing no town and in a
10220+
# town under METRO_POP, the reviewer rejected 739 min (33 videos) and approved 32 (5)
10221+
ALL_HIGHWAY_SHARE = 0.95
10222+
10223+
10224+
def all_highway(sig):
10225+
"""Whether a video by day is highway driving nearly all through (the street signal's minutes, ALL_HIGHWAY_SHARE)
10226+
with no town scene anywhere (TOWN_SCORE)."""
10227+
if 'street' not in sig or 'town_scene' not in sig or 'sky' not in sig:
10228+
return False
10229+
street = np.asarray(sig['street'], float)
10230+
town = np.asarray(sig['town_scene'], float).reshape(-1, 2)
10231+
if not len(street) or not len(town):
10232+
return False
10233+
k = max(1, 60 // URBAN_EVERY_S)
10234+
minute = np.convolve(street, np.ones(k) / k, mode='same')
10235+
return (np.mean(np.asarray(sig['sky']) >= PARAMS['yolo_day_sky']) >= 0.9
10236+
and np.mean(minute < PARAMS['street_objects']) >= ALL_HIGHWAY_SHARE
10237+
and not (town[:, 1] >= TOWN_SCORE).any())
1021610238

1021710239

1021810240
@lru_cache(maxsize=2)
@@ -10232,10 +10254,13 @@ def one_place_segments(p, sig_path):
1023210254
big = _populations(add_video._mtime_ns(add_video.FILE_PATH)).get(tuple(loc), 0) >= METRO_POP
1023310255
highway = bool(HIGHWAY_TITLE.search(title) or motorway_title(title)) and not big
1023410256
sig = load_signals(sig_path, title)
10235-
segments, notes = night_from_title(*propose(sig, ONE_PLACE_HIGHWAY if highway else ONE_PLACE), sig, title)
10257+
every = not big and all_highway(sig)
10258+
segments, notes = night_from_title(*propose(sig, PARAMS if every else ONE_PLACE_HIGHWAY if highway else ONE_PLACE),
10259+
sig, title)
1023610260
p['note'] = re.sub(r'; (?:rural|highway) driving \d+-\d+s', '', p.get('note') or '')
1023710261
if (kept := [n for n in notes if re.fullmatch(r'(?:rural|highway) driving \d+-\d+s', n)]):
10238-
p['note'] = f"{p['note']}; {'; '.join(kept)} (cut: 10+ min, a highway or road trip title)".lstrip('; ')
10262+
why = 'highway by day nearly all through, no town seen' if every else '10+ min, a highway or road trip title'
10263+
p['note'] = f"{p['note']}; {'; '.join(kept)} (cut: {why})".lstrip('; ')
1023910264
return segments
1024010265

1024110266

0 commit comments

Comments
 (0)