Spaces:
Sleeping
Sleeping
File size: 4,935 Bytes
08d66df |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
---
license: mit
title: SmartVision AI
sdk: streamlit
emoji: π
colorFrom: red
colorTo: red
short_description: Multi-domain smart object detection and classification syste
---
# SmartVision AI β Complete Vision Pipeline (YOLOv8 + CNN Classifiers + Streamlit Dashboard)
SmartVision AI is a fully integrated **Computer Vision system** that combines:
- **Object Detection** using YOLOv8
- **Image Classification** using 4 deep-learning models:
**VGG16**, **ResNet50**, **MobileNetV2**, **EfficientNetB0**
- A complete **Streamlit-based Dashboard** for inference, comparison, metrics visualization, and webcam snapshots
- A modified dataset built on a **25βclass COCO subset**
This README explains setup, architecture, training, deployment, and usage.
---
## π Features
### β
1. Image Classification (4 Models)
Each model is fineβtuned on your custom 25βclass dataset:
- **VGG16**
- **ResNet50**
- **MobileNetV2**
- **EfficientNetB0**
Outputs:
- Topβ1 class prediction
- Topβ5 predictions
- Class probabilities
---
### π― 2. Object Detection β YOLOv8s
YOLO detects multiple objects in images or webcam snapshots.
Features:
- Bounding boxes
- Confidence scores
- Optional classification verification using ResNet50
- Annotated images saved automatically
---
### π 3. Integrated Classification + Detection Pipeline
For each YOLOβdetected box:
1. Crop region
2. Classify using chosen CNN model
3. Display YOLO label + classifier label
4. Draw combined annotated results
---
### π 4. Metrics Dashboard
Displays:
- Accuracy
- Weighted F1 score
- Topβ5 accuracy
- Images per second
- Model size
- YOLOv8 mAP scores
- Confusion matrices
- Comparison bar charts
---
### π· 5. Webcam Snapshot Detection
Take a photo via webcam β YOLO detection β annotated results.
---
## π Project Structure
```
SmartVision_AI/
β
βββ app.py # Main Streamlit App
βββ saved_models/ # Trained weights (VGG16, ResNet, MobileNetV2, EfficientNet)
βββ yolo_runs/ # YOLOv8 training folder
βββ smartvision_dataset/ # 25-class dataset
β βββ classification/
β β βββ train/
β β βββ val/
β β βββ test/
β βββ detection/ # Labels + images for YOLOv8
β
βββ smartvision_metrics/ # Accuracy, F1, confusion matrices
βββ scripts/ # Weight converters, training scripts
βββ inference_outputs/ # Annotated results
βββ requirements.txt
βββ README.md
```
---
## βοΈ Installation
### 1οΈβ£ Clone Repository
```
git clone https://github.com/<your-username>/SmartVision_AI.git
cd SmartVision_AI
```
### 2οΈβ£ Install Dependencies
```
pip install -r requirements.txt
```
### 3οΈβ£ Install YOLOv8 (Ultralytics)
```
pip install ultralytics
```
---
## βΆοΈ Run Streamlit App
```
streamlit run app.py
```
App will open at:
```
http://localhost:8501
```
---
## ποΈ Training Workflow
### 1οΈβ£ Classification Models
Each model has:
- Stage 1 β Train head with frozen backbone
- Stage 2 β Unfreeze top layers + fineβtune
Scripts:
```
scripts/train_mobilenetv2.py
scripts/train_efficientnetb0.py
scripts/train_resnet50.py
scripts/train_vgg16.py
```
### 2οΈβ£ YOLO Training
```
yolo task=detect mode=train model=yolov8s.pt data=data.yaml epochs=50 imgsz=640
```
Outputs saved to:
```
yolo_runs/smartvision_yolov8s/
```
---
## π§ͺ Supported Classes (25 COCO Classes)
```
airplane, bed, bench, bicycle, bird, bottle, bowl,
bus, cake, car, cat, chair, couch, cow, cup, dog,
elephant, horse, motorcycle, person, pizza, potted plant,
stop sign, traffic light, truck
```
---
## π§° Deployment on Hugging Face Spaces
You can deploy using **Streamlit SDK**.
### Steps:
1. Create public repository on GitHub
2. Push project files
3. Create new Hugging Face Space β select **Streamlit**
4. Connect GitHub repo
5. Add `requirements.txt`
6. Enable **GPU** for YOLO (optional)
7. Deploy π
---
## π§Ύ requirements.txt Example
```
streamlit
tensorflow==2.13.0
ultralytics
numpy
pandas
Pillow
matplotlib
scikit-learn
opencv-python-headless
```
---
## π .gitignore Example
```
saved_models/
*.h5
*.pt
*.weights.h5
yolo_runs/
smartvision_metrics/
inference_outputs/
__pycache__/
*.pyc
.DS_Store
env/
```
---
## π Developer
**SmartVision AI Project**
Yogesh Kumar V
M.Sc. Seed Science & Technology (TNAU)
Passion: AI, Computer Vision, Agribusiness Technology
---
## π Conclusion
SmartVision AI integrates:
- Multiβmodel classification
- YOLO detection
- Streamlit visualization
- Full evaluation suite
Perfect for:
- Research
- Demonstrations
- CV/AI portfolio
- Realβworld image understanding
---
Enjoy using SmartVision AI! ππ§
|