A Streamlit web application for detecting damage in images using a pre-trained YOLOv8 model. Users can upload an image, view the detected damage with labeled bounding boxes (showing only damage types), and see detailed detection data in a table.
- Upload images (JPG, JPEG, PNG) for damage detection.
- Display annotated images with bounding boxes labeled by damaged.
- Show a table with detection details: Detection #, Damaged, Confidence, and Bounding Box coordinates.
- Built with Streamlit for an interactive web interface.
- Uses a custom YOLOv8 model (
best.pt) for damage detection.
- Python 3.8 or higher
- A trained YOLOv8 model file (
best.pt) in the project directory - Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/omkarjavali/container_damage_detection.git cd container_damage_detection -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Ensure the YOLOv8 model:
- Place your
best.ptfile in the project root or update the path inapp.pyif stored elsewhere.
- Place your
Run the Streamlit app:
streamlit run app.pyAccess the app:
- Open your browser and go to
http://localhost:8501 - Upload an image to detect damage
- View the annotated image with damage labels and a table of detection details below
your-repo-name/
│
├── home.py # Main Streamlit application
├── pages
├── result.py
├── best.pt # YOLOv8 model file (not tracked in Git)
├── requirements.txt # Python dependencies
├── README.md # Project documentation
- The app assumes
best.ptoutputs bounding boxes with class labels. Adjustapp.pyif your model has a different format. - For large images, consider adding resizing logic in
app.pyto improve performance. - To customize the UI (e.g., bounding box colors, table format), modify
app.py.
- Built with Streamlit and Ultralytics YOLOv8.
- Thanks to the open-source community for robust tools!