Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
395b86d7
Unverified
Commit
395b86d7
authored
Dec 13, 2023
by
Zephyr
Committed by
GitHub
Dec 13, 2023
Browse files
Dev 1.x Adapt PETR to mmcv v2 version dataset (#2800)
parent
5c0613be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
projects/PETR/README.md
projects/PETR/README.md
+2
-2
projects/PETR/petr/petr_head.py
projects/PETR/petr/petr_head.py
+1
-1
No files found.
projects/PETR/README.md
View file @
395b86d7
...
@@ -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/config
s
/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/config
s
/petr_vovnet_gridmask_p4_800x320.py ${CHECKPOINT_PATH}
``
`
``
`
## Results
## Results
...
...
projects/PETR/petr/petr_head.py
View file @
395b86d7
...
@@ -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
:])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment