Opera relies on several basic packages such as MMCV, MMDetection, etc, so you need to install these packages at first.
-
Install
mmcv
cd /ROOT/Opera/third_party/mmcv MMCV_WITH_OPS=1 pip install -e .
-
Install
mmdet
cd /ROOT/Opera/third_party/mmdetection pip install -e .
-
Install
opera
cd /ROOT/Opera pip install -r requirements.txt pip install -e .
If you need to add a new project in Opera, please follow:
- Add dataset definition codes under
opera/datasets
, and useDATASET
to register the new defined dataset class. - Add data pre-processing codes under
opera/datasets/pipelines
, and usePIPELINE
to register the new defined pipeline class. - Add model definition codes about detectors/segmentors, backbones, neck, heads, etc, and use corresponding decorators to register them.
- Add core modules for your projects under
opera/core
. If the added module is a anchor generator or box sampler, then you must use corresponding decorators to register it. - (Optional) Add compilable operators for your projects under
opera/ops
, and create corresponding Python interfaces. - Add unit-test cases under
tests
to cover the essential parts in your project.
-
Opera allows users to call all the modules defined in
opera
andthird_party
. -
You need to indicate the source of the dataset or model explicitly like
model1 = dict(type='mmdet.RetinaNet') model2 = dict(type='opera.PETR') data1 = dict(train=dict(type='mmdet.CocoDataset')) data2 = dict(train=dict(type='opera.CocoPoseDataset'))
-
Install all the dependencies.
pip install -r requirements/tests.txt -r requirements/optional.txt
-
Run all the unit-test cases and check the coverage.
coverage run --branch --source opera -m pytest tests/ coverage xml coverage report -m
- Opera allows the same name from different scopes. For example, there can be a model named
ResNet
inopera
and a model with the same name inmmdet
. You just need to indicate the source when you want to call it in a configuration. - The default scope of a registered module in a configuration is
opera
, but we strongly recommend to indicate all the modules' scope explicitly to avoid unknowable errors. - Please contain the abstract and copyright information at the start of your new added codes.
- The code style should follow PEP8.