Skip to content

Latest commit

 

History

History
73 lines (49 loc) · 3.74 KB

CONTRIBUTING.md

File metadata and controls

73 lines (49 loc) · 3.74 KB

How to Contribute

We'd love to accept your contributions to this project. There are just a few small guidelines you need to follow.

How to add a model into examples

Here are some steps for your reference:

  1. 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]
  2. 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:

    1. 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.

    2. meta_arch: cvpods/modeling/meta_arch

      You need to add the model architecture code (except backbone) here, for example:RetinaNet, FCOS.

  3. 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.
  4. 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.

  5. Update MODEL_ZOO:

    Add new model information in the README.md file in playground.

  6. After all the above work is completed, push the code to Gitlab and submit merge request to cvpods and cvpods_playground respectively.

    Note:

    1. 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 ./
    2. 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.