Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add the research code for training and comparing small single-subject detectors that find the butterfly in a photo, so that a species classifier can crop to it. The work compares YOLOv11s, YOLO26-s/n, RT-DETR-l, DEIMv2-S and SAHI tiling on a training set built from Fieldguide photos with user-drawn crop boxes, and evaluates on the public Leeds Butterfly dataset. What is included: - research/leps_localizer/: training, evaluation, export and comparison scripts, the methods and results write-up with a per-run results table, a guide for embedding the browser build in a photo upload flow, and a static browser demo. - src/localization/: an index reader for the training data, deterministic train/val repartitioning, YOLO dataset materialization, held-out evaluation, and best-of-N and containment metrics added to metrics.py. - tests/localization/: unit tests for the modules above. - pyproject.toml: new optional extras `detection`, `demo` and `export-edge`, plus flake8 per-file ignores for the new scripts; uv.lock regenerated. This commit replaces the earlier feat/leps-localizer-training branch. That branch carried internal infrastructure details (machine names, local and mounted paths, storage and warehouse names, private repository references, and session notes) and a data index of individual photo records. Those are removed here: paths are now command-line arguments or environment variables (DATA_ROOT, RUNS_DIR, DETECTOR_DATASET_ROOT, CLASSIFIER_MODELS_DIR), the Weights & Biases entity comes only from WANDB_ENTITY, and the bulk annotation scripts and internal schemas are left out. Unrelated changes that the earlier branch had merged in from other branches are not part of this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Sju2W91WevdNkZhTEGyqN
mihow
force-pushed
the
feat/leps-localizer-training
branch
from
October 14, 2026 20:07
efd64f2 to
0e37df3
Compare
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
Species classifiers do better when they see the butterfly rather than the whole photo. This PR adds the research code we used to train and compare small detectors that find the butterfly in a hand-held photo, so an upload flow or a classifier can crop to it. It compares YOLOv11s, YOLO26-s and -n, RT-DETR-l, DEIMv2-S and SAHI tiling, trained on Fieldguide photos with user-drawn crop boxes and evaluated on the public Leeds Butterfly dataset. The shared pieces (data reading, splitting, evaluation metrics) go in
src/localization/next to the existing Faster R-CNN tools; the experiment scripts and write-up go inresearch/leps_localizer/.The branch was rewritten into a single commit on current
main. Paths and service names are now command-line arguments or environment variables, so the scripts run on any machine.List of Changes
research/leps_localizer/research/leps_localizer/demo/,EBUTTERFLY_INTEGRATION.mdsrc/localization/leps_data.py,repartition.py,prepare_yolo.py,eval_locked.pysrc/localization/metrics.pytests/localization/detection,demoandexport-edge, so the base install stays lightpyproject.toml,uv.lockConfiguration comes from
DATA_ROOT,RUNS_DIR,DETECTOR_DATASET_ROOT,CLASSIFIER_MODELS_DIRand, for Weights & Biases,WANDB_ENTITY.Not included
Training images and the photo index are not part of the repository. The insect detector for light-trap photos (AnyBug) will follow in a separate PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_014Sju2W91WevdNkZhTEGyqN