- cf_vision/models.py: ImageFrame + ImageElement + BoundingBox (MIT) Full Dolphin-v2 element taxonomy (21 types), convenience accessors (text_blocks, barcodes, tables, full_text) - cf_vision/router.py: VisionRouter — mock + real paths, task routing (document, barcode, receipt, general) - cf_vision/barcode.py: BarcodeScanner — pyzbar wrapper, CPU-only, MIT - cf_vision/ocr.py: DolphinOCR — ByteDance/Dolphin-v2 async stub (BSL 1.1) - cf_vision/receipt.py: ReceiptParser stub — Kiwi Phase 2 target (BSL 1.1) - cf_vision/camera.py: CameraCapture — OpenCV single-frame capture (MIT) - pyproject.toml: inference / barcode / camera optional extras - .env.example: HF_TOKEN, CF_VISION_DEVICE, CF_VISION_MOCK - README: module map, ImageFrame API reference, consumer roadmap - tests: 6 passing (ImageFrame accessors, VisionRouter mock/real) Extracted from circuitforge_core.vision per cf-core#36.
20 lines
1.3 KiB
Text
20 lines
1.3 KiB
Text
# cf-vision environment — copy to .env and fill in values
|
|
# cf-vision does not auto-load .env; consumers load it in their own startup.
|
|
|
|
# ── Dolphin-v2 document parser ────────────────────────────────────────────────
|
|
# HuggingFace model: ByteDance/Dolphin-v2
|
|
# Requires ~8GB VRAM. Download cached automatically on first use.
|
|
# Get a token at https://huggingface.co/settings/tokens
|
|
HF_TOKEN=
|
|
|
|
# ── Compute ───────────────────────────────────────────────────────────────────
|
|
# auto (detect GPU), cuda, cpu
|
|
CF_VISION_DEVICE=auto
|
|
|
|
# ── Mock mode ─────────────────────────────────────────────────────────────────
|
|
# Set to 1 to use synthetic ImageFrame responses — no GPU or camera required.
|
|
CF_VISION_MOCK=
|
|
|
|
# ── OCR confidence threshold ──────────────────────────────────────────────────
|
|
# Results below this are marked low-confidence in the ImageFrame output.
|
|
CF_VISION_CONFIDENCE_THRESHOLD=0.7
|