We'd love to accept your contributions to this project. There are just a few small guidelines you need to follow.
Here are some steps for your reference:
-
Clone cvpods and cvpods_playground, switch to your own branch:
# fork and clone cvpods git clone https://github.com/Megvii-BaseDetection/cvpods.git git checkout -b [user] # cvpods_playground cd cvpods/playground mkdir [username]
-
Add the code for the new model to cvpods:
In general, you need to add the code files of the new model to the following two paths:
-
backbone:
cvpods/modeling/backbone
This step is optional because there are already many commonly used backbones in cvpods, for example: ResNeSt, FPN.
When the backbone needed for the new model does not exist, you need to add it. -
meta_arch:
cvpods/modeling/meta_arch
You need to add the model architecture code (except backbone) here, for example:RetinaNet, FCOS.
-
-
Create a new project in the cvpods_playground, for example:
mkdir -p examples/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x
Note: When creating a new project, please follow this directory hierarchy:
examples/task/dataset/method_name/model_name
(model_name means the project name of the method in different configurations).A new project must contain the following two files:
config.py
:configuration file, used for environment and hyperparameter setting.net.py
:network structure build file, used to create builders for each module of the model, such as backbone builder, anchor generator builder, etc.
-
Train & test the model until it achieves your expectations:
# Train pods_train --num-gpus 8 # Test pods_test --num-gpus 8
Note: After the model test is completed, please make sure that the project directory contains the
README.md
file with model evaluation metrics and corresponding scores, for example: FCOS. -
Update MODEL_ZOO:
Add new model information in the
README.md
file in playground. -
After all the above work is completed, push the code to Gitlab and submit merge request to cvpods and cvpods_playground respectively.
Note:
-
Before pushing, please make sure your code style conforms to PEP8.
pip install flake8 # Run the following command in the root of cvpods and cvpods_playgroun flake8 ./
-
When submitting the merge request to playground, please attach the final checkpoint file of each model in merge request description, for example:
/url/to/your/playground/examples/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x/model_final.pth
.
-