Whim, wanted to run a CenterNet detection Chou Chou. . . Ma eggs, there are unofficial layer
One. Download good CenterNet Source
https://github.com/xingyizhou/CenterNet
two. Note that you need VS 2017, or else behind you is not fun
three. build nms
cd src\lib\external
python setup.py build_ext --inplace
The amount, you will get an error drops. Open setup.py, comment the following sentence:
#extra_compile_args=["-Wno-cpp", "-Wno-unused-function"]
four. build DCN2
Original, can not play because of a pytorch 0.4. Go here to download covered under:
https://github.com/CharlesShang/DCNv2
Then, not finished, oh, a code must be modified:
//extern THCState *state;
THCState *state = at::globalContext().lazyInitCUDA(); // Modified
Well, you can compile:
cd src\lib\models\networks\DCNv2
python setup.py build develop
OK, OK, you can run demo.py friends.
Fives. Download the model
There are many models provided by the author, just a few downloads
https://github.com/xingyizhou/CenterNet/blob/master/readme/MODEL_ZOO.md
run:
python demo.py ctdet --demo ../images/17790319373_bd19b24cfc_k.jpg --load_model ../models/ctdet_coco_dla_2x.pth
Here will download a dla34-ba72cf86.pth, very slow, it is recommended to manually download.
Flattered,