ObjectDetection / README.md
EnYa32's picture
Update README.md
92f6d1f verified
|
Raw History Blame Contribute Delete
1.37 kB

A newer version of the Streamlit SDK is available: 1.67.0

Upgrade
metadata
title: ObjectDetection
emoji: πŸš—
colorFrom: red
colorTo: red
sdk: streamlit
app_file: src/streamlit_app.py
pinned: false
short_description: Detect and count cars/trucks in images (cvlib + OpenCV).
license: mit

πŸš— Vehicle Counter – Object Detection App

This project uses computer vision to detect and count vehicles in an image. A pre-trained object detection model from cvlib (YOLO) is used to identify cars and trucks.

The results are saved as:

  • an output image with bounding boxes (detected.jpg)
  • a JSON file with the object counts (results.json)

πŸ” Features

  • Upload an image (JPG / PNG / WEBP)
  • Detect vehicles using cvlib and OpenCV
  • Count cars and trucks automatically
  • Save results as JSON
  • Display detected image in a Streamlit app

🧠 How it works

  1. The user uploads an image
  2. Objects are detected using cvlib.detect_common_objects
  3. Bounding boxes are drawn on the image
  4. The number of cars and trucks is counted
  5. Results are saved to src/results.json and src/detected.jpg

▢️ Run locally

pip install -r requirements.txt
streamlit run app.py

πŸ“ Project Structure
.
β”œβ”€β”€ app.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── src/
    β”œβ”€β”€ results.json
    └── detected.jpg

πŸ“Œ Output Example
{
  "cars": 11,
  "trucks": 3
}

Author

Enes Yamac