Tasks/Computer Vision/Remote Sensing

Repair a Missing Local Road Connection

Reconnect broken road graphs from aerial evidence

aerial_road_connection_repair Computer Vision Remote Sensing
instruction.mdthis is what the agent is given

You inherit a weak geometric road-connection solver for small aerial-image crops. Improve /app/methods/main/solver.py to produce a reusable missing-connection polyline from the supplied public evidence, maximizing the visible score without overfitting the cases. The verifier reruns the final method on disjoint sealed hidden crops for scoring.

Hard Constraints

  • Keep the public entry point predict(public) -> dict in /app/methods/main/solver.py. Put all submitted logic in that one file; do not import sibling submission files.
  • public contains exactly seven NumPy arrays: rgb, road_logit_q, old_vertices_xy, old_polyline_offsets, anchors_xy, pixel_to_local_m, and roi_size. Treat every field as an ordinary per-case observation; do not rely on file names, order, or mutable global state.
  • Return exactly {"vertices_xy", "polyline_offsets"}. vertices_xy must be a C-contiguous finite float32[V,2] array with 2 to 128 vertices, and polyline_offsets must be a C-contiguous int32[2] array equal to [0, V].
  • Keep every predicted vertex inside the image ROI. The first and last vertices must attach to the two supplied anchors within one local metre, in either orientation; the output must be one non-self-intersecting polyline of bounded length.
  • The method must be deterministic, self-contained, and general. It may use the installed packages and the seven public arrays, but may not download data, invoke external services, encode per-case answers, or depend on hidden files, labels, source identifiers, or a call-order cache.
  • The sealed evaluator executes each case in a fresh restricted process and may repeat cases to check determinism. Keep the method comfortably within the task resource budget.

What You Have

  • /app/methods/main/solver.py: a valid starter implementation to inspect and improve.
  • /app/data/visible/public/*.npz: nine visible public-evidence cases. Each archive has the seven arrays accepted by predict; road_logit_q is quantized road-likelihood evidence aligned with the RGB crop.
  • python /app/selfcheck.py: a read-only visible evaluator that checks the callable contract and reports an aggregate raw visible score. It does not reveal sealed cases or scoring anchors.
  • NumPy and SciPy, plus /app/experiment_log.md for recording substantive experiments.

What You Submit

Leave your best final reusable implementation in /app/methods/main/solver.py and record the main experiments in /app/experiment_log.md. Harbor imports predict(public) directly for every case; do not submit precomputed prediction archives or change the function's public interface.

How It Is Judged

For each crop, the returned line is compared with one sealed target connection in the crop's local-metre coordinate frame. The reported raw metric is a length-weighted symmetric polyline F1: both lines are sampled at one-metre spacing and samples within four metres of the other line count as matched. The sealed score gives equal aggregate weight to two connection-geometry regimes, so neither near-direct nor longer-detour cases dominates. Higher is better; a malformed, missing, nondeterministic, or timed-out submission fails closed, and only the final submitted method is evaluated on sealed data.

Common Pitfalls

  • Treating image-row and image-column differences as physical metres instead of using pixel_to_local_m.
  • Following a high roadness band that belongs to the supplied old graph instead of finding the missing connector.
  • Returning a helpful-looking route with too many vertices, the wrong dtypes, an endpoint that misses an anchor, or a self-intersection.
  • Tuning a case-specific curve rather than a robust decoder that transfers to a new crop.
  • Making a search grid so dense or a solver so stateful that repeated restricted evaluation becomes slow or nondeterministic.