feat: add plantguide identify batch command (Fixes #3) - #425
Open
ghzhost wants to merge 1 commit into
Open
Conversation
Implements the [25 MRG] CLI batch identify bounty. - New `identify batch` command scans a directory of JPG/PNG photos, runs identify_from_image on each, and writes a JSON summary to --out. - Options: --photos (dir), --out (default data/out/batch.json), -k/--top, --no-care to skip care cards. - Summary JSON has keys: total, identified, results (list with file, top1_species_id, top1_score, top1_name, matches, optional care). - Exits with code 1 when no photos are found in the directory. - 4 new tests in tests/test_identify_batch.py (runs, top1_hits, no_care, empty_dir); all pass. Fixes mergeos-bounties#3
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
Implements the [25 MRG] CLI batch identify bounty (#3).
What this PR adds
plantguide identify batch --photos <dir> --out <file>— scans a directory of JPG/PNG photos, runsidentify_from_imageon each, and writes a JSON summary report.--photos / -p— directory of plant photos (required)--out / -o— output path (default:data/out/batch.json)-k / --top— top-k results per photo (default 1)--no-care— skip care cards in output{ "total": 6, "identified": 6, "results": [ { "file": "...", "top1_species_id": "monstera_deliciosa", "top1_score": 0.9, "top1_name": "Monstera", "matches": [...], "care": {...} } ] }Tests
4 new tests in
tests/test_identify_batch.py:test_identify_batch_runs— command runs and writes valid JSONtest_identify_batch_top1_hits— each result hastop1_species_idtest_identify_batch_no_care—--no-careomits care cardstest_identify_batch_empty_dir— exits with non-zero on empty dirAll 4 pass. Verified against bundled demo photos (6/6 identified).
Sample run
Fixes #3