pick_weather_clips.py
Tested 2026-11-30 · Python 3.15.2 · standard library only
# Group the weather sample's real clips by condition and light, to pick a test set.
# usage: python pick_weather_clips.py roaddata-weather-library
import json, sys
from collections import defaultdict
d = json.load(open(f"{sys.argv[1]}/labels.json"))
groups = defaultdict(list)
for clip in d["real"]:
groups[(clip["kind"], clip["light"])].append(clip["id"])
for (kind, light), ids in sorted(groups.items()):
print(f"{kind:<10} {light:<9} {' '.join(ids)}")
first = d["real"][0]
print("\n", first["id"], "|", first["condition"], "|", first["place"], "|", first["archive"])python pick_weather_clips.py roaddata-weather-library
What it printed when we ran it
fog daytime wx_21
low_sun daytime wx_22 wx_23 wx_24 wx_25
rain daytime wx_11 wx_14 wx_15 wx_16 wx_19 wx_20
rain night wx_12 wx_18
...
wx_01 | falling snow | South End, Boston, MA | Weather archive: 2.3 cm of snow in the 24 h before, 29 cm on the ground