Python Code for Mango X-ray Sorting

Заказчик: AI | Опубликовано: 17.03.2026

I have a custom-built X-ray system dedicated to mango grading. The control electronics expose a Python API that streams 16-bit radiographic frames at conveyor speed and can fire an air-jet gate on command. What I need next is a production-ready program that • ingests each frame in real time, • detects spongy, internally damaged or otherwise bad fruit with high precision, and • sends the gate signal fast enough to remove the defect before the next fruit arrives. You are free to design the detection pipeline—classical CV with OpenCV or a small CNN in TensorFlow/PyTorch—as long as it runs on the on-board GPU (NVIDIA Jetson Xavier) and meets the timing budget of 60 ms per fruit. I will supply a labelled image set of good vs. spongy mangoes for training and a live video feed for validation. Deliverables 1. Well-commented Python source code ready to run on Ubuntu 20.04 (Jetson). 2. Model weights and training notebook (if deep learning is chosen). 3. Integration script that toggles the machine’s GPIO gate through the existing SDK. 4. A brief README explaining installation, calibration steps, and how to extend the defect classes in the future. Acceptance criteria • ≥95 % recall on the supplied test set, ≤2 % false-positive rate. • End-to-end latency from frame capture to gate signal ≤60 ms, verified with my high-speed logger. • Code passes pylint with a score ≥8.0 and runs inside a Docker container I provide. Once the above criteria are hit, I will run a 4-hour continuous line test; clearing that test triggers final sign-off and payment.