mmsegmentation/projects/example_project
谢昕辰 fd5c202bf5
[Projects] Add 'Projects/' folder, and the first example project in 0.x (#2457)
## Motivation

Introducing new models and features into OpenMMLab's algorithm libraries
has long been complained to be troublesome due to the rigorous
requirements on code quality, which could hinder the fast iteration of
SOTA models and might discourage potential contributors from sharing
their latest outcome here.

Ref: https://github.com/open-mmlab/mmsegmentation/pull/2412

## Modification

This PR adds a new `projects/` folder, which will be a place for some
experimental models/features. Implementations inside might be not quite
perfect but already fine to produce some exciting results. We hope that
this PR can help us better embrace the contribution from our community.
We also add the first example project to illustrate what we expect a
good project to have.
2023-01-09 12:37:33 +08:00
..
configs [Projects] Add 'Projects/' folder, and the first example project in 0.x (#2457) 2023-01-09 12:37:33 +08:00
dummy [Projects] Add 'Projects/' folder, and the first example project in 0.x (#2457) 2023-01-09 12:37:33 +08:00
README.md [Projects] Add 'Projects/' folder, and the first example project in 0.x (#2457) 2023-01-09 12:37:33 +08:00

README.md

Dummy ResNet Wrapper

This is an example README for community projects/. We have provided detailed explanations for each field in the form of html comments, which are visible when you read the source of this README file. If you wish to submit your project to our main repository, then all the fields in this README are mandatory for others to understand what you have achieved in this implementation. For more details, read our contribution guide or approach us in Discussions.

Description

This project implements a dummy ResNet wrapper, which literally does nothing new but prints "hello world" during initialization.

Usage

Prerequisites

  • Python 3.7
  • PyTorch 1.6 or higher
  • MIM v0.33 or higher
  • MMSegmentation v0.29.1 or higher

All the commands below rely on the correct configuration of PYTHONPATH, which should point to the project's directory so that Python can locate the module files. In example_project/ root directory, run the following line to add the current directory to PYTHONPATH:

export PYTHONPATH=`pwd`:$PYTHONPATH

Training commands

mim train mmsegmentation configs/fcn_dummy-r50-d8_4xb2-40k_cityscapes-512x1024.py --work-dir work_dirs/dummy_resnet

To train on multiple GPUs, e.g. 8 GPUs, run the following command:

mim train mmsegmentation configs/fcn_dummy-r50-d8_4xb2-40k_cityscapes-512x1024.py --work-dir work_dirs/dummy_resnet --launcher pytorch --gpus 8

Testing commands

mim test mmsegmentation configs/fcn_dummy-r50-d8_4xb2-40k_cityscapes-512x1024.py --work-dir work_dirs/dummy_resnet --checkpoint ${CHECKPOINT_PATH} --eval mIoU
Method Backbone Crop Size Lr schd Mem (GB) Inf time (fps) mIoU mIoU(ms+flip) config download
FCN R-50-D8 512x1024 40000 5.7 4.17 72.25 73.36 config model | log

Citation

@misc{mmseg2020,
    title={{MMSegmentation}: OpenMMLab Semantic Segmentation Toolbox and Benchmark},
    author={MMSegmentation Contributors},
    howpublished = {\url{https://github.com/open-mmlab/mmsegmentation}},
    year={2020}
}

Checklist

Here is a checklist illustrating a usual development workflow of a successful project, and also serves as an overview of this project's progress.

  • Milestone 1: PR-ready, and acceptable to be one of the projects/.

    • Finish the code
    • Basic docstrings & proper citation
    • Test-time correctness
    • A full README
  • Milestone 2: Indicates a successful model implementation.

    • Training-time correctness
  • Milestone 3: Good to be a part of our core package!

    • Type hints and docstrings
    • Unit tests
    • Code polishing
    • Metafile.yml
  • Move your modules into the core package following the codebase's file hierarchy structure.

  • Refactor your modules into the core package following the codebase's file hierarchy structure.