Skip to content

fix(curation): say why a region yields no frame, and pin the Ukrainian zones - #101

Merged
amtiYo merged 2 commits into
devfrom
fix/ua-candidates
Nov 23, 2026
Merged

amtiYo merged 2 commits into
devfrom
fix/ua-candidates

Conversation

@amtiYo

@amtiYo amtiYo commented Nov 23, 2026

Copy link
Copy Markdown
Member

Refs #45. The cause is narrowed to harvest.py's tile and frame filters, but it is not named: that needs one run with a Mapillary token. This PR makes that run name it. The issue stays open.

Cause (what is established)

  • Not the plan. pool.allowed("UA", …) takes Kyiv, Lviv, Odesa, Vinnytsia, Uzhhorod, Chernivtsi, Ivano-Frankivsk, Zhytomyr, Rivne and Cherkasy, and leaves out Kharkiv, Zaporizhzhia, Kherson, Mariupol, Donetsk, Luhansk, Sumy and Crimea. Ukraine is in the borders under UA, so country_of agrees. About 54% of the country's area passes.
  • Not the weights. UA weighs 3; the plans of batch-003, batch-004, batch-free-001 and batch-free-002 name 34 Ukrainian regions (7 big cities twice, towns, roads).
  • The loss is in the harvest. Of those 34, one became a candidate (Karashyna, a town). The other countries average about 75%; Russia is next at 9 of 33. batch-002 (the built-in list) harvested none of its 8 Ukrainian cities. The daily pool has no place from Ukraine because there was no candidate to approve; batch-free-001's one frame went into the free pool.
  • Town anchors lie on a Mapillary panorama sequence of 2018 or later, so a tile with coverage existed in most of those cases. What dropped the frame is one of: the quality score (>= 0.7), a town's 40 nearest frames holding no panorama (a dashcam town), the 2048 px width, the sharpness bar, or a frame that did not load. Which one cannot be told offline.

Fix

  • harvest.py counts each pass over a tile or a frame by step, per country of the plan (per region for the built-in list), prints the table at the end and writes <out>/rejects.json.
  • scripts/curation/test_curation.py (new, no network, no token): the Ukrainian west and centre are planned in; the front line, occupied land and Crimea stay out; random points of random_in stay in Ukraine and in the kept zone; each rejection reason is counted as intended.
  • No filter, zone or weight changed.

Verified

  • python -m unittest scripts/curation/test_curation.py: 8 tests pass (shapely 2.0.7, mapbox-vector-tile, pillow).
  • harvest.main() run on a two-entry Ukrainian plan against a faked tile: prints UA: panoramas, none at quality 0.7 24 and writes rejects.json.
  • No live Mapillary call, no production database, no ws04.

Next

Run MAPILLARY_TOKEN=… MAPLY_POOL=<plan with UA> python scripts/curation/harvest.py <out> (for example MAPLY_COUNTRIES=UA python scripts/curation/pool.py plan.json 10 30 30 first) and read rejects.json. The step with the most passes for UA is the cause; the fix follows from it.

…n zones

Issue #45: the daily pool holds no place from Ukraine. Offline, the plan is
not the cause. pool.py's UA zone takes Kyiv, Lviv, Odesa, Vinnytsia,
Uzhhorod and Chernivtsi and leaves out Kharkiv, Zaporizhzhia, Kherson, the
Donbas and Crimea, and Ukraine is in the borders under "UA". The plans of
batch-003, batch-004 and the two free batches name 34 Ukrainian regions, and
harvest.py took a frame from one; the other countries average about 75%.
Russia is next, 9 of 33. batch-002 harvested none of its 8 Ukrainian cities.

So the frames are lost inside harvest.py's tile and frame filters, and which
one cannot be told without a Mapillary token: the quality score, the 2048 px
width, the sharpness bar, the 40 nearest frames of a town, or a tile that
holds no panorama. harvest.py now counts every pass over a tile or a frame by
step, per country of the plan, prints the table and writes rejects.json, so
one run with the token names the step.

test_curation.py checks offline, with no network, that the west and the
centre of Ukraine are planned in and the front line, the occupied land and
Crimea stay out, and that each reason is counted as it should be.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@amtiYo

amtiYo commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Ran this against the real API: the counts pin it down, see #45 — Mapillary returns no thumbnail URLs for any frame in Ukraine. The diagnostics here did their job; the PR stays useful as is.

@amtiYo
amtiYo merged commit f18edea into dev Nov 23, 2026
8 checks passed
amtiYo added a commit that referenced this pull request Nov 23, 2026
#103 let Kharkiv itself into the zone after #101's test listed it as
left out. The test now plans Kharkiv in and keeps Kupiansk and Chuhuiv,
its region towards the front, out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant