Reduce unnecessary match image rendering#319
Merged
Merged
Conversation
Change top-N from 20 to 12 to match Wildbook's RESMAX_DEFAULT, and filter out zero-score matches before rendering. This avoids rendering images that Wildbook will never display. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wildbook only requests heatmask images. The matches (SIFT feature overlay) and clean render types were never displayed. Removing them cuts per-job rendering from 3 images to 1 per match annotation, reducing a 200-job bulk import from ~100 minutes to ~33 minutes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of synchronously rendering heatmask images for every match before returning the job result, defer rendering to the /match/thumb/ endpoint. When a user clicks "inspect" in Wildbook, the endpoint renders the side-by-side chip image on first request and caches it for subsequent requests. This decouples image rendering from the identification pipeline, allowing the callback to Wildbook to fire immediately after inference completes instead of blocking for 30-90s of image I/O. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The zero-score filter could empty the candidate list on queries with no positive matches, causing downstream assertion failures. Fall back to the single best-ranked result so Wildbook always has at least one candidate to display. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HotSpotter's yellow heatmask overlay requires the ChipMatch spatial data which is only available during query_chips_graph. Render synchronously for HotSpotter (proot=vsmany) to preserve the overlay. MiewID, PIE, and other algorithms continue to use on-demand rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RESMAX_DEFAULT = 12— no point rendering images Wildbook never displaysContext
Wildbook's
iaResults.jsponly requests up to 12 results and only fetches theheatmaskversion. WBIA was rendering 3 image types × 20 annotations = up to 60 images per query, when at most 12 are ever used.Test plan
_ibsdb/_wbia_cache/directory)🤖 Generated with Claude Code