Skip to content

feat: add plantguide identify batch command (Fixes #3) - #425

Open
ghzhost wants to merge 1 commit into
mergeos-bounties:masterfrom
ghzhost:feat/identify-batch-3
Open

feat: add plantguide identify batch command (Fixes #3)#425
ghzhost wants to merge 1 commit into
mergeos-bounties:masterfrom
ghzhost:feat/identify-batch-3

Conversation

@ghzhost

@ghzhost ghzhost commented Sep 9, 2026

Copy link
Copy Markdown

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, runs identify_from_image on each, and writes a JSON summary report.
  • Options:
    • --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
  • Output JSON schema:
    {
      "total": 6,
      "identified": 6,
      "results": [
        { "file": "...", "top1_species_id": "monstera_deliciosa", "top1_score": 0.9, "top1_name": "Monstera", "matches": [...], "care": {...} }
      ]
    }
  • Exits with code 1 when no JPG/PNG photos are found.

Tests

4 new tests in tests/test_identify_batch.py:

  • test_identify_batch_runs — command runs and writes valid JSON
  • test_identify_batch_top1_hits — each result has top1_species_id
  • test_identify_batch_no_care--no-care omits care cards
  • test_identify_batch_empty_dir — exits with non-zero on empty dir

All 4 pass. Verified against bundled demo photos (6/6 identified).

Sample run

$ plantguide identify batch --photos data/samples/photos --out data/out/batch.json
Batch done: 6/6 identified → data/out/batch.json

Fixes #3

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[25 MRG] CLI: plantguide identify batch — score all samples to report

1 participant