https://github.com/xuannianz/keras-centernet
CenterNet (Objects as Points) implementation in Keras and Tensorflow
https://github.com/xuannianz/keras-centernet
centernet keras-centernet
Last synced: 5 months ago
JSON representation
CenterNet (Objects as Points) implementation in Keras and Tensorflow
- Host: GitHub
- URL: https://github.com/xuannianz/keras-centernet
- Owner: xuannianz
- License: apache-2.0
- Created: 2019-11-02T03:37:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T21:35:35.000Z (about 2 years ago)
- Last Synced: 2025-05-08T21:11:32.294Z (5 months ago)
- Topics: centernet, keras-centernet
- Language: Python
- Homepage:
- Size: 789 KB
- Stars: 182
- Watchers: 6
- Forks: 51
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# keras-CenterNet
This is an implementation of [CenterNet](https://arxiv.org/abs/1904.07850) for object detection on keras and Tensorflow. The project is based on [fizyr/keras-retinanet](https://github.com/fizyr/keras-retinanet)
and the official implementation [xingyizhou/CenterNet](https://github.com/xingyizhou/CenterNet).
Thanks for their hard work.The network is anchor-free. It is quite simple, fast and accurate.
## Test
1. I trained on Pascal VOC2012 trainval.txt + Pascal VOC2007 train.txt, and validated on Pascal VOC2007 val.txt. There are 14041 images for training and 2510 images for validation.
2. The best evaluation results (score_threshold=0.01, flip_test=True, nms=True) on VOC2007 test are:| backbone | mAP50 |
| ---- | ---- |
| resnet50 | 0.7290 |3. The weights of resnet backbones can be downloaded from [fizyr/keras-models](https://github.com/fizyr/keras-models/releases).
Pretrained centernet model is here. [baidu netdisk](https://pan.baidu.com/s/1nZz7PBIwshep5xXm-HrNCQ) extract code: pti9 [google driver](https://drive.google.com/open?id=150A04vG3AT8TC02_gBnR1oHMMJh6VFbv)
4. `python3 inference.py` to test your image by specifying image path and model path there.

## Train
### build dataset (Pascal VOC, other types please refer to [fizyr/keras-retinanet](https://github.com/fizyr/keras-retinanet))
* Download VOC2007 and VOC2012, copy all image files from VOC2007 to VOC2012.
* Append VOC2007 train.txt to VOC2012 trainval.txt.
* Overwrite VOC2012 val.txt by VOC2007 val.txt.
### train
* STEP1: `python3 train.py --freeze-backbone --gpu 0 --random-transform --compute-val-loss --batch-size 32 --steps 1000 pascal datasets/VOC2012` to start training. The init lr is 1e-3 and decays to 1e-4 when loss stops dropping down.
* STEP2: `python3 train.py --snapshot xxx.h5 --gpu 0 --random-transform --compute-val-loss --batch-size 32 --steps 1000 pascal datasets/VOC2012` to start training when val mAP can not increase during STEP1. The init lr is 1e-4 and decays to 1e-5 when loss stops dropping down.
## Evaluate
* `python3 eval/common.py` to evaluate by specifying model path there.## License
This project is released under the Apache License. Some parts are borrowed from [fizyr/keras-retinanet](https://github.com/fizyr/keras-retinanet)
and [xingyizhou/CenterNet](https://github.com/xingyizhou/CenterNet). Please take their licenses into consideration too when use this project.