pip install -e ".[dev]"
pytest # full suite
retrace --help # CLI entry point
retrace scan tests/fixtures/sample.jpg # quick smoke testPython package (src/retrace/) with Click CLI. Pipeline-based: ingest -> detect -> OCR -> trace -> identify -> analyze -> export.
cli.py— Click CLI: scan, search, trace, advise, ui, reportcore/pipeline.py— Main orchestrator: loads image, runs all phases, returns AnalysisResultcore/config.py— TOML config, model paths, cache dirsdetection/detector.py— YOLO v8 component detection (graceful fallback to OpenCV contours)detection/trace_extractor.py— OpenCV copper trace pipeline (HSV/LAB segmentation, skeletonization, BFS)detection/ocr.py— EasyOCR chip marking extractionidentification/matcher.py— Fuzzy part number matching against local component DBanalysis/probe_advisor.py— Bayesian optimal probe selection via Shannon entropyanalysis/constraint_solver.py— Arc-consistency constraint propagation for missing connectionsanalysis/cross_board.py— Cross-board pattern recognition and knowledge transfersources/fcc.py— FCC filing scraper (fcc.report, public domain)sources/ifixit.py— iFixit API v2.0 client (CC BY-NC-SA images)learning/engine.py— Cross-board knowledge flywheelplugins/base.py— Plugin protocol + entry-point discoveryplugins/builtin/debug_interfaces.py— JTAG/UART/SWD/SPI header detectionexport/bom.py— BOM generator (JSON, CSV)export/svg.py— SVG annotated image output
Component— detected component with bbox, label, marking, part_numberTrace— extracted copper trace with point list and connectivityAnalysisResult— full pipeline output with components, traces, and metadata
- Optional ML deps: ultralytics, easyocr, gradio are all optional — core works with just numpy + opencv
- FCC/iFixit requests must include 1s delay between calls
- No firmware files, exploit code, or vulnerability research in this repo
- Models auto-download on first use to ~/.cache/retrace/
- Plugin system uses Python entry points for discovery