feat(megadetector): add MegaDetector v6 as a standalone model choice - #544
Merged
Merged
Conversation
…ll, rejected by Zod)
…al' tags don't slip through
✅ Deploy Preview for lucent-yeot-0cb408 canceled.
|
Previously the early-return 'if (scientificName) return animal' in mapObservationType shadowed MegaDetector's 'homo sapiens' and 'vehicle' scientificName labels, exporting both as 'animal' instead of the correct Camtrap DP 'human' and 'vehicle' values. Extract mapObservationType into a pure module so the MD-specific routing can be unit-tested without transitively loading download.ts.
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
Adds MegaDetector v6 (
MDV6-yolov10-e-1280) as a fourth model in Biowatch's AI Models tab. MD is a fast worldwide detector for animals / people / vehicles — no species classification — useful as a blank-filter before manual species annotation. The three MD labels flow through Biowatch's species-centric data model as pseudo-species (animal,homo sapiensfor person,vehicle).Architecture
run_megadetector_server.pymodeled onrun_deepfaune_server.pyminus the classifier. Loads weights viaultralytics.YOLO.huggingface.co/earthtoolsmaker/megadetector/main/6.0.tar.gz(117.8 MB), built byscripts/build-megadetector-tarball.pyfrom the Zenodo-hosted upstream weights.detectionOnly: trueflag inmlmodels.jsthat suppresses the species panel inModelCard.jsxand the model-picker dropdown.megadetectorbranch added toparseScientificName,transformBboxToCamtrapDP, anddetectModelType. Common-names resolver gets amegadetectorsource soanimal/person/vehicleresolve cleanly; thepersonlabel is mapped to the binomialhomo sapiensat the server so species tooltips and IUCN lookups fire.Bonus fixes (caught during manual smoke)
get_video_metadatanow sanity-checks fps/frame_count/duration so the entire-file error pipeline catches corrupt files instead of letting one garbage frame surface as "animal".classificationProbabilitynow mirrors its owndetectionConfidenceinstead of the top-level prediction score being copied across every row.weightedVotemode inselectVideoClassificationWinneruses mean-confidence-primary voting (frame-count tiebreaker) for MD videos, so a short burst of high-confidence "person" detections isn't drowned out by a longer stream of weak "animal" detections. Classifier behavior (SpeciesNet/DeepFaune/Manas) is unchanged.Design + plan docs
docs/specs/2026-05-16-megadetector-model-choice-design.mddocs/plans/2026-05-16-megadetector-model-choice-plan.mdTest plan
Notes