Unverified Commit 395b86d7 authored by Zephyr's avatar Zephyr Committed by GitHub
Browse files

Dev 1.x Adapt PETR to mmcv v2 version dataset (#2800)

parent 5c0613be
...@@ -16,7 +16,7 @@ This is an implementation of *PETR*. ...@@ -16,7 +16,7 @@ This is an implementation of *PETR*.
In MMDet3D's root directory, run the following command to train the model: In MMDet3D's root directory, run the following command to train the model:
```bash ```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 ### Testing commands
...@@ -24,7 +24,7 @@ python tools/train.py projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320. ...@@ -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: In MMDet3D's root directory, run the following command to test the model:
```bash ```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 ## Results
......
...@@ -446,7 +446,7 @@ class PETRHead(AnchorFreeHead): ...@@ -446,7 +446,7 @@ class PETRHead(AnchorFreeHead):
masks = x.new_ones((batch_size, num_cams, input_img_h, input_img_w)) masks = x.new_ones((batch_size, num_cams, input_img_h, input_img_w))
for img_id in range(batch_size): for img_id in range(batch_size):
for cam_id in range(num_cams): 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 masks[img_id, cam_id, :img_h, :img_w] = 0
x = self.input_proj(x.flatten(0, 1)) x = self.input_proj(x.flatten(0, 1))
x = x.view(batch_size, num_cams, *x.shape[-3:]) x = x.view(batch_size, num_cams, *x.shape[-3:])
......
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