A simple Streamlit web app that runs YOLO (Ultralytics) object detection on user-uploaded images. Supports multiple models, adjustable confidence/IoU, and works locally or on Streamlit Community Cloud.
davidinations-yolo.streamlit.app
- Model selection in the sidebar:
- Pick a default model from the
models/folder (auto-loaded). - Or upload your own
.ptmodel file directly in the UI.
- Pick a default model from the
- Sample-image buttons in the sidebar: each button auto-loads a test image
from
test_images/that matches the selected default model (e.g.sample1.pt↔sample1.png). A button is enabled only when its matching model is selected. - Image upload: JPG, PNG, BMP.
- Confidence threshold slider and IoU threshold slider.
- Shows the original and annotated image side by side.
- Results table with class, confidence, bounding box, and per-class counts.
pip install -r requirements.txtPlace one or more .pt model files into the models/ folder:
models/
best.pt
my_model.pt
They will appear in the "default model" dropdown automatically. Without any
model in models/, you can still upload a model file from the UI.
Model weights are not committed to git. Add
models/*.ptto your.gitignoreif using git.
streamlit run app.py- Push the repository to GitHub.
- Enable Streamlit Community Cloud on the repo.
- Streamlit reads
requirements.txtautomatically — no build step.
The default confidence and IoU values match the original Flask template's
.env:
| Parameter | Default |
|---|---|
| Confidence threshold | 0.8 |
| IoU threshold | 0.9 |
Both are adjustable via sliders in the app's sidebar.
app.py # Streamlit application
requirements.txt # Pinned dependencies
models/ # Optional default .pt model(s)
test_images/ # Optional sample test images matched by model name
README.md # This file