https://github.com/xueeinstein/darknet-vis
Visualize YOLO feature map in prediction for easily checking your model performance
https://github.com/xueeinstein/darknet-vis
darknet object-detection yolo
Last synced: 8 days ago
JSON representation
Visualize YOLO feature map in prediction for easily checking your model performance
- Host: GitHub
- URL: https://github.com/xueeinstein/darknet-vis
- Owner: xueeinstein
- License: other
- Created: 2017-09-26T11:10:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-12T13:51:49.000Z (over 7 years ago)
- Last Synced: 2025-04-10T04:41:46.917Z (6 months ago)
- Topics: darknet, object-detection, yolo
- Language: C
- Homepage:
- Size: 4.9 MB
- Stars: 72
- Watchers: 2
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Darknet
[Darknet](https://github.com/pjreddie/darknet) is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.
For more information see the [Darknet project website](http://pjreddie.com/darknet).
For questions or issues please use the [Google Group](https://groups.google.com/forum/#!forum/darknet).
## Darknet-vis
### Why does visualization matters?
Typically, if you follow the instruction on the YOLO homepage, execute
```
./darknet detector test cfg/coco.data cfg/yolo.cfg yolo.weights data/dog.jpg
```you get the prediction results:

That looks good, however it doesn't reveal the detector's whole ability due to its fixed confidence threshold which is 0.6 by default.
If you use __darknet-vis__, besides the results image, it also generates objectness visualization and classes visualization.


Note that each grid cell corresponds to a unique position on the final feature map. In other words, it represents __receptive field__. As you can see, the YOLOv2 model also detect the trash bin at the right-top corner and the motorbike at the left-top corner with very low confidence. After decrease the threshold to 0.1, the new objectness visualization reveals more details as following

The trash bin is recognized as a person! Moreover, for small objects or some objects with special aspect ratio, the predicted center of object has a remarkable shift. All of these help you understand your YOLO model better, especially why it gets very low AP score for small objects detection.
### How to use?
Replacing Darknet with Darknet-vis is effortless, you just need to add `visualization=1` in __net__ entry of the cfg file. For example, my config in [yolo.cfg](cfg/yolo.cfg)
#### Python API
I wirte a more handy Darknet API wrapper. You can find the example at [darknet.py](https://github.com/xueeinstein/darknet-vis/blob/master/python/darknet.py). Note that `Darknet.detect_v()` is for this customized visualization.