# CenterNet-HarDNet
**Repository Path**: zhang_baron/CenterNet-HarDNet
## Basic Information
- **Project Name**: CenterNet-HarDNet
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-02-08
- **Last Updated**: 2021-02-08
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Objects as Points + HarDNet
Object detection using center point detection:

> [**Objects as Points**](http://arxiv.org/abs/1904.07850)
> [**HarDNet: A Low Memory Traffic Network**](https://arxiv.org/abs/1909.00948)
## Highlights
- **Simple Algorithm:** Object as a point is a simple and elegant approach for object detections, it models an object as a single point -- the center point of its bounding box.
- **Simple Network:** A U-shape HarDNet-85 with Conv3x3, ReLU, bilinear interpolation upsampling, and Sum-to-1 layer normalization comprise the whole network. There is NO dilation/deformable convolution, nor any novel activation function being used.
- **Efficient:** CenterNet-HarDNet85 model achieves **44.3** COCO mAP (test-dev) while running at **45** FPS on an NVIDIA GTX-1080Ti GPU.
- **State of The Art:** CenterNet-HarDNet85's is faster than YOLOv4, SpineNet-49, and EfficientDet-D2
## Main results
### Object Detection on COCO validation
| Backbone | #Param | GFLOPs | Train
Size | Input Size | mAP
(val) | mAP
(test-dev) | FPS
(1080ti) | Model |
| :----------: | :----: | :----: | :-----------: | :--------: | :------------: | :---------------: |:--------------: | :---: |
| HarDNet85 | 37.2M | 123.9 | 608 | 608x608 | 44.9 | 45.3 | 32 | [Download](https://ping-chao.com/hardnet/centernet_hardnet85_coco_608.pth) |
| HarDNet85 | 37.2M | 87.9 | 512 | 512x512 | 44.3 | 44.3 | 45 | [Download](https://ping-chao.com/hardnet/centernet_hardnet85_coco.pth) |
| HarDNet85 | 37.2M | 58.0 | 512 | 416x416 | 42.4 | 42.4 | 53 | as above |
The model was trained with Pytorch 1.5.0 on two V100-32GB GPU for **300 epochs**(eight days). Please see [experiment](experiments/ctdet_coco_hardnet85_2x.sh) for detailed hyperperameters. Using more GPUs may require sync-batchNorm to maintain the accuracy, and the learning rate may also need to adjust. You can also check if your training/val loss is roughly aligned with our [log](experiments/ctdet_coco_hardnet85_2x.log)
HarDNet-85 results (no flipping) on COCO **test-dev2017**:
```
//512x512:
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.443
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.629
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.483
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.235
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.476
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.590
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.355
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.579
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.612
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.381
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.660
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.805
//608x608:
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.453
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.638
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.495
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.255
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.485
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.588
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.359
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.591
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.625
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.402
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.669
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.804
```
### Comparison with other state-of-the-art works
| Method | mAP(test-dev) | FPS @ GPU | Training epochs |
| :----------: | :-------------: | :-------: | :--------------: |
| CenterNet-HarDNet85 | 44.3 | 45 @ 1080Ti | 300 |
| [YOLOv4](https://github.com/pjreddie/darknet) | 43.5 | 33 @ P100 | 300 |
| [SpineNet-49](https://github.com/tensorflow/tpu/blob/master/models/official/detection/MODEL_ZOO.md) | 42.8 | 42 @ V100 | 350 |
| [EfficientDet-D2](https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch) | 43.0 | 26.5 @ 2080Ti | 500 |
## Installation
Please refer to [INSTALL.md](readme/INSTALL.md) for installation instructions.
## Use CenterNet
For object detection on images/ video, run:
~~~
python demo.py ctdet --demo /path/to/image/or/folder/or/video --arch hardnet_85 --load_model centernet_hardnet85_coco.pth
~~~
We provide example images in `CenterNet_ROOT/images/` (from [Detectron](https://github.com/facebookresearch/Detectron/tree/master/demo)). If set up correctly, the output should look like