From bb7736e43fc4018bbf8f2731566dd52a8844e62b Mon Sep 17 00:00:00 2001 From: VVsssssk Date: Mon, 21 Nov 2022 14:49:12 +0800 Subject: [PATCH 1/3] add project in mmdet3d --- .circleci/config.yml | 1 + projects/example_project/README.md | 115 ++++++++++++++++++ ...affe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py | 7 ++ projects/example_project/dummy/__init__.py | 3 + .../example_project/dummy/dummy_resnet.py | 15 +++ 5 files changed, 141 insertions(+) create mode 100644 projects/example_project/README.md create mode 100644 projects/example_project/configs/fcos3d_dummy-resnet-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py create mode 100644 projects/example_project/dummy/__init__.py create mode 100644 projects/example_project/dummy/dummy_resnet.py diff --git a/.circleci/config.yml b/.circleci/config.yml index ee839f2c4..af5086c72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,6 +26,7 @@ workflows: tools/.* lint_only false configs/.* lint_only false .circleci/.* lint_only false + projects/.* lint_only false base-revision: dev-1.x # this is the path of the configuration we should trigger once # path filtering and pipeline parameter value updates are diff --git a/projects/example_project/README.md b/projects/example_project/README.md new file mode 100644 index 000000000..8aeff84f2 --- /dev/null +++ b/projects/example_project/README.md @@ -0,0 +1,115 @@ +# 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](https://mmocr.readthedocs.io/en/dev-1.x/notes/contribution_guide.html) or approach us in [Discussions](https://github.com/open-mmlab/mmocr/discussions). + +## Description + + + +This project implements a dummy ResNet wrapper, which literally does nothing new but prints "hello world" during initialization. + +## Usage + + + +### Training commands + +In MMDet3D's root directory, run the following command to train the model: + +```bash +python tools/train.py projects/example_project/configs/fcos3d_dummy-resnet-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py +``` + +### Testing commands + +In MMDet3D's root directory, run the following command to test the model: + +```bash +python tools/test.py projects/example_project/configs/fcos3d_dummy-resnet-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py ${CHECKPOINT_PATH} +``` + +## Results + + + +| Backbone | Lr schd | Mem (GB) | Inf time (fps) | mAP | NDS | Download | +| :--------------------------------------------------------------------------------------------------------------: | :-----: | :------: | :------------: | :--: | :--: | :----------------------: | +| [FCOS3D_dummy](projects/example_project/configs/fcos3d_dummy-resnet-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py) | 1x | 8.69 | | 29.8 | 37.7 | [model](<>) \| [log](<>) | + +## Citation + + + +```latex +@inproceedings{wang2021fcos3d, + title={{FCOS3D: Fully} Convolutional One-Stage Monocular 3D Object Detection}, + author={Wang, Tai and Zhu, Xinge and Pang, Jiangmiao and Lin, Dahua}, + booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops}, + year={2021} +} +# For the original 2D version +@inproceedings{tian2019fcos, + title = {{FCOS: Fully} Convolutional One-Stage Object Detection}, + author = {Tian, Zhi and Shen, Chunhua and Chen, Hao and He, Tong}, + booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)}, + year = {2019} +} +``` + +## Checklist + + + +- [ ] 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. diff --git a/projects/example_project/configs/fcos3d_dummy-resnet-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py b/projects/example_project/configs/fcos3d_dummy-resnet-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py new file mode 100644 index 000000000..4f19c0cea --- /dev/null +++ b/projects/example_project/configs/fcos3d_dummy-resnet-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py @@ -0,0 +1,7 @@ +_base_ = [ + '../../../configs/fcos3d/fcos3d_r101-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py' # noqa +] + +custom_imports = dict(imports=['projects.example_project.dummy']) + +_base_.model.backbone.type = 'DummyResNet' diff --git a/projects/example_project/dummy/__init__.py b/projects/example_project/dummy/__init__.py new file mode 100644 index 000000000..70df7896d --- /dev/null +++ b/projects/example_project/dummy/__init__.py @@ -0,0 +1,3 @@ +from .dummy_resnet import DummyResNet + +__all__ = ['DummyResNet'] diff --git a/projects/example_project/dummy/dummy_resnet.py b/projects/example_project/dummy/dummy_resnet.py new file mode 100644 index 000000000..63b5fa107 --- /dev/null +++ b/projects/example_project/dummy/dummy_resnet.py @@ -0,0 +1,15 @@ +from mmdet.models.backbones import ResNet + +from mmdet3d.registry import MODELS + + +@MODELS.register_module() +class DummyResNet(ResNet): + """Implements a dummy ResNet wrapper for demonstration purpose. + Args: + **kwargs: All the arguments are passed to the parent class. + """ + + def __init__(self, **kwargs) -> None: + print('Hello world!') + super().__init__(**kwargs) From 52b4f1ec19f66225131a3e91dbf3223d0a6568ed Mon Sep 17 00:00:00 2001 From: VVsssssk Date: Mon, 21 Nov 2022 14:53:10 +0800 Subject: [PATCH 2/3] fix --- projects/example_project/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/example_project/README.md b/projects/example_project/README.md index 8aeff84f2..feebb5945 100644 --- a/projects/example_project/README.md +++ b/projects/example_project/README.md @@ -1,6 +1,6 @@ # 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](https://mmocr.readthedocs.io/en/dev-1.x/notes/contribution_guide.html) or approach us in [Discussions](https://github.com/open-mmlab/mmocr/discussions). +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. ## Description From c3038bd8b1bb9283eb0b17b2e36b85d7d43923b1 Mon Sep 17 00:00:00 2001 From: VVsssssk Date: Mon, 21 Nov 2022 15:01:27 +0800 Subject: [PATCH 3/3] fix --- projects/example_project/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/example_project/README.md b/projects/example_project/README.md index feebb5945..d23c8e1b0 100644 --- a/projects/example_project/README.md +++ b/projects/example_project/README.md @@ -32,7 +32,7 @@ python tools/test.py projects/example_project/configs/fcos3d_dummy-resnet-caffe- ## Results - | Backbone | Lr schd | Mem (GB) | Inf time (fps) | mAP | NDS | Download | @@ -70,7 +70,7 @@ A project does not necessarily have to be finished in a single PR, but it's esse - [ ] Finish the code - + - [ ] Basic docstrings & proper citation @@ -94,11 +94,11 @@ A project does not necessarily have to be finished in a single PR, but it's esse - [ ] Type hints and docstrings - + - [ ] Unit tests - + - [ ] Code polishing @@ -106,7 +106,7 @@ A project does not necessarily have to be finished in a single PR, but it's esse - [ ] Metafile.yml - + - [ ] Move your modules into the core package following the codebase's file hierarchy structure.