This project demonstrates object detection using the Ultralytics YOLO models (yolo11n.pt and yolo11s.pt).
It includes:
- A Jupyter Notebook/Google Colab for experimenting with YOLO detection.
- Streamlit apps for detecting objects in images and videos.
- A Webcam script for real-time detection.
-
Detect objects in:
- Single Image
- Multiple Images
- Image or Video
- Live Webcam Stream
-
Real-time bounding boxes, labels, and confidence scores.
-
Class-wise detection summary.
-
Streamlit apps for interactive browser usage.
├── performingObjectDetectionUsingYOLO11n.ipynb # Notebook version
├── objectDetectionSoloImg.py # Streamlit app: single image
├── objectDetectionMultipleImg.py # Streamlit app: multiple images
├── objectDetectionSoloImgVid.py # Streamlit app: image or video
├── useCamToFind.py # Live webcam detection
├── requirements.txt # Dependencies
├── README.md # Project documentation
└── runs/ # YOLO outputs (auto-created)
-
Clone this repository:
git clone https://github.com/arupa444/OCR-Using-YOLO.git cd OCR-Using-YOLO -
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # Mac/Linux .venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
jupyter notebook performingObjectDetectionUsingYOLO11n.ipynbInside the notebook:
!yolo predict model=yolo11n.pt source='image.jpg'!yolo predict model=yolo11n.pt source='video.mp4'!yolo predict model=yolo11n.pt source=0streamlit run objectDetectionSoloImg.pystreamlit run objectDetectionMultipleImg.pystreamlit run objectDetectionSoloImgVid.pypython useCamToFind.py- Uses your default webcam (
source=1). - Opens a live window with bounding boxes.
- Saves detection results in
runs/detect/.
-
Annotated images/videos are shown directly in the apps.
-
YOLO saves all processed results inside:
runs/detect/Each execution creates a new timestamped folder.
- Python 3.8+
- Jupyter Notebook/Google Colab
- Ultralytics YOLO
- Streamlit
- Pillow
- NumPy
- OpenCV
- Torch + TorchVision
Install directly with:
pip install ultralytics streamlit pillow numpy opencv-python torch torchvisionfrom ultralytics import YOLO
model = YOLO("yolo11n.pt")
results = model("image.jpg")
results.show()This project is licensed under the MIT License. Feel free to use and modify.