Computer vision service for capturing produce weight from scale images.
- Install dependencies:
pip install -r requirements.txt- Start the server:
python app.py- Test the weight capture:
http://localhost:8001/test_weight_capture.html
- Produce Detection: Detects produce items (apples, oranges, broccoli, etc.) using YOLOv8
- Weight Capture: Extracts weight from scale images via OCR
- Creao Integration: Ready to log captured weights to your Creao database
POST http://localhost:8001/api/v1/capture/weight
Request Body:
{
"farmer_id": "farmer123",
"produce_name": "apples",
"image_base64": "<base64 encoded image>"
}Response:
{
"status": "success",
"farmer_id": "farmer123",
"produce_name": "apples",
"weight_data": {
"weight": 5.2,
"unit": "kg",
"confidence": 0.95
},
"message": "Weight 5.2 kg captured!",
"creao_logged": false
}ws://localhost:8001/ws/stream
http://localhost:8001/test_weight_capture.html- Weight capture testhttp://localhost:8001/webcam_client.html- Produce detection demo
- Install EasyOCR or Tesseract
- Implement actual OCR for scale display
- Add scale display detection using edge detection
- Get Creao API endpoint documentation
- Implement
log_to_creao()function - Add authentication (API key/token)
- Test data flow: Camera → API → Creao DB
- Add "Capture Weight" button to Creao mobile app
- Implement camera capture on mobile
- Add real-time feedback to farmer
app.py- FastAPI server with weight capture endpointtest_weight_capture.html- Weight capture test clientwebcam_client.html- Produce detection demorequirements.txt- Python dependencies