Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: ObjectDetection
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
|
@@ -12,9 +12,37 @@ short_description: Detect and count cars/trucks in images (cvlib + OpenCV).
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: ObjectDetection
|
| 3 |
+
emoji: π
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
|
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# π Vehicle Counter β Object Detection App
|
| 16 |
|
| 17 |
+
This project uses computer vision to detect and count vehicles in an image.
|
| 18 |
+
A pre-trained object detection model from **cvlib** (YOLO) is used to identify cars and trucks.
|
| 19 |
|
| 20 |
+
The results are saved as:
|
| 21 |
+
- an output image with bounding boxes (`detected.jpg`)
|
| 22 |
+
- a JSON file with the object counts (`results.json`)
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## π Features
|
| 27 |
+
- Upload an image (JPG / PNG / WEBP)
|
| 28 |
+
- Detect vehicles using cvlib and OpenCV
|
| 29 |
+
- Count cars and trucks automatically
|
| 30 |
+
- Save results as JSON
|
| 31 |
+
- Display detected image in a Streamlit app
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## π§ How it works
|
| 36 |
+
1. The user uploads an image
|
| 37 |
+
2. Objects are detected using `cvlib.detect_common_objects`
|
| 38 |
+
3. Bounding boxes are drawn on the image
|
| 39 |
+
4. The number of cars and trucks is counted
|
| 40 |
+
5. Results are saved to `src/results.json` and `src/detected.jpg`
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## βΆοΈ Run locally
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
pip install -r requirements.txt
|
| 48 |
+
streamlit run app.py
|