Skip to content

Commit

Permalink
Dev 1.x Adapt PETR to mmcv v2 version dataset (open-mmlab#2800)
Browse files Browse the repository at this point in the history
  • Loading branch information
WendellZ524 authored Dec 13, 2023
1 parent 5c0613b commit 395b86d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions projects/PETR/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ 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

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
Expand Down
2 changes: 1 addition & 1 deletion projects/PETR/petr/petr_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def forward(self, mlvl_feats, img_metas):
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:])
Expand Down

0 comments on commit 395b86d

Please sign in to comment.