How bhagat2678/coffee-bean works
Coffee Bean Detection & Analysis is an image-based bean inspection product, exposed primarily through a Flask web app. Users provide front and optionally back images (and sample weight); the app detects and measures objects, derives quality and size results, and optionally matches beans across views before returning results for display. A CLI provides a separate single-image analysis route. The README documents calibration, color analysis, defect classification, and ArcFace mapping; excerpts do not show every implementation detail, so uncertain internal wiring is omitted.
Main entry points: app.py Flask analysis API · main.py Single-image CLI · app.js Upload and results UI · detector.py Object detection
Components 11
User Interfaces
- Upload and results UI
website/static/js/app.js - Flask analysis API
website/app.py - Single-image CLI
main.py
Image Analysis
- Object detection
src/detector.py - YOLO model weights
models/best.pt - Color and size analysis
src/analyzer.py - Bean shape metrics
src/shape_analyzer.py
Quality Analysis
- Grade and size statistics
src/grading.py
Bean Matching
- Front-back matching
src/arcface.py
Other components
- Coffee analyst
- Analysis results
Connections 12
- Coffee analyst → Upload and results UI: uploads images
- Upload and results UI → Flask analysis API: submits analysis
- Flask analysis API → Object detection: detects objects
- Object detection → YOLO model weights: loads weights
- Flask analysis API → Grade and size statistics: computes grades
- Flask analysis API → Front-back matching: matches views
- Flask analysis API → Analysis results: returns analysis
- Analysis results → Upload and results UI: renders results
- Coffee analyst → Single-image CLI: selects image
- Single-image CLI → Color and size analysis: analyzes image
- Color and size analysis → Object detection: detects beans
- Single-image CLI → Analysis results: prints summary