FANG-MING / occupancy-for-nuscenes

3D occupancy
Apache License 2.0
350 stars 21 forks source link

How to save the predicted occupancy file and visualize it? #3

Closed rockywind closed 1 year ago

rockywind commented 1 year ago

Hi,

How to reproduce the predicted occupancy demo on the webpage? I think I should save the predicted occupancy files, but I don't know how to save it?

FANG-MING commented 1 year ago

Hi,

How to reproduce the predicted occupancy demo on the webpage? I think I should save the predicted occupancy files, but I don't know how to save it?

You can save the prediction results in npy format and use draw function for visualization, in that voxel is a three-dimensional tensor, the index indicates its position in three-dimensional space, and the value indicates its predicted label.

rockywind commented 1 year ago

Thanks, I have a try!

rockywind commented 1 year ago

Hi, @FANG-MING I visulized the prediction result, but it looks wrong. image This is my draw function. image This is my save prediction result function. image

FANG-MING commented 1 year ago

Hi, @FANG-MING I visulized the prediction result, but it looks wrong. image This is my draw function. image This is my save prediction result function. image

U should convert the label 17 into 0.

rockywind commented 1 year ago

Hi, @FANG-MING I filtered out the label 17, the result is below. The visualization result is different from yours. image

This is the code. image

FANG-MING commented 1 year ago

Hi, @FANG-MING I filtered out the label 17, the result is below. The visualization result is different from yours. image

This is the code. image

You should set the data_range to [0, 17].

rockywind commented 1 year ago

Hi, I set the data range to [0,18], but the result is different from yours. image image

FANG-MING commented 1 year ago

Hi, I set the data range to [0,18], but the result is different from yours. image image

Convert classname_to_color into

classname_to_color = {  # RGB.
        "noise": (0, 0, 0),  
        "movable_object.barrier": (112, 128, 144), 
        "vehicle.bicycle": (220, 20, 60),  
        "vehicle.bus.rigid": (255, 158, 0), 
        "vehicle.car": (255, 158, 0),  
        "vehicle.construction":(255, 158, 0), 
        "vehicle.motorcycle": (255, 158, 0),  
        "human.pedestrian.adult": (0, 0, 230),  
        "movable_object.trafficcone":(112, 128, 144),
        "vehicle.trailer":(255, 158, 0), 
        "vehicle.truck": (255, 158, 0),  
        "flat.driveable_surface": (0, 207, 191),  
        "flat.other":(0, 207, 191),
        "flat.sidewalk": (75, 0, 75),
        "flat.terrain": (0, 207, 191),
        "static.manmade": (222, 184, 135),  
        "static.vegetation": (0, 175, 0),  
    }
rockywind commented 1 year ago

Hi, This is the result when I converted the classname_to_color. It is also different yous. image

FANG-MING commented 1 year ago

Hi, This is the result when I converted the classname_to_color. It is also different yous. image

emmm, Set the data_range to [0, 17].

rockywind commented 1 year ago

Hi, There are my results. Is it correct? image image

FANG-MING commented 1 year ago

It looks ok!

yebin999 commented 3 months ago

Hi @rockywind && @FANG-MING , could you help provide your mayavi, pyqt and vtk version? I met some error when I run vis_pts.py caused by mayavi, so I want to check if those three packages version are right.

many thanks!

yebin999 commented 3 months ago

Hi @rockywind && @FANG-MING , could you help provide your mayavi, pyqt and vtk version? I met some error when I run vis_pts.py caused by mayavi, so I want to check if those three packages version are right.

many thanks!

I have solved, ignore this comment.