A computer vision-based X-ray object detection app prototype that identifies potentially dangerous items in X-ray scans. Built with a YOLOv11 custom-trained model and powered by a Python-based backend (Flask) and frontend (Streamlit).
- ✅ Real-time object detection on X-ray images
- 🧠 Custom-trained YOLOv11 model
- 📊 Detection confidence & status reports
- 📸 Annotated output images with bounding boxes
- 🗃️ Upload your own image or use sample images
- 💾 Export detection logs as CSV
- User uploads or selects an image through the Streamlit frontend.
- Image is sent to the Flask API endpoint at
/predict
. - The YOLOv11 model performs inference on the image.
- The API returns detected object data and the annotated image.
- The frontend displays the detection results and allows CSV export of the detected objects.
- Model: YOLOv11 (by Ultralytics)
- Backend: Flask (for handling prediction requests)
- Frontend: Streamlit (for the web interface)
- Database: PostgreSQL (for logging detection history)
- Image Handling: OpenCV
- Upload image files and detect multiple objects.
- View annotated image with bounding boxes.
- Download detection results as CSV.
- (Optional) Log detection history to PostgreSQL.
Data Source: https://universe.roboflow.com/siewchinyip-outlook-my/sixray
- Trained for 32 epochs on Yolov11m.pt base
- Metrics:
- Model accuracy measured on validation set
- mAP50: 0.906
- mAP50-95: 0.643
- Precision: 0.92
- Recall: 0.82
python app.py
streamlit run app_frontend.py