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

Merge pull request #2867 from open-mmlab/dev-1.x

Bump version to 1.4.0
parents 5c0613be 0ef13b83
Pipeline #2710 failed with stages
in 0 seconds
This diff is collapsed.
# Copyright (c) OpenMMLab. All rights reserved.
from typing import Dict, List, Optional, Tuple, Union
import torch
from mmengine.structures import InstanceData
from mmdet3d.structures import Det3DDataSample
class NeRFDet3DDataSample(Det3DDataSample):
"""A data structure interface inheirted from Det3DDataSample. Some new
attributes are added to match the NeRF-Det project.
The attributes added in ``NeRFDet3DDataSample`` are divided into two parts:
- ``gt_nerf_images`` (InstanceData): Ground truth of the images which
will be used in the NeRF branch.
- ``gt_nerf_depths`` (InstanceData): Ground truth of the depth images
which will be used in the NeRF branch if needed.
For more details and examples, please refer to the 'Det3DDataSample' file.
"""
@property
def gt_nerf_images(self) -> InstanceData:
return self._gt_nerf_images
@gt_nerf_images.setter
def gt_nerf_images(self, value: InstanceData) -> None:
self.set_field(value, '_gt_nerf_images', dtype=InstanceData)
@gt_nerf_images.deleter
def gt_nerf_images(self) -> None:
del self._gt_nerf_images
@property
def gt_nerf_depths(self) -> InstanceData:
return self._gt_nerf_depths
@gt_nerf_depths.setter
def gt_nerf_depths(self, value: InstanceData) -> None:
self.set_field(value, '_gt_nerf_depths', dtype=InstanceData)
@gt_nerf_depths.deleter
def gt_nerf_depths(self) -> None:
del self._gt_nerf_depths
SampleList = List[NeRFDet3DDataSample]
OptSampleList = Optional[SampleList]
ForwardResults = Union[Dict[str, torch.Tensor], List[NeRFDet3DDataSample],
Tuple[torch.Tensor], torch.Tensor]
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -16,7 +16,7 @@ This is an implementation of *PETR*.
In MMDet3D's root directory, run the following command to train the model:
```bash
python tools/train.py projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320.py
python tools/train.py projects/PETR/configs/petr_vovnet_gridmask_p4_800x320.py
```
### Testing commands
......@@ -24,7 +24,7 @@ python tools/train.py projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320.
In MMDet3D's root directory, run the following command to test the model:
```bash
python tools/test.py projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320.py ${CHECKPOINT_PATH}
python tools/test.py projects/PETR/configs/petr_vovnet_gridmask_p4_800x320.py ${CHECKPOINT_PATH}
```
## Results
......
......@@ -446,7 +446,7 @@ class PETRHead(AnchorFreeHead):
masks = x.new_ones((batch_size, num_cams, input_img_h, input_img_w))
for img_id in range(batch_size):
for cam_id in range(num_cams):
img_h, img_w, _ = img_metas[img_id]['img_shape'][cam_id]
img_h, img_w = img_metas[img_id]['img_shape'][cam_id]
masks[img_id, cam_id, :img_h, :img_w] = 0
x = self.input_proj(x.flatten(0, 1))
x = x.view(batch_size, num_cams, *x.shape[-3:])
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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