skhadem / 3D-BoundingBox

PyTorch implementation for 3D Bounding Box Estimation Using Deep Learning and Geometry
MIT License
435 stars 96 forks source link

Dataset label "Location" property #10

Open haorui-ji opened 4 years ago

haorui-ji commented 4 years ago

Hi,

I'm wondering how do you construct your dataset from Kitti, especially the "Location" keyword in the label. I don't quite understand how the following lines of code works from torch_lib/Dataset.py

    Location = [line[11], line[12], line[13]] # x, y, z
    Location[1] -= Dimension[0] / 2 # bring the KITTI center up to the middle of the object

Why does the y component of "Location" corresponds to the x component of "Dimension"? This also appears in library/Math.py in the calc_location() function:

# using a different coord system
dx = dimension[2] / 2
dy = dimension[0] / 2
dz = dimension[1] / 2

Why you are switching the coordinate system and can you please tell me how do you parse the raw data regarding location information from Kitti dataset?

p.s. I noticed this because I try to read ground truth label directly from the generated dataset and plot it using your plot_3d_box(img, cam_to_img, orient, dimensions, location) function. However, there exists serious offset in location, especially in y coordinates. Can you please tell me how to read ground truth location information from the generated dataset and plot it correctly?

Thank you so much~

skhadem commented 4 years ago

If I remember correctly, KITTI stores dimension in height, width, length, which is why the height/2 must be subtracted from y. In Math.py, I was trying to match up the coordinate system with the paper, which is slightly different then the dataset.

I would love to try and help you plot the ground truth. I spent a lot of time doing that, since for me visualization of data is the most effective way to figure out what is happening. How are you reading in the ground truth location?