Skip to content

Commit

Permalink
Added model stats for yolo
Browse files Browse the repository at this point in the history
  • Loading branch information
daved01 committed Mar 12, 2021
1 parent 6df2918 commit 717e6c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ We currently support the models:
The SSD model is taken from [here](https://github.com/qfgaohao/pytorch-ssd).
The YOLO model is taken from [here](https://github.com/ultralytics/yolov5).


![Example](media/detr-example.jpg)


## Dependencies and setup
* Python >= 3.79
* Python 3.7.10
* OpenCV2
* PyTorch >= 1.6.0
* Torchvision >= 0.7.0
* PyTorch 1.7.1
* Torchvision 0.8.2

To use the video function place `.mp4` videos into the folder `media/DrivingClips`.

Expand Down
Binary file added media/detr-example.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion visualizer/stats_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def showStats(image, model_type, labels, conf):
model_stats = dict.fromkeys(keys)

# COCO dataset
if (model_type == "-detr" or model_type == "-fasterrcnn"):
if (model_type == "-detr" or model_type == "-fasterrcnn" or model_type == "-yolov5s"):
model_stats["numCars"] = np.count_nonzero(labels == 3)
model_stats["numTrucksBuses"] = np.count_nonzero(labels == 6) + np.count_nonzero(labels == 8)
model_stats["numMotorCycles"] = np.count_nonzero(labels == 4)
Expand Down
Binary file added yolov5s.pt
Binary file not shown.

0 comments on commit 717e6c7

Please sign in to comment.