Comments (7)
Seems wried.
What is the mAP and NDS of your trained model?
from detr3d.
Just similar to the official provided model. I don't know why.
Seems wried.
What is the mAP and NDS of your trained model?
from detr3d.
可以检查一下pkl里面yaw的定义跟你代码里的一致不一致。 mmdet3d在比较新的版本对坐标系做了一次调整,nuScenes的预处理和以前不一样了。如果你生成PKL的mmdet3d版本和你inference的版本不一致的话会出问题。
from detr3d.
Thanks for the update! Got it.
New version of mmdet3d change the paramerization of orientations and some corrdinates. I don't know the details.
from detr3d.
Hi,
Indeed, the code is not adapted to the newly released mmdet3d v1.0. For the compability, you need to update:
Basically, the changes of the new coordinate system are:
# swap l, w (or dx, dy)
item['gt_boxes'][:, 3] = boxes[:, 4]
item['gt_boxes'][:, 4] = boxes[:, 3]
# change yaw
item['gt_boxes'][:, 6] = -boxes[:, 6] - np.pi / 2
item['gt_boxes'][:, 6] = limit_period(
item['gt_boxes'][:, 6], period=np.pi * 2)
In the mmdet3d pkl files and the corresponding functions.
(c.f. https://github.com/open-mmlab/mmdetection3d/blob/master/docs/en/compatibility.md#v100rc0)
To adapt to the changes in detr3d (similar changes can be done for DGCNN):
- for testing (the code should work for both v0.17 or v1.0 since for evaluation, we do not use pkl generated by mmdet3d):
insert:
if int(mmdet3d.__version__[0]) >= 1:
#### Begin hack adaptation to mmdet3d v1.0 ####
bboxes[:, [3, 4]] = bboxes[:, [4, 3]]
bboxes[:, 6] = -bboxes[:, 6] - np.pi / 2
#### End hack adaptation to mmdet3d v1.0 ####
right after
You can reproduce the results as in the table.
- For training, (not tested)
i) You need to re-create the labels using mmdet3d >=v1.0 creat_data.py if your mmdet3d version is >=v1.0
ii) modify the normalize_bbox function in projects/mmdet3d_plugin/core/bbox/util.py
as
def normalize_bbox(bboxes, pc_range):
# all_bbox_preds: (cx, cy, w, l, cz, h, rot_sine, rot_cosine, vx, vy)
# gt_bboxes_list: (cx, cy, cz, l, w, h, rot, vx, vy)
cx = bboxes[..., 0:1]
cy = bboxes[..., 1:2]
cz = bboxes[..., 2:3]
w = bboxes[..., 3:4].log()
l = bboxes[..., 4:5].log()
h = bboxes[..., 5:6].log()
rot = bboxes[..., 6:7]
if bboxes.size(-1) > 7:
vx = bboxes[..., 7:8]
vy = bboxes[..., 8:9]
if int(mmdet3d.__version__[0]) >= 1:
normalized_bboxes = torch.cat(
(cx, cy, l, w, cz, h, (- rot - np.pi / 2).sin(), (- rot - np.pi / 2).cos(), vx, vy), dim=-1
)
else:
normalized_bboxes = torch.cat(
(cx, cy, w, l, cz, h, rot.sin(), rot.cos(), vx, vy), dim=-1
)
else:
if int(mmdet3d.__version__[0]) >= 1:
normalized_bboxes = torch.cat(
(cx, cy, l, w, cz, h, (- rot - np.pi / 2).sin(), (- rot - np.pi / 2).cos()), dim=-1
)
else:
normalized_bboxes = torch.cat(
(cx, cy, w, l, cz, h, rot.sin(), rot.cos()), dim=-1
)
return normalized_bboxes
Have fun!
from detr3d.
Hi @yihongXU , for training if I use mmdet3d>=1.0 to create PKL and training, why should I must change normalize_bbox
function?
Hi, Indeed, the code is not adapted to the newly released mmdet3d v1.0. For the compability, you need to update: Basically, the changes of the new coordinate system are:
# swap l, w (or dx, dy) item['gt_boxes'][:, 3] = boxes[:, 4] item['gt_boxes'][:, 4] = boxes[:, 3] # change yaw item['gt_boxes'][:, 6] = -boxes[:, 6] - np.pi / 2 item['gt_boxes'][:, 6] = limit_period( item['gt_boxes'][:, 6], period=np.pi * 2)In the mmdet3d pkl files and the corresponding functions.
(c.f. https://github.com/open-mmlab/mmdetection3d/blob/master/docs/en/compatibility.md#v100rc0)
To adapt to the changes in detr3d (similar changes can be done for DGCNN):
- for testing (the code should work for both v0.17 or v1.0 since for evaluation, we do not use pkl generated by mmdet3d):
insert:if int(mmdet3d.__version__[0]) >= 1: #### Begin hack adaptation to mmdet3d v1.0 #### bboxes[:, [3, 4]] = bboxes[:, [4, 3]] bboxes[:, 6] = -bboxes[:, 6] - np.pi / 2 #### End hack adaptation to mmdet3d v1.0 ####right after
You can reproduce the results as in the table.
- For training, (not tested)
i) You need to re-create the labels using mmdet3d >=v1.0 creat_data.py if your mmdet3d version is >=v1.0
ii) modify the normalize_bbox function in projects/mmdet3d_plugin/core/bbox/util.pyas
def normalize_bbox(bboxes, pc_range): # all_bbox_preds: (cx, cy, w, l, cz, h, rot_sine, rot_cosine, vx, vy) # gt_bboxes_list: (cx, cy, cz, l, w, h, rot, vx, vy) cx = bboxes[..., 0:1] cy = bboxes[..., 1:2] cz = bboxes[..., 2:3] w = bboxes[..., 3:4].log() l = bboxes[..., 4:5].log() h = bboxes[..., 5:6].log() rot = bboxes[..., 6:7] if bboxes.size(-1) > 7: vx = bboxes[..., 7:8] vy = bboxes[..., 8:9] if int(mmdet3d.__version__[0]) >= 1: normalized_bboxes = torch.cat( (cx, cy, l, w, cz, h, (- rot - np.pi / 2).sin(), (- rot - np.pi / 2).cos(), vx, vy), dim=-1 ) else: normalized_bboxes = torch.cat( (cx, cy, w, l, cz, h, rot.sin(), rot.cos(), vx, vy), dim=-1 ) else: if int(mmdet3d.__version__[0]) >= 1: normalized_bboxes = torch.cat( (cx, cy, l, w, cz, h, (- rot - np.pi / 2).sin(), (- rot - np.pi / 2).cos()), dim=-1 ) else: normalized_bboxes = torch.cat( (cx, cy, w, l, cz, h, rot.sin(), rot.cos()), dim=-1 ) return normalized_bboxesHave fun!
from detr3d.
Hi @yihongXU , for training if I use mmdet3d>=1.0 to create PKL and training, why should I must change
normalize_bbox
function?Hi, Indeed, the code is not adapted to the newly released mmdet3d v1.0. For the compability, you need to update: Basically, the changes of the new coordinate system are:
# swap l, w (or dx, dy) item['gt_boxes'][:, 3] = boxes[:, 4] item['gt_boxes'][:, 4] = boxes[:, 3] # change yaw item['gt_boxes'][:, 6] = -boxes[:, 6] - np.pi / 2 item['gt_boxes'][:, 6] = limit_period( item['gt_boxes'][:, 6], period=np.pi * 2)In the mmdet3d pkl files and the corresponding functions.
(c.f. https://github.com/open-mmlab/mmdetection3d/blob/master/docs/en/compatibility.md#v100rc0)
To adapt to the changes in detr3d (similar changes can be done for DGCNN):
- for testing (the code should work for both v0.17 or v1.0 since for evaluation, we do not use pkl generated by mmdet3d):
insert:if int(mmdet3d.__version__[0]) >= 1: #### Begin hack adaptation to mmdet3d v1.0 #### bboxes[:, [3, 4]] = bboxes[:, [4, 3]] bboxes[:, 6] = -bboxes[:, 6] - np.pi / 2 #### End hack adaptation to mmdet3d v1.0 ####right after
You can reproduce the results as in the table.
- For training, (not tested)
i) You need to re-create the labels using mmdet3d >=v1.0 creat_data.py if your mmdet3d version is >=v1.0
ii) modify the normalize_bbox function in projects/mmdet3d_plugin/core/bbox/util.pyas
def normalize_bbox(bboxes, pc_range): # all_bbox_preds: (cx, cy, w, l, cz, h, rot_sine, rot_cosine, vx, vy) # gt_bboxes_list: (cx, cy, cz, l, w, h, rot, vx, vy) cx = bboxes[..., 0:1] cy = bboxes[..., 1:2] cz = bboxes[..., 2:3] w = bboxes[..., 3:4].log() l = bboxes[..., 4:5].log() h = bboxes[..., 5:6].log() rot = bboxes[..., 6:7] if bboxes.size(-1) > 7: vx = bboxes[..., 7:8] vy = bboxes[..., 8:9] if int(mmdet3d.__version__[0]) >= 1: normalized_bboxes = torch.cat( (cx, cy, l, w, cz, h, (- rot - np.pi / 2).sin(), (- rot - np.pi / 2).cos(), vx, vy), dim=-1 ) else: normalized_bboxes = torch.cat( (cx, cy, w, l, cz, h, rot.sin(), rot.cos(), vx, vy), dim=-1 ) else: if int(mmdet3d.__version__[0]) >= 1: normalized_bboxes = torch.cat( (cx, cy, l, w, cz, h, (- rot - np.pi / 2).sin(), (- rot - np.pi / 2).cos()), dim=-1 ) else: normalized_bboxes = torch.cat( (cx, cy, w, l, cz, h, rot.sin(), rot.cos()), dim=-1 ) return normalized_bboxesHave fun!
Hi,
It depends. Let say we want that the predictions are in the order as before, i.e.
l_bbox_preds: (cx, cy, w, l, cz, h, rot_sine, rot_cosine, vx, vy)
Depending the pkl version, the ordering of gt size is either (w, l, h) (v0.17) or (l, w, h) (v1.0). I adjust in the "normalize_bbox" (the function only used for gt bboxes), to keep the predictions ordering same as before. (The rotation is also changed...)
You can surely not to change during training, then the ordering of your predictions will also change, then you do not need to swap I did during inference.
Just be careful, the mmdet3D v1.0 expects .pkl in v1.0 because the data augmentation related to coordinates all suppose that you provide gt in (l, w, h) ordering.
from detr3d.
Related Issues (20)
- Raise ValueError: matrix contains invalid numeric entries HOT 1
- How to reproduce the result of ResNet50 version? HOT 1
- RuntimeError: shape '[1, 4, 1, 4, 4]' is invalid for input of size 16
- Did you tried tempotal fusion?
- Where is the python file named pillar_cosine.py ? HOT 1
- About the vov-99 pretrained checkpoint
- Question on nan
- Car detection performance of checkpoint on nuscenes mini is poor HOT 2
- How to visualize detection results on images like in the paper
- Load ckpts/pillar.pth but shows size mismatch for pts_voxel_encoder, cannot reproduce the baseline result HOT 1
- Question about NMSFreeCoder HOT 1
- Use DETR3D to train my own dataset HOT 1
- Training the model does not converge 0mAP 0 NDS score
- Welcome update to OpenMMLab 2.0
- Path problem
- Single-Camera Images
- Questions about comprehension on loss function equation
- Incompatible package versions
- about the result of mAOE
- what is meaning of self.query_embedding = nn.Embedding(self.num_query, self.embed_dims * 2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detr3d.