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Detection System
|
| 13 |
+
|
| 14 |
+
A powerful, real-time object detection system built with YOLOv8 and Python. Track, count, and monitor objects with advanced zone-based alerts, all wrapped in an intuitive interface.
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+

|
| 18 |
+

|
| 19 |
+

|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
## π Live Demo
|
| 23 |
+
|
| 24 |
+
**[Try the Streamlit Web App](#)**
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## β¨ Features
|
| 29 |
+
|
| 30 |
+
β
**Real-Time Detection** - Live webcam or video file processing
|
| 31 |
+
β
**Multi-Source Support** - Webcam, video files, or single images
|
| 32 |
+
β
**Object Counting** - Count detected objects by class
|
| 33 |
+
β
**Zone-Based Alerts** - Define restricted zones and get alerts
|
| 34 |
+
β
**FPS Display** - Real-time performance monitoring
|
| 35 |
+
β
**Save Outputs** - Export detected videos and snapshots
|
| 36 |
+
β
**Interactive Controls** - Pause, snapshot, and ESC to quit
|
| 37 |
+
β
**Web Interface** - Streamlit demo for easy testing
|
| 38 |
+
β
**GPU Acceleration** - CUDA support for faster processing
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## π¬ Demo
|
| 43 |
+
|
| 44 |
+
### Real-Time Detection
|
| 45 |
+
|
| 46 |
+
### Object Detection
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
> β οΈ **Important Note β COCO Dataset Limitation**
|
| 51 |
+
> *Please read this before testing the project*
|
| 52 |
+
|
| 53 |
+
<div align="center">
|
| 54 |
+
<img src="https://img.shields.io/badge/Dataset-COCO%2080%20Classes-blueviolet?style=for-the-badge" />
|
| 55 |
+
</div>
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## π What this means
|
| 60 |
+
|
| 61 |
+
This project uses **YOLOv8 pretrained on the COCO dataset**, which contains **ONLY 80 object classes**.
|
| 62 |
+
|
| 63 |
+
Therefore, the system can **only detect known COCO objects**.
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
## β
Detectable COCO Objects (Examples)
|
| 68 |
+
|
| 69 |
+
β person
|
| 70 |
+
β car / bus / truck
|
| 71 |
+
β dog / cat / horse
|
| 72 |
+
β bottle / cup / bowl
|
| 73 |
+
β fork / knife / spoon
|
| 74 |
+
β laptop / tv / keyboard / mouse
|
| 75 |
+
β apple / banana / orange
|
| 76 |
+
β chair / couch / bed
|
| 77 |
+
β microwave / oven / sink / refrigerator
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
## β NOT Detectable (Not part of COCO dataset)
|
| 82 |
+
|
| 83 |
+
The model **will NOT detect these objects correctly**:
|
| 84 |
+
|
| 85 |
+
- whisk
|
| 86 |
+
- spatula
|
| 87 |
+
- ladle
|
| 88 |
+
- tongs
|
| 89 |
+
- Indian kitchen utensils
|
| 90 |
+
- toys
|
| 91 |
+
- makeup products
|
| 92 |
+
- stationery items
|
| 93 |
+
- cartoon / clipart images
|
| 94 |
+
- uncommon tools and objects
|
| 95 |
+
|
| 96 |
+
> π₯ These objects do *not* exist in COCO dataset β YOLO guesses incorrectly.
|
| 97 |
+
|
| 98 |
+
---
|
| 99 |
+
|
| 100 |
+
## π οΈ Want to detect your own objects?
|
| 101 |
+
|
| 102 |
+
You must train a **custom YOLO model**.
|
| 103 |
+
|
| 104 |
+
> β Custom training guide available
|
| 105 |
+
> β Works with your utensils, cosmetics, tools, toys
|
| 106 |
+
> β 10Γ better accuracy for non-COCO items
|
| 107 |
+
|
| 108 |
+
---
|
| 109 |
+
|
| 110 |
+
## π οΈ Technology Stack
|
| 111 |
+
|
| 112 |
+
| Category | Technology |
|
| 113 |
+
|----------|-----------|
|
| 114 |
+
| π§ **AI Model** | YOLOv8 (Ultralytics) |
|
| 115 |
+
| ποΈ **Computer Vision** | OpenCV 4.7+ |
|
| 116 |
+
| π» **Language** | Python 3.8+ |
|
| 117 |
+
| π **Acceleration** | CUDA / PyTorch |
|
| 118 |
+
| π¨ **Web UI** | Streamlit |
|
| 119 |
+
| π **Processing** | NumPy |
|
| 120 |
+
|
| 121 |
+
---
|
| 122 |
+
|
| 123 |
+
## π¦ Installation
|
| 124 |
+
|
| 125 |
+
### Prerequisites
|
| 126 |
+
|
| 127 |
+
- Python 3.8 or higher
|
| 128 |
+
- (Optional) NVIDIA GPU with CUDA for acceleration
|
| 129 |
+
- Webcam for live detection (optional)
|
| 130 |
+
|
| 131 |
+
### Quick Setup
|
| 132 |
+
|
| 133 |
+
```bash
|
| 134 |
+
# 1. Clone the repository
|
| 135 |
+
git clone https://github.com/Ishika-guptaa25/VisionTrack-YOLO.git
|
| 136 |
+
cd VisionTrack-YOLO
|
| 137 |
+
|
| 138 |
+
# 2. Create virtual environment (recommended)
|
| 139 |
+
python -m venv venv
|
| 140 |
+
|
| 141 |
+
# Activate virtual environment
|
| 142 |
+
# Windows:
|
| 143 |
+
venv\Scripts\activate
|
| 144 |
+
# Mac/Linux:
|
| 145 |
+
source venv/bin/activate
|
| 146 |
+
|
| 147 |
+
# 3. Install dependencies
|
| 148 |
+
pip install -r requirements.txt
|
| 149 |
+
|
| 150 |
+
# 4. Run the application
|
| 151 |
+
python visiontrack.py --source 0 --show
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
That's it! The system will start with your webcam.
|
| 155 |
+
|
| 156 |
+
---
|
| 157 |
+
|
| 158 |
+
## π― Usage
|
| 159 |
+
|
| 160 |
+
### Command Line Interface
|
| 161 |
+
|
| 162 |
+
#### Basic Usage
|
| 163 |
+
|
| 164 |
+
```bash
|
| 165 |
+
# Use webcam (source 0)
|
| 166 |
+
python visiontrack.py --source 0 --show
|
| 167 |
+
|
| 168 |
+
# Use video file
|
| 169 |
+
python visiontrack.py --source path/to/video.mp4 --show
|
| 170 |
+
|
| 171 |
+
# Save output video
|
| 172 |
+
python visiontrack.py --source 0 --save --show
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
#### Advanced Options
|
| 176 |
+
|
| 177 |
+
```bash
|
| 178 |
+
python visiontrack.py \
|
| 179 |
+
--source 0 \ # 0 for webcam, or video/image path
|
| 180 |
+
--save \ # Save output video
|
| 181 |
+
--show \ # Display window
|
| 182 |
+
--device cuda \ # Use GPU (cuda or cpu)
|
| 183 |
+
--model yolov8n.pt \ # Model size (n/s/m/l/x)
|
| 184 |
+
--conf 0.25 # Confidence threshold
|
| 185 |
+
```
|
| 186 |
+
|
| 187 |
+
### Interactive Controls
|
| 188 |
+
|
| 189 |
+
While running the application:
|
| 190 |
+
|
| 191 |
+
| Key | Action |
|
| 192 |
+
|-----|--------|
|
| 193 |
+
| **ESC** | Exit application |
|
| 194 |
+
| **S** | Save current frame snapshot |
|
| 195 |
+
| **P** | Pause/Resume detection |
|
| 196 |
+
|
| 197 |
+
---
|
| 198 |
+
|
| 199 |
+
## π Streamlit Web Interface
|
| 200 |
+
|
| 201 |
+
Launch the web-based demo:
|
| 202 |
+
|
| 203 |
+
```bash
|
| 204 |
+
streamlit run streamlit_app.py
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
### Features:
|
| 208 |
+
- π· **Image Mode**: Upload and detect objects in images
|
| 209 |
+
- π₯ **Video Mode**: Upload video files for batch processing
|
| 210 |
+
- ποΈ **Interactive**: Adjust confidence threshold on the fly
|
| 211 |
+
- πΎ **Download**: Save detection results
|
| 212 |
+
|
| 213 |
+
---
|
| 214 |
+
|
| 215 |
+
## βοΈ Configuration
|
| 216 |
+
|
| 217 |
+
Edit `config.py` to customize behavior:
|
| 218 |
+
|
| 219 |
+
### Model Settings
|
| 220 |
+
|
| 221 |
+
```python
|
| 222 |
+
MODEL_NAME = "yolov8n.pt" # Options: yolov8n/s/m/l/x.pt
|
| 223 |
+
CONFIDENCE_THRESHOLD = 0.25 # Detection confidence (0.0-1.0)
|
| 224 |
+
IOU_THRESHOLD = 0.45 # Intersection over Union threshold
|
| 225 |
+
DEVICE = "cuda" # "cuda" for GPU, "cpu" for CPU
|
| 226 |
+
```
|
| 227 |
+
|
| 228 |
+
### Detection Settings
|
| 229 |
+
|
| 230 |
+
```python
|
| 231 |
+
# Enable/disable features
|
| 232 |
+
ENABLE_COUNTING = True
|
| 233 |
+
ENABLE_ZONE_ALERT = True
|
| 234 |
+
|
| 235 |
+
# Classes to count
|
| 236 |
+
COUNT_TARGET_CLASSES = ["person", "car", "bicycle"]
|
| 237 |
+
|
| 238 |
+
# Define restricted zone (polygon coordinates)
|
| 239 |
+
ZONE_POLYGON = [(50,50), (400,50), (400,300), (50,300)]
|
| 240 |
+
|
| 241 |
+
# Classes that trigger zone alerts
|
| 242 |
+
ALERT_CLASSES = ["person"]
|
| 243 |
+
```
|
| 244 |
+
|
| 245 |
+
### Output Settings
|
| 246 |
+
|
| 247 |
+
```python
|
| 248 |
+
OUTPUT_DIR = "outputs/detections"
|
| 249 |
+
SAVE_VIDEO = True
|
| 250 |
+
VIDEO_FPS = 20
|
| 251 |
+
```
|
| 252 |
+
|
| 253 |
+
---
|
| 254 |
+
|
| 255 |
+
## π¨ YOLOv8 Model Options
|
| 256 |
+
|
| 257 |
+
| Model | Size | Speed | Accuracy | Use Case |
|
| 258 |
+
|-------|------|-------|----------|----------|
|
| 259 |
+
| **YOLOv8n** | 3MB | β‘ Fast | Good | Webcam, Real-time |
|
| 260 |
+
| **YOLOv8s** | 11MB | β‘ Fast | Better | Balanced |
|
| 261 |
+
| **YOLOv8m** | 26MB | π Medium | Great | Accuracy priority |
|
| 262 |
+
| **YOLOv8l** | 44MB | π’ Slow | Excellent | High accuracy |
|
| 263 |
+
| **YOLOv8x** | 68MB | π’ Slower | Best | Maximum accuracy |
|
| 264 |
+
|
| 265 |
+
Change model in `config.py`:
|
| 266 |
+
```python
|
| 267 |
+
MODEL_NAME = "yolov8s.pt" # or yolov8m.pt, yolov8l.pt, yolov8x.pt
|
| 268 |
+
```
|
| 269 |
+
|
| 270 |
+
---
|
| 271 |
+
|
| 272 |
+
## π Project Structure
|
| 273 |
+
|
| 274 |
+
```
|
| 275 |
+
VisionTrack-YOLO/
|
| 276 |
+
β
|
| 277 |
+
βββ visiontrack.py # Main detection application
|
| 278 |
+
βββ streamlit_app.py # Web interface demo
|
| 279 |
+
βββ config.py # Configuration settings
|
| 280 |
+
βββ utils.py # Utility functions
|
| 281 |
+
βββ requirements.txt # Python dependencies
|
| 282 |
+
βββ README.md # This file
|
| 283 |
+
βββ LICENSE # MIT License
|
| 284 |
+
βββ screenshots # Demo images
|
| 285 |
+
|
| 286 |
+
```
|
| 287 |
+
|
| 288 |
+
---
|
| 289 |
+
|
| 290 |
+
## π How It Works
|
| 291 |
+
|
| 292 |
+
### Detection Pipeline
|
| 293 |
+
|
| 294 |
+
```
|
| 295 |
+
Input Source (Webcam/Video/Image)
|
| 296 |
+
β
|
| 297 |
+
Frame Capture & Preprocessing
|
| 298 |
+
β
|
| 299 |
+
YOLOv8 Model Inference
|
| 300 |
+
β
|
| 301 |
+
Object Detection & Classification
|
| 302 |
+
β
|
| 303 |
+
βββ Bounding Box Drawing
|
| 304 |
+
βββ Object Counting
|
| 305 |
+
βββ Zone Alert Check
|
| 306 |
+
βββ FPS Calculation
|
| 307 |
+
β
|
| 308 |
+
Display & Save Output
|
| 309 |
+
```
|
| 310 |
+
|
| 311 |
+
### Zone Alert System
|
| 312 |
+
|
| 313 |
+
1. **Define Zone**: Set polygon coordinates in `config.py`
|
| 314 |
+
2. **Track Objects**: System monitors object centers
|
| 315 |
+
3. **Alert Trigger**: When specified class enters zone
|
| 316 |
+
4. **Visual Feedback**: Red alert overlay on frame
|
| 317 |
+
|
| 318 |
+
### Object Counting
|
| 319 |
+
|
| 320 |
+
- Counts objects per frame by class
|
| 321 |
+
- Cumulative counting across video
|
| 322 |
+
- Configurable target classes
|
| 323 |
+
- Real-time overlay display
|
| 324 |
+
|
| 325 |
+
---
|
| 326 |
+
|
| 327 |
+
## π Detected Object Classes
|
| 328 |
+
|
| 329 |
+
YOLOv8 is trained on COCO dataset with **80 classes**:
|
| 330 |
+
|
| 331 |
+
```
|
| 332 |
+
person, bicycle, car, motorcycle, airplane, bus, train, truck, boat,
|
| 333 |
+
traffic light, fire hydrant, stop sign, parking meter, bench, bird, cat,
|
| 334 |
+
dog, horse, sheep, cow, elephant, bear, zebra, giraffe, backpack, umbrella,
|
| 335 |
+
handbag, tie, suitcase, frisbee, skis, snowboard, sports ball, kite,
|
| 336 |
+
baseball bat, baseball glove, skateboard, surfboard, tennis racket, bottle,
|
| 337 |
+
wine glass, cup, fork, knife, spoon, bowl, banana, apple, sandwich, orange,
|
| 338 |
+
broccoli, carrot, hot dog, pizza, donut, cake, chair, couch, potted plant,
|
| 339 |
+
bed, dining table, toilet, tv, laptop, mouse, remote, keyboard, cell phone,
|
| 340 |
+
microwave, oven, toaster, sink, refrigerator, book, clock, vase, scissors,
|
| 341 |
+
teddy bear, hair drier, toothbrush
|
| 342 |
+
```
|
| 343 |
+
|
| 344 |
+
---
|
| 345 |
+
|
| 346 |
+
## π Performance Benchmarks
|
| 347 |
+
|
| 348 |
+
### On NVIDIA GTX 1660 Ti
|
| 349 |
+
|
| 350 |
+
| Model | FPS (Webcam) | FPS (Video) | Detection Time |
|
| 351 |
+
|-------|--------------|-------------|----------------|
|
| 352 |
+
| YOLOv8n | ~60 FPS | ~70 FPS | ~16ms |
|
| 353 |
+
| YOLOv8s | ~45 FPS | ~50 FPS | ~22ms |
|
| 354 |
+
| YOLOv8m | ~30 FPS | ~35 FPS | ~33ms |
|
| 355 |
+
|
| 356 |
+
### On CPU (Intel i5)
|
| 357 |
+
| Model | FPS (Webcam) | FPS (Video) | Detection Time |
|
| 358 |
+
|-------|--------------|-------------|----------------|
|
| 359 |
+
| YOLOv8n | ~10 FPS | ~12 FPS | ~100ms |
|
| 360 |
+
| YOLOv8s | ~6 FPS | ~8 FPS | ~166ms |
|
| 361 |
+
|
| 362 |
+
*Your performance may vary based on hardware*
|
| 363 |
+
|
| 364 |
+
---
|
| 365 |
+
|
| 366 |
+
## π Deployment
|
| 367 |
+
|
| 368 |
+
### Streamlit Cloud (FREE)
|
| 369 |
+
|
| 370 |
+
1. **Push to GitHub**
|
| 371 |
+
```bash
|
| 372 |
+
git add .
|
| 373 |
+
git commit -m "Deploy VisionTrack-YOLO"
|
| 374 |
+
git push origin main
|
| 375 |
+
```
|
| 376 |
+
|
| 377 |
+
2. **Deploy on Streamlit Cloud**
|
| 378 |
+
- Go to [share.streamlit.io](https://share.streamlit.io)
|
| 379 |
+
- Connect GitHub repository: `Ishika-guptaa25/VisionTrack-YOLO`
|
| 380 |
+
- Main file: `streamlit_app.py`
|
| 381 |
+
- Click "Deploy"
|
| 382 |
+
|
| 383 |
+
3. **Live in 2-3 minutes!** π
|
| 384 |
+
|
| 385 |
+
### Docker Deployment
|
| 386 |
+
|
| 387 |
+
```dockerfile
|
| 388 |
+
FROM python:3.9-slim
|
| 389 |
+
|
| 390 |
+
WORKDIR /app
|
| 391 |
+
|
| 392 |
+
# Install system dependencies
|
| 393 |
+
RUN apt-get update && apt-get install -y \
|
| 394 |
+
libgl1-mesa-glx \
|
| 395 |
+
libglib2.0-0
|
| 396 |
+
|
| 397 |
+
COPY requirements.txt .
|
| 398 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 399 |
+
|
| 400 |
+
COPY . .
|
| 401 |
+
|
| 402 |
+
CMD ["python", "visiontrack.py", "--source", "0", "--show"]
|
| 403 |
+
```
|
| 404 |
+
|
| 405 |
+
Build and run:
|
| 406 |
+
```bash
|
| 407 |
+
docker build -t visiontrack-yolo .
|
| 408 |
+
docker run -it --rm --device=/dev/video0 visiontrack-yolo
|
| 409 |
+
```
|
| 410 |
+
|
| 411 |
+
---
|
| 412 |
+
|
| 413 |
+
## π§ͺ Use Cases
|
| 414 |
+
|
| 415 |
+
### π’ Security & Surveillance
|
| 416 |
+
- Monitor restricted areas
|
| 417 |
+
- Count people entering/exiting
|
| 418 |
+
- Alert on unauthorized access
|
| 419 |
+
|
| 420 |
+
### π Traffic Monitoring
|
| 421 |
+
- Vehicle counting by type
|
| 422 |
+
- Speed estimation (with calibration)
|
| 423 |
+
- Parking lot occupancy
|
| 424 |
+
|
| 425 |
+
### π Industrial Safety
|
| 426 |
+
- PPE (Personal Protective Equipment) detection
|
| 427 |
+
- Worker safety zone monitoring
|
| 428 |
+
- Equipment tracking
|
| 429 |
+
|
| 430 |
+
### π Retail Analytics
|
| 431 |
+
- Customer counting
|
| 432 |
+
- Queue length monitoring
|
| 433 |
+
- Product interaction tracking
|
| 434 |
+
|
| 435 |
+
### πΎ Wildlife Monitoring
|
| 436 |
+
- Animal species counting
|
| 437 |
+
- Migration pattern tracking
|
| 438 |
+
- Conservation efforts
|
| 439 |
+
|
| 440 |
+
---
|
| 441 |
+
|
| 442 |
+
## π§ Troubleshooting
|
| 443 |
+
|
| 444 |
+
### Common Issues
|
| 445 |
+
|
| 446 |
+
#### 1. Camera Not Opening
|
| 447 |
+
```bash
|
| 448 |
+
# Check available cameras
|
| 449 |
+
python -c "import cv2; print(cv2.VideoCapture(0).isOpened())"
|
| 450 |
+
|
| 451 |
+
# Try different camera index
|
| 452 |
+
python visiontrack.py --source 1
|
| 453 |
+
```
|
| 454 |
+
|
| 455 |
+
#### 2. CUDA Not Available
|
| 456 |
+
```bash
|
| 457 |
+
# Check CUDA availability
|
| 458 |
+
python -c "import torch; print(torch.cuda.is_available())"
|
| 459 |
+
|
| 460 |
+
# Force CPU usage
|
| 461 |
+
python visiontrack.py --device cpu
|
| 462 |
+
```
|
| 463 |
+
|
| 464 |
+
#### 3. Model Download Issues
|
| 465 |
+
```bash
|
| 466 |
+
# Manually download model
|
| 467 |
+
mkdir models
|
| 468 |
+
cd models
|
| 469 |
+
wget https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt
|
| 470 |
+
```
|
| 471 |
+
|
| 472 |
+
#### 4. Low FPS
|
| 473 |
+
- Use smaller model (yolov8n.pt)
|
| 474 |
+
- Reduce input resolution
|
| 475 |
+
- Enable GPU acceleration
|
| 476 |
+
- Close other applications
|
| 477 |
+
|
| 478 |
+
---
|
| 479 |
+
|
| 480 |
+
## π€ Contributing
|
| 481 |
+
|
| 482 |
+
Contributions are welcome! Here's how:
|
| 483 |
+
|
| 484 |
+
1. π΄ Fork the repository
|
| 485 |
+
2. πΏ Create feature branch
|
| 486 |
+
```bash
|
| 487 |
+
git checkout -b feature/AmazingFeature
|
| 488 |
+
```
|
| 489 |
+
3. πΎ Commit changes
|
| 490 |
+
```bash
|
| 491 |
+
git commit -m 'Add AmazingFeature'
|
| 492 |
+
```
|
| 493 |
+
4. π€ Push to branch
|
| 494 |
+
```bash
|
| 495 |
+
git push origin feature/AmazingFeature
|
| 496 |
+
```
|
| 497 |
+
5. π Open Pull Request
|
| 498 |
+
|
| 499 |
+
### Ideas for Contributions
|
| 500 |
+
|
| 501 |
+
- [ ] Add track ID persistence across frames
|
| 502 |
+
- [ ] Implement multi-zone alerts
|
| 503 |
+
- [ ] Add email/SMS notification system
|
| 504 |
+
- [ ] Create analytics dashboard
|
| 505 |
+
- [ ] Add pose estimation features
|
| 506 |
+
- [ ] Implement object tracking (DeepSORT)
|
| 507 |
+
- [ ] Add custom model training pipeline
|
| 508 |
+
- [ ] Create mobile app version
|
| 509 |
+
|
| 510 |
+
---
|
| 511 |
+
|
| 512 |
+
## π― Future Enhancements
|
| 513 |
+
|
| 514 |
+
- [ ] **Object Tracking** - Persistent ID tracking with DeepSORT
|
| 515 |
+
- [ ] **Analytics Dashboard** - Historical data visualization
|
| 516 |
+
- [ ] **Multi-Camera Support** - Process multiple streams
|
| 517 |
+
- [ ] **Cloud Integration** - AWS/Azure deployment
|
| 518 |
+
- [ ] **REST API** - Programmatic access
|
| 519 |
+
- [ ] **Mobile App** - iOS/Android applications
|
| 520 |
+
- [ ] **Email Alerts** - Automated notifications
|
| 521 |
+
- [ ] **Database Logging** - Detection history storage
|
| 522 |
+
- [ ] **Custom Training** - Fine-tune on your dataset
|
| 523 |
+
- [ ] **Pose Estimation** - Human pose analysis
|
| 524 |
+
|
| 525 |
+
---
|
| 526 |
+
|
| 527 |
+
## π Learning Resources
|
| 528 |
+
|
| 529 |
+
### YOLOv8 & Object Detection
|
| 530 |
+
- π [Ultralytics YOLOv8 Docs](https://docs.ultralytics.com/)
|
| 531 |
+
- π [YOLO Paper (Original)](https://arxiv.org/abs/1506.02640)
|
| 532 |
+
- π [Computer Vision Course](https://www.coursera.org/learn/computer-vision-basics)
|
| 533 |
+
|
| 534 |
+
### OpenCV
|
| 535 |
+
- π [OpenCV Documentation](https://docs.opencv.org/)
|
| 536 |
+
- π [OpenCV Python Tutorials](https://docs.opencv.org/master/d6/d00/tutorial_py_root.html)
|
| 537 |
+
|
| 538 |
+
### Deep Learning
|
| 539 |
+
- π [PyTorch Tutorials](https://pytorch.org/tutorials/)
|
| 540 |
+
- π [Deep Learning Specialization](https://www.coursera.org/specializations/deep-learning)
|
| 541 |
+
|
| 542 |
+
---
|
| 543 |
+
|
| 544 |
+
## π License
|
| 545 |
+
|
| 546 |
+
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
|
| 547 |
+
|
| 548 |
+
```
|
| 549 |
+
MIT License - Free to use, modify, and distribute
|
| 550 |
+
```
|
| 551 |
+
|
| 552 |
+
---
|
| 553 |
+
|
| 554 |
+
## π€ Author
|
| 555 |
+
|
| 556 |
+
**Ishika Gupta**
|
| 557 |
+
|
| 558 |
+
π BCA Student | Python Developer | AI/ML Enthusiast
|
| 559 |
+
π India
|
| 560 |
+
πΌ Building computer vision applications
|
| 561 |
+
|
| 562 |
+
### Connect with me:
|
| 563 |
+
|
| 564 |
+
- π GitHub: [@Ishika-guptaa25](https://github.com/Ishika-guptaa25)
|
| 565 |
+
|
| 566 |
+
---
|
| 567 |
+
|
| 568 |
+
## π Acknowledgments
|
| 569 |
+
|
| 570 |
+
- **Ultralytics** - For the amazing YOLOv8 framework
|
| 571 |
+
- **OpenCV Team** - For computer vision tools
|
| 572 |
+
- **PyTorch** - For deep learning backend
|
| 573 |
+
- **Streamlit** - For easy web interface creation
|
| 574 |
+
- **COCO Dataset** - For pretrained model weights
|
| 575 |
+
|
| 576 |
+
---
|
| 577 |
+
|
| 578 |
+
## π Support
|
| 579 |
+
|
| 580 |
+
### Found this useful?
|
| 581 |
+
|
| 582 |
+
β **Star this repository** if it helped you!
|
| 583 |
+
|
| 584 |
+
### Need Help?
|
| 585 |
+
|
| 586 |
+
- π [Report Issues](https://github.com/Ishika-guptaa25/VisionTrack-YOLO/issues)
|
| 587 |
+
- π‘ [Request Features](https://github.com/Ishika-guptaa25/VisionTrack-YOLO/issues)
|
| 588 |
+
- π¬ [Discussions](https://github.com/Ishika-guptaa25/VisionTrack-YOLO/discussions)
|
| 589 |
+
|
| 590 |
+
---
|
| 591 |
+
|
| 592 |
+
## β οΈ Disclaimer
|
| 593 |
+
|
| 594 |
+
This project is for **educational and research purposes**. When deploying in production:
|
| 595 |
+
|
| 596 |
+
- β
Ensure compliance with local privacy laws
|
| 597 |
+
- β
Obtain necessary permissions for surveillance
|
| 598 |
+
- β
Respect individual privacy rights
|
| 599 |
+
- β
Secure sensitive detection data
|
| 600 |
+
- β
Follow ethical AI guidelines
|
| 601 |
+
|
| 602 |
+
The authors are not responsible for misuse of this software.
|
| 603 |
+
|
| 604 |
+
---
|
| 605 |
+
|
| 606 |
+
## π Related Projects
|
| 607 |
+
|
| 608 |
+
- [YOLOv8 Official Repository](https://github.com/ultralytics/ultralytics)
|
| 609 |
+
- [OpenCV](https://github.com/opencv/opencv)
|
| 610 |
+
- [Awesome Object Detection](https://github.com/amusi/awesome-object-detection)
|
| 611 |
+
|
| 612 |
+
---
|
| 613 |
+
|
| 614 |
+
## π Project Stats
|
| 615 |
+
|
| 616 |
+

|
| 617 |
+

|
| 618 |
+

|
| 619 |
+
|
| 620 |
+
---
|
| 621 |
+
|
| 622 |
+
<div align="center">
|
| 623 |
+
|
| 624 |
+
### Built with β€οΈ using Python & YOLOv8
|
| 625 |
+
|
| 626 |
+
**If this project helped you, please give it a β!**
|
| 627 |
+
|
| 628 |
+
[β¬ Back to Top](#οΈ-visiontrack-yolo-real-time-object-detection-system)
|
| 629 |
+
|
| 630 |
+
</div>
|
| 631 |
+
|
| 632 |
+
---
|
| 633 |
+
|
| 634 |
+
**Β© 2025 Ishika Gupta. All rights reserved.**
|