GithubHelp home page GithubHelp logo

sonwyang / centerunet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuduo35/centerunet

0.0 2.0 0.0 12.33 MB

CenterUnet: Unet version of CenterNet Objects As Points with mask branch.

License: MIT License

Python 96.26% Shell 0.07% HTML 0.39% C++ 3.28%

centerunet's Introduction

CenterUnet

CenterNet Unet Version. Base on https://github.com/xingyizhou/CenterNet. But remove focal loss convolution magic number and sigmoid clamp trick. Easier to do training and debuging. Flexible to replace backbone due to using qubel's segmentation models framework.

@inproceedings{zhou2019objects,
  title={Objects as Points},
  author={Zhou, Xingyi and Wang, Dequan and Kr{\"a}henb{\"u}hl, Philipp},
  booktitle={arXiv preprint arXiv:1904.07850},
  year={2019}
}

Major Changes

1. Turn ground truth to binary values for focal loss. Very effective for dealing with positive and negtive samples inbalance issue. Experiments show that Gaussian Distribution center point still can be learned after this change.
2. Add draw_elipse_gaussian for adaptive width/height.
3. Support unet framework, easy to add fpn and linknet which are supported by qubvel's framework.
4. One decoder for center point, one decoder for box and offset prediction. These two decoders share one encoder.
5. Output instance mask using InstanceFCN method.
6. Add instance box area size level as label. Total 6 classes, but every size has two adjacent size level labels.

Install

python3 -m pip install torch==1.4.0
python3 -m pip install torchvision==0.4.2
python3 -m pip install pretrainedmodels==0.7.4
python3 -m pip install opencv-python
python3 -m pip install numpy
python3 -m pip install pytorch
python3 -m pip install pycocotools
python3 -m pip install cython
python3 -m pip install matplotlib
python3 -m pip install progress
python3 -m pip install numba
cd external; make
cd models/py_utils/_cpools/; python3 setup.py install --user

Prepare data

1. Download coco 2017 dataset, unzip to your local directory.
2. mkdir data and setup symlink 'coco' to it.
3. Or just unzip it under data directory, depends on your choice. Like below:

(base) ubuntu@ubuntu:~/Training/CenterUnet/data/coco$ tree -L 1
.
├── annotations
├── test2017
├── train2017
├── val2017

Training

Example

Center phase train:
  python3 -u main.py --network_type unetobj --backbone resnet34 --batch_size 10 --train_phase pre_train_center --lr 0.001
Box phase train:
  python3 -u main.py --network_type unetobj --backbone resnet34 --batch_size 10 --train_phase pre_train_box --lr 0.0001 --resume

Check Result

Check ./results for temporary training results. Try ./http.sh and open http://yourip:8000
Example for inferencing one image: python3 testimg.py --without_gpu --network_type unetobj --backbone resnet34 --nms --center_thresh 0.25 --image ./testsamples/horse.jpg

Most code from:

https://github.com/xingyizhou/CenterNet
https://github.com/Duankaiwen/CenterNet
https://github.com/qubvel/segmentation_models.pytorch
https://github.com/yxlijun/Pelee.Pytorch

avatar

avatar

avatar

License

CenterUnet itself is released under the MIT License (refer to the LICENSE file for details). Portions of the code are borrowed from other open source projects mentioned above(section 'Most code from'). Please refer to the original License of these projects.

centerunet's People

Contributors

xuduo35 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.