Unverified Commit d7067e44 authored by Wenwei Zhang's avatar Wenwei Zhang Committed by GitHub
Browse files

Bump version to v1.1.0rc2

Bump to v1.1.0rc2
parents 28fe73d2 fb0e57e5
...@@ -360,7 +360,7 @@ class BaseInstance3DBoxes(object): ...@@ -360,7 +360,7 @@ class BaseInstance3DBoxes(object):
with_yaw=boxes_list[0].with_yaw) with_yaw=boxes_list[0].with_yaw)
return cat_boxes return cat_boxes
def to(self, device): def to(self, device, *args, **kwargs):
"""Convert current boxes to a specific device. """Convert current boxes to a specific device.
Args: Args:
...@@ -372,7 +372,7 @@ class BaseInstance3DBoxes(object): ...@@ -372,7 +372,7 @@ class BaseInstance3DBoxes(object):
""" """
original_type = type(self) original_type = type(self)
return original_type( return original_type(
self.tensor.to(device), self.tensor.to(device, *args, **kwargs),
box_dim=self.box_dim, box_dim=self.box_dim,
with_yaw=self.with_yaw) with_yaw=self.with_yaw)
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
from typing import Dict, List, Optional, Tuple, Union from typing import Dict, List, Optional, Tuple, Union
import torch import torch
from mmdet.structures import DetDataSample
from mmengine.structures import InstanceData from mmengine.structures import InstanceData
from mmdet.structures import DetDataSample
from .point_data import PointData from .point_data import PointData
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
from mmdet.structures.bbox import bbox_overlaps
from mmdet3d.registry import TASK_UTILS from mmdet3d.registry import TASK_UTILS
from mmdet3d.structures.bbox_3d import get_box_type from mmdet3d.structures.bbox_3d import get_box_type
from mmdet.structures.bbox import bbox_overlaps
@TASK_UTILS.register_module() @TASK_UTILS.register_module()
......
# Copyright (c) OpenMMLab. All rights reserved.
from .data_utils import (create_data_info_after_loading,
create_dummy_data_info,
create_mono3d_data_info_after_loading)
from .model_utils import (create_detector_inputs, get_detector_cfg,
get_model_cfg, setup_seed)
__all__ = [
'create_dummy_data_info', 'create_data_info_after_loading',
'create_mono3d_data_info_after_loading', 'create_detector_inputs',
'get_detector_cfg', 'get_model_cfg', 'setup_seed'
]
...@@ -3,6 +3,7 @@ import numpy as np ...@@ -3,6 +3,7 @@ import numpy as np
# create a dummy `results` to test the pipeline # create a dummy `results` to test the pipeline
from mmdet3d.datasets import LoadAnnotations3D, LoadPointsFromFile from mmdet3d.datasets import LoadAnnotations3D, LoadPointsFromFile
from mmdet3d.datasets.transforms.loading import LoadImageFromFileMono3D
from mmdet3d.structures import LiDARInstance3DBoxes from mmdet3d.structures import LiDARInstance3DBoxes
...@@ -20,6 +21,10 @@ def create_dummy_data_info(with_ann=True): ...@@ -20,6 +21,10 @@ def create_dummy_data_info(with_ann=True):
-1.5808]])), -1.5808]])),
'gt_labels_3d': 'gt_labels_3d':
np.array([1]), np.array([1]),
'centers_2d':
np.array([[765.04, 214.56]]),
'depths':
np.array([8.410]),
'num_lidar_pts': 'num_lidar_pts':
np.array([377]), np.array([377]),
'difficulty': 'difficulty':
...@@ -134,6 +139,9 @@ def create_dummy_data_info(with_ann=True): ...@@ -134,6 +139,9 @@ def create_dummy_data_info(with_ann=True):
], ],
'bbox_label_3d': 'bbox_label_3d':
-1, -1,
'center_2d': [765.04, 214.56],
'depth':
8.410,
'num_lidar_pts': 'num_lidar_pts':
377, 377,
'difficulty': 'difficulty':
...@@ -168,3 +176,17 @@ def create_data_info_after_loading(): ...@@ -168,3 +176,17 @@ def create_data_info_after_loading():
data_info = load_points_transform(data_info) data_info = load_points_transform(data_info)
data_info_after_loading = load_anns_transform(data_info) data_info_after_loading = load_anns_transform(data_info)
return data_info_after_loading return data_info_after_loading
def create_mono3d_data_info_after_loading():
load_anns_transform = LoadAnnotations3D(
with_bbox=True,
with_label=True,
with_bbox_3d=True,
with_label_3d=True,
with_bbox_depth=True)
load_img_transform = LoadImageFromFileMono3D()
data_info = create_dummy_data_info()
data_info = load_img_transform(data_info)
data_info_after_loading = load_anns_transform(data_info)
return data_info_after_loading
...@@ -12,7 +12,7 @@ from mmdet3d.structures import (CameraInstance3DBoxes, DepthInstance3DBoxes, ...@@ -12,7 +12,7 @@ from mmdet3d.structures import (CameraInstance3DBoxes, DepthInstance3DBoxes,
PointData) PointData)
def _setup_seed(seed): def setup_seed(seed):
torch.manual_seed(seed) torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed) torch.cuda.manual_seed_all(seed)
np.random.seed(seed) np.random.seed(seed)
...@@ -44,7 +44,7 @@ def _get_config_module(fname): ...@@ -44,7 +44,7 @@ def _get_config_module(fname):
return config_mod return config_mod
def _get_model_cfg(fname): def get_model_cfg(fname):
"""Grab configs necessary to create a model. """Grab configs necessary to create a model.
These are deep copied to allow for safe modification of parameters without These are deep copied to allow for safe modification of parameters without
...@@ -56,7 +56,7 @@ def _get_model_cfg(fname): ...@@ -56,7 +56,7 @@ def _get_model_cfg(fname):
return model return model
def _get_detector_cfg(fname): def get_detector_cfg(fname):
"""Grab configs necessary to create a detector. """Grab configs necessary to create a detector.
These are deep copied to allow for safe modification of parameters without These are deep copied to allow for safe modification of parameters without
...@@ -73,19 +73,19 @@ def _get_detector_cfg(fname): ...@@ -73,19 +73,19 @@ def _get_detector_cfg(fname):
return model return model
def _create_detector_inputs(seed=0, def create_detector_inputs(seed=0,
with_points=True, with_points=True,
with_img=False, with_img=False,
img_size=10, img_size=10,
num_gt_instance=20, num_gt_instance=20,
num_points=10, num_points=10,
points_feat_dim=4, points_feat_dim=4,
num_classes=3, num_classes=3,
gt_bboxes_dim=7, gt_bboxes_dim=7,
with_pts_semantic_mask=False, with_pts_semantic_mask=False,
with_pts_instance_mask=False, with_pts_instance_mask=False,
bboxes_3d_type='lidar'): bboxes_3d_type='lidar'):
_setup_seed(seed) setup_seed(seed)
assert bboxes_3d_type in ('lidar', 'depth', 'cam') assert bboxes_3d_type in ('lidar', 'depth', 'cam')
bbox_3d_class = { bbox_3d_class = {
'lidar': LiDARInstance3DBoxes, 'lidar': LiDARInstance3DBoxes,
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import mmdet
from mmengine.utils import get_git_hash from mmengine.utils import get_git_hash
from mmengine.utils.dl_utils import collect_env as collect_base_env from mmengine.utils.dl_utils import collect_env as collect_base_env
import mmdet
import mmdet3d import mmdet3d
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
"""Collecting some commonly used type hint in MMDetection3D.""" """Collecting some commonly used type hint in MMDetection3D."""
from typing import List, Optional, Union from typing import List, Optional, Union
from mmdet.models.task_modules.samplers import SamplingResult
from mmengine.config import ConfigDict from mmengine.config import ConfigDict
from mmengine.structures import InstanceData from mmengine.structures import InstanceData
from mmdet3d.structures.det3d_data_sample import Det3DDataSample from mmdet3d.structures.det3d_data_sample import Det3DDataSample
from mmdet.models.task_modules.samplers import SamplingResult
# Type hint of config data # Type hint of config data
ConfigType = Union[ConfigDict, dict] ConfigType = Union[ConfigDict, dict]
......
# Copyright (c) Open-MMLab. All rights reserved. # Copyright (c) Open-MMLab. All rights reserved.
__version__ = '1.1.0rc1' __version__ = '1.1.0rc2'
short_version = __version__ short_version = __version__
def parse_version_info(version_str): def parse_version_info(version_str):
"""Parse a version string into a tuple.
Args:
version_str (str): The version string.
Returns:
tuple[int | str]: The version info, e.g., "1.3.0" is parsed into
(1, 3, 0), and "2.0.0rc1" is parsed into (2, 0, 0, 'rc1').
"""
version_info = [] version_info = []
for x in version_str.split('.'): for x in version_str.split('.'):
if x.isdigit(): if x.isdigit():
......
...@@ -8,30 +8,28 @@ import numpy as np ...@@ -8,30 +8,28 @@ import numpy as np
from matplotlib.collections import PatchCollection from matplotlib.collections import PatchCollection
from matplotlib.patches import PathPatch from matplotlib.patches import PathPatch
from matplotlib.path import Path from matplotlib.path import Path
from mmengine.dist import master_only
from torch import Tensor
from mmdet3d.structures.bbox_3d.box_3d_mode import Box3DMode
from mmdet.visualization import DetLocalVisualizer from mmdet.visualization import DetLocalVisualizer
from mmengine.dist import master_only
try:
import open3d as o3d
from open3d import geometry
except ImportError:
raise ImportError(
'Please run "pip install open3d" to install open3d first.')
from mmengine.structures import InstanceData from mmengine.structures import InstanceData
from mmengine.visualization.utils import check_type, tensor2ndarray from mmengine.visualization.utils import check_type, tensor2ndarray
from torch import Tensor
from mmdet3d.registry import VISUALIZERS from mmdet3d.registry import VISUALIZERS
from mmdet3d.structures import (BaseInstance3DBoxes, CameraInstance3DBoxes, from mmdet3d.structures import (BaseInstance3DBoxes, CameraInstance3DBoxes,
Coord3DMode, DepthInstance3DBoxes, Coord3DMode, DepthInstance3DBoxes,
Det3DDataSample, LiDARInstance3DBoxes, Det3DDataSample, LiDARInstance3DBoxes,
PointData, points_cam2img) PointData, points_cam2img)
from mmdet3d.structures.bbox_3d.box_3d_mode import Box3DMode
from .vis_utils import (proj_camera_bbox3d_to_img, proj_depth_bbox3d_to_img, from .vis_utils import (proj_camera_bbox3d_to_img, proj_depth_bbox3d_to_img,
proj_lidar_bbox3d_to_img, to_depth_mode) proj_lidar_bbox3d_to_img, to_depth_mode)
try:
import open3d as o3d
from open3d import geometry
from open3d.visualization import Visualizer
except ImportError:
o3d = geometry = Visualizer = None
@VISUALIZERS.register_module() @VISUALIZERS.register_module()
class Det3DLocalVisualizer(DetLocalVisualizer): class Det3DLocalVisualizer(DetLocalVisualizer):
...@@ -120,7 +118,15 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -120,7 +118,15 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
self.set_points(points, pcd_mode=pcd_mode, frame_cfg=frame_cfg) self.set_points(points, pcd_mode=pcd_mode, frame_cfg=frame_cfg)
self.pts_seg_num = 0 self.pts_seg_num = 0
def _initialize_o3d_vis(self, frame_cfg) -> tuple: def _clear_o3d_vis(self) -> None:
"""Clear open3d vis."""
if hasattr(self, 'o3d_vis'):
del self.o3d_vis
del self.pcd
del self.points_colors
def _initialize_o3d_vis(self, frame_cfg) -> Visualizer:
"""Initialize open3d vis according to frame_cfg. """Initialize open3d vis according to frame_cfg.
Args: Args:
...@@ -130,6 +136,9 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -130,6 +136,9 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
Returns: Returns:
:obj:`o3d.visualization.Visualizer`: Created open3d vis. :obj:`o3d.visualization.Visualizer`: Created open3d vis.
""" """
if o3d is None or geometry is None:
raise ImportError(
'Please run "pip install open3d" to install open3d first.')
o3d_vis = o3d.visualization.Visualizer() o3d_vis = o3d.visualization.Visualizer()
o3d_vis.create_window() o3d_vis.create_window()
# create coordinate frame # create coordinate frame
...@@ -141,8 +150,8 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -141,8 +150,8 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
def set_points(self, def set_points(self,
points: np.ndarray, points: np.ndarray,
pcd_mode: int = 0, pcd_mode: int = 0,
vis_mode: str = 'replace',
frame_cfg: dict = dict(size=1, origin=[0, 0, 0]), frame_cfg: dict = dict(size=1, origin=[0, 0, 0]),
vis_task: str = 'lidar_det',
points_color: Tuple = (0.5, 0.5, 0.5), points_color: Tuple = (0.5, 0.5, 0.5),
points_size: int = 2, points_size: int = 2,
mode: str = 'xyz') -> None: mode: str = 'xyz') -> None:
...@@ -154,11 +163,15 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -154,11 +163,15 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
pcd_mode (int): The point cloud mode (coordinates): pcd_mode (int): The point cloud mode (coordinates):
0 represents LiDAR, 1 represents CAMERA, 2 0 represents LiDAR, 1 represents CAMERA, 2
represents Depth. Defaults to 0. represents Depth. Defaults to 0.
vis_mode (str): The visualization mode in Open3D:
'replace': Replace the existing point cloud with
input point cloud.
'add': Add input point cloud into existing point
cloud.
Defaults to 'replace'.
frame_cfg (dict): The coordinate frame config while Open3D frame_cfg (dict): The coordinate frame config while Open3D
visualization initialization. visualization initialization.
Defaults to dict(size=1, origin=[0, 0, 0]). Defaults to dict(size=1, origin=[0, 0, 0]).
vis_task (str): Visualiztion task, it includes:
'lidar_det', 'multi-modality_det', 'mono_det', 'lidar_seg'.
point_color (tuple[float], optional): the color of points. point_color (tuple[float], optional): the color of points.
Default: (0.5, 0.5, 0.5). Default: (0.5, 0.5, 0.5).
points_size (int, optional): the size of points to show points_size (int, optional): the size of points to show
...@@ -167,6 +180,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -167,6 +180,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
available mode ['xyz', 'xyzrgb']. Default: 'xyz'. available mode ['xyz', 'xyzrgb']. Default: 'xyz'.
""" """
assert points is not None assert points is not None
assert vis_mode in ('replace', 'add')
check_type('points', points, np.ndarray) check_type('points', points, np.ndarray)
if not hasattr(self, 'o3d_vis'): if not hasattr(self, 'o3d_vis'):
...@@ -176,7 +190,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -176,7 +190,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
if pcd_mode != Coord3DMode.DEPTH: if pcd_mode != Coord3DMode.DEPTH:
points = Coord3DMode.convert(points, pcd_mode, Coord3DMode.DEPTH) points = Coord3DMode.convert(points, pcd_mode, Coord3DMode.DEPTH)
if hasattr(self, 'pcd') and vis_task != 'lidar_seg': if hasattr(self, 'pcd') and vis_mode != 'add':
self.o3d_vis.remove_geometry(self.pcd) self.o3d_vis.remove_geometry(self.pcd)
# set points size in Open3D # set points size in Open3D
...@@ -524,8 +538,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -524,8 +538,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
self.o3d_vis.add_geometry(mesh_frame) self.o3d_vis.add_geometry(mesh_frame)
seg_points = copy.deepcopy(seg_mask_colors) seg_points = copy.deepcopy(seg_mask_colors)
seg_points[:, 0] += offset seg_points[:, 0] += offset
self.set_points( self.set_points(seg_points, pcd_mode=2, vis_mode='add', mode='xyzrgb')
seg_points, vis_task='lidar_seg', pcd_mode=2, mode='xyzrgb')
def _draw_instances_3d(self, data_input: dict, instances: InstanceData, def _draw_instances_3d(self, data_input: dict, instances: InstanceData,
input_meta: dict, vis_task: str, input_meta: dict, vis_task: str,
...@@ -559,7 +572,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -559,7 +572,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
else: else:
bboxes_3d_depth = bboxes_3d.clone() bboxes_3d_depth = bboxes_3d.clone()
self.set_points(points, pcd_mode=2, vis_task=vis_task) self.set_points(points, pcd_mode=2)
self.draw_bboxes_3d(bboxes_3d_depth) self.draw_bboxes_3d(bboxes_3d_depth)
data_3d['bboxes_3d'] = tensor2ndarray(bboxes_3d_depth.tensor) data_3d['bboxes_3d'] = tensor2ndarray(bboxes_3d_depth.tensor)
...@@ -614,7 +627,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -614,7 +627,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
pts_color = palette[pts_sem_seg] pts_color = palette[pts_sem_seg]
seg_color = np.concatenate([points[:, :3], pts_color], axis=1) seg_color = np.concatenate([points[:, :3], pts_color], axis=1)
self.set_points(points, pcd_mode=2, vis_task='lidar_seg') self.set_points(points, pcd_mode=2, vis_mode='add')
self.draw_seg_mask(seg_color) self.draw_seg_mask(seg_color)
@master_only @master_only
...@@ -644,6 +657,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -644,6 +657,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
if save_path is not None: if save_path is not None:
self.o3d_vis.capture_screen_image(save_path) self.o3d_vis.capture_screen_image(save_path)
self.o3d_vis.destroy_window() self.o3d_vis.destroy_window()
self._clear_o3d_vis()
if hasattr(self, '_image'): if hasattr(self, '_image'):
if drawn_img_3d is None: if drawn_img_3d is None:
...@@ -662,7 +676,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -662,7 +676,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
show: bool = False, show: bool = False,
wait_time: float = 0, wait_time: float = 0,
out_file: Optional[str] = None, out_file: Optional[str] = None,
save_path: Optional[str] = None, o3d_save_path: Optional[str] = None,
vis_task: str = 'mono_det', vis_task: str = 'mono_det',
pred_score_thr: float = 0.3, pred_score_thr: float = 0.3,
step: int = 0) -> None: step: int = 0) -> None:
...@@ -673,9 +687,8 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -673,9 +687,8 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
ground truth and the right image is the prediction. ground truth and the right image is the prediction.
- If ``show`` is True, all storage backends are ignored, and - If ``show`` is True, all storage backends are ignored, and
the images will be displayed in a local window. the images will be displayed in a local window.
- If ``out_file`` is specified, the drawn point cloud or - If ``out_file`` is specified, the drawn image will be saved to
image will be saved to ``out_file``. t is usually used when ``out_file``. It is usually used when the display is not available.
the display is not available.
Args: Args:
name (str): The image identifier. name (str): The image identifier.
...@@ -691,8 +704,8 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -691,8 +704,8 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
image. Default to False. image. Default to False.
wait_time (float): The interval of show (s). Defaults to 0. wait_time (float): The interval of show (s). Defaults to 0.
out_file (str): Path to output file. Defaults to None. out_file (str): Path to output file. Defaults to None.
save_path (str, optional): Path to save open3d visualized results. o3d_save_path (str, optional): Path to save open3d visualized
Default: None. results Default: None.
vis-task (str): Visualization task. Defaults to 'mono_det'. vis-task (str): Visualization task. Defaults to 'mono_det'.
pred_score_thr (float): The threshold to visualize the bboxes pred_score_thr (float): The threshold to visualize the bboxes
and masks. Defaults to 0.3. and masks. Defaults to 0.3.
...@@ -786,8 +799,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer): ...@@ -786,8 +799,7 @@ class Det3DLocalVisualizer(DetLocalVisualizer):
if show: if show:
self.show( self.show(
vis_task, o3d_save_path,
save_path,
drawn_img_3d, drawn_img_3d,
drawn_img, drawn_img,
win_name=name, win_name=name,
......
# 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.
## Description
<!-- Share any information you would like others to know. For example:
Author: @xxx.
This is an implementation of \[XXX\]. -->
This project implements a dummy ResNet wrapper, which literally does nothing new but prints "hello world" during initialization.
## Usage
<!-- For a typical model, this section should contain the commands for training and testing. You are also suggested to dump your environment specification to env.yml by `conda env export > env.yml`. -->
### 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
<!-- List the results as usually done in other model's README. [Example](https://github.com/open-mmlab/mmdetection3d/edit/dev-1.x/configs/fcos3d/README.md)
You should claim whether this is based on the pre-trained weights, which are converted from the official release; or it's a reproduced result obtained from retraining the model in this project. -->
| 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
<!-- You may remove this section if not applicable. -->
```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
<!-- Here is a checklist illustrating a usual development workflow of a successful project, and also serves as an overview of this project's progress. The PIC (person in charge) or contributors of this project should check all the items that they believe have been finished, which will further be verified by codebase maintainers via a PR.
OpenMMLab's maintainer will review the code to ensure the project's quality. Reaching the first milestone means that this project suffices the minimum requirement of being merged into 'projects/'. But this project is only eligible to become a part of the core package upon attaining the last milestone.
Note that keeping this section up-to-date is crucial not only for this project's developers but the entire community, since there might be some other contributors joining this project and deciding their starting point from this list. It also helps maintainers accurately estimate time and effort on further code polishing, if needed.
A project does not necessarily have to be finished in a single PR, but it's essential for the project to at least reach the first milestone in its very first PR. -->
- [ ] Milestone 1: PR-ready, and acceptable to be one of the `projects/`.
- [ ] Finish the code
<!-- The code's design shall follow existing interfaces and convention. For example, each model component should be registered into `mmdet3d.registry.MODELS` and configurable via a config file. -->
- [ ] Basic docstrings & proper citation
<!-- Each major object should contain a docstring, describing its functionality and arguments. If you have adapted the code from other open-source projects, don't forget to cite the source project in docstring and make sure your behavior is not against its license. Typically, we do not accept any code snippet under GPL license. [A Short Guide to Open Source Licenses](https://medium.com/nationwide-technology/a-short-guide-to-open-source-licenses-cf5b1c329edd) -->
- [ ] Test-time correctness
<!-- If you are reproducing the result from a paper, make sure your model's inference-time performance matches that in the original paper. The weights usually could be obtained by simply renaming the keys in the official pre-trained weights. This test could be skipped though, if you are able to prove the training-time correctness and check the second milestone. -->
- [ ] A full README
<!-- As this template does. -->
- [ ] Milestone 2: Indicates a successful model implementation.
- [ ] Training-time correctness
<!-- If you are reproducing the result from a paper, checking this item means that you should have trained your model from scratch based on the original paper's specification and verified that the final result matches the report within a minor error range. -->
- [ ] Milestone 3: Good to be a part of our core package!
- [ ] Type hints and docstrings
<!-- Ideally *all* the methods should have [type hints](https://www.pythontutorial.net/python-basics/python-type-hints/) and [docstrings](https://google.github.io/styleguide/pyguide.html#381-docstrings). [Example](https://github.com/open-mmlab/mmdetection3d/blob/dev-1.x/mmdet3d/models/detectors/fcos_mono3d.py) -->
- [ ] Unit tests
<!-- Unit tests for each module are required. [Example](https://github.com/open-mmlab/mmdetection3d/blob/dev-1.x/tests/test_models/test_dense_heads/test_fcos_mono3d_head.py) -->
- [ ] Code polishing
<!-- Refactor your code according to reviewer's comment. -->
- [ ] Metafile.yml
<!-- It will be parsed by MIM and Inferencer. [Example](https://github.com/open-mmlab/mmdetection3d/blob/dev-1.x/configs/fcos3d/metafile.yml) -->
- [ ] Move your modules into the core package following the codebase's file hierarchy structure.
<!-- In particular, you may have to refactor this README into a standard one. [Example](/configs/textdet/dbnet/README.md) -->
- [ ] Refactor your modules into the core package following the codebase's file hierarchy structure.
_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'
from .dummy_resnet import DummyResNet
__all__ = ['DummyResNet']
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)
mmcv-full>=2.0.0rc0,<2.1.0 mmcv>=2.0.0rc0,<2.1.0
mmdet>=3.0.0rc0,<3.1.0 mmdet>=3.0.0rc0,<3.1.0
mmengine>=0.1.0,<1.0.0
mmcv>=1.4.8 mmcv>=2.0.0rc0
mmdet>=2.24.0 mmdet>=3.0.0rc0
mmsegmentation>=0.20.1 mmengine>=0.1.0
torch torch
torchvision torchvision
...@@ -7,8 +7,8 @@ SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true ...@@ -7,8 +7,8 @@ SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true
line_length = 79 line_length = 79
multi_line_output = 0 multi_line_output = 0
extra_standard_library = setuptools extra_standard_library = setuptools
known_first_party = mmdet,mmseg,mmdet3d known_first_party = mmdet3d
known_third_party = cv2,imageio,indoor3d_util,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,pytorch_sphinx_theme,recommonmark,requests,scannet_utils,scipy,seaborn,shapely,skimage,sphinx,tensorflow,terminaltables,torch,trimesh,ts,waymo_open_dataset known_third_party = cv2,imageio,indoor3d_util,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,mmdet,mmengine,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,pytorch_sphinx_theme,recommonmark,requests,scannet_utils,scipy,seaborn,shapely,skimage,sphinx,tensorflow,terminaltables,torch,trimesh,ts,waymo_open_dataset
no_lines_before = STDLIB,LOCALFOLDER no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY default_section = THIRDPARTY
......
...@@ -54,7 +54,7 @@ def test_getitem(): ...@@ -54,7 +54,7 @@ def test_getitem():
img='training/image_2', img='training/image_2',
), ),
pipeline=pipeline, pipeline=pipeline,
metainfo=dict(CLASSES=classes), metainfo=dict(classes=classes),
modality=modality) modality=modality)
kitti_dataset.prepare_data(0) kitti_dataset.prepare_data(0)
...@@ -94,7 +94,7 @@ def test_getitem(): ...@@ -94,7 +94,7 @@ def test_getitem():
img='training/image_2', img='training/image_2',
), ),
pipeline=pipeline, pipeline=pipeline,
metainfo=dict(CLASSES=['Car']), metainfo=dict(classes=['Car']),
modality=modality) modality=modality)
input_dict = car_kitti_dataset.get_data_info(0) input_dict = car_kitti_dataset.get_data_info(0)
...@@ -105,4 +105,4 @@ def test_getitem(): ...@@ -105,4 +105,4 @@ def test_getitem():
assert ann_info['gt_labels_3d'].dtype == np.int64 assert ann_info['gt_labels_3d'].dtype == np.int64
# all instance have been filtered by classes # all instance have been filtered by classes
assert len(ann_info['gt_labels_3d']) == 0 assert len(ann_info['gt_labels_3d']) == 0
assert len(car_kitti_dataset.metainfo['CLASSES']) == 1 assert len(car_kitti_dataset.metainfo['classes']) == 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment