feat(inventory): photo-first drafts + on-device OCR (digitization R2+R4)
Lower the bulk-digitization cliff with two more routes on top of the already-landed CSV import and "save and add another": - Photo-first drafts (capture now, catalogue later): burst-capture photos (camera or multi-gallery) into unnamed draft varieties, shown in a "to catalogue" tray, hidden from the main list until named. Adds Variety.isDraft (schema), addDraftVariety/watchDrafts/nameDraft, the triage sheet and the inventory banner. - On-device OCR label suggestion (Tesseract, offline, no Google): a "Suggest name from photo" button in the naming dialog behind a LabelTextExtractor interface (Tesseract on Android/iOS, no-op elsewhere). Reads the largest print via hOCR bounding boxes, drops boilerplate/low-confidence noise, preprocesses (grayscale, contrast, upscale) and sweeps rotations (0-315 deg) so tilted packets still read. Bundles tessdata_fast eng+spa; validated on-device against real packets. The photo is written to a temp file deleted immediately in a finally block (the plugin needs a path) - a bounded, documented exception to no-plaintext-at-rest. This commit also carries the co-developed schema evolution v5 to v8 that shares these files (organic flag, species viability years, crop calendar, lot provenance/abundance/preservation format, condition checks) plus their exports/migrations and i18n. Tests: CSV/draft/OCR unit + widget + migration green in isolation. Note: the full widget suite currently hangs (>10 min) - under investigation.
This commit is contained in:
parent
12a2ee2d64
commit
6809dc6143
89 changed files with 17141 additions and 228 deletions
|
|
@ -44,6 +44,12 @@ dependencies:
|
|||
# Routing + media + paths.
|
||||
go_router: ^14.6.2
|
||||
image_picker: ^1.1.2
|
||||
# On-device OCR (Tesseract, Apache-2.0/BSD) to suggest a name from a packet
|
||||
# photo. Offline, no Google/cloud. Mobile-only; other platforms use a no-op.
|
||||
flutter_tesseract_ocr: ^0.4.31
|
||||
# Pure-Dart image preprocessing (grayscale/contrast/upscale) before OCR to
|
||||
# lift accuracy on blurry packet photos.
|
||||
image: ^4.3.0
|
||||
# Save/open dialogs for the inventory export/import (MIT license).
|
||||
file_picker: ^10.1.2
|
||||
path: ^1.9.0
|
||||
|
|
@ -82,6 +88,10 @@ flutter_launcher_icons:
|
|||
image_path: assets/icon.png
|
||||
background_color: "#2F7D34"
|
||||
theme_color: "#2F7D34"
|
||||
windows:
|
||||
generate: true
|
||||
image_path: assets/icon.png
|
||||
icon_size: 256
|
||||
|
||||
# Native splash: white sprout on brand green, a darker green in dark mode.
|
||||
# Regenerate with: dart run flutter_native_splash:create
|
||||
|
|
@ -102,6 +112,13 @@ flutter:
|
|||
- assets/logo.png
|
||||
# Bundled so the Linux runner can use it as the GTK window icon.
|
||||
- assets/icon.png
|
||||
# Tesseract OCR language data (tessdata_fast: eng + spa). Bundled for
|
||||
# offline, on-device label OCR on mobile.
|
||||
- assets/tessdata/
|
||||
- assets/tessdata_config.json
|
||||
# Real packet photos for the on-device OCR validation integration test.
|
||||
# Remove before shipping if you don't want them in the bundle.
|
||||
- assets/ocr_fixtures/
|
||||
fonts:
|
||||
# Custom seed-themed icon glyphs (chars a–k). See docs/mockups/seedks-glyphs.png.
|
||||
- family: seedks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue