j96w/DenseFusion

question about custom dataset

Closed this issue · 8 comments

Hello,
I try to use my own synthetic dataset with DenseFusion.
When I try to train on my dataset I get an error from this line : mask_label = ma.getmaskarray(ma.masked_equal(label, np.array([255, 255, 255])))[:, :, 0] in dataset.py.
The error message end with:

File "/home/katharina/Schreibtisch/DenseFusion-Pytorch-1.0/venv/lib/python3.6/site-packages/numpy/ma/core.py", line 2103, in masked_equal
    output = masked_where(equal(x, value), x, copy=copy)
  File "/home/katharina/Schreibtisch/DenseFusion-Pytorch-1.0/venv/lib/python3.6/site-packages/numpy/ma/core.py", line 1021, in __call__
    result = self.f(da, db, *args, **kwargs)
ValueError: operands could not be broadcast together with shapes (512,512) (3,) 

I know that some of my images (e.g. the Color-Image) have additional alpha-channels. Do I need to delete these alpha-channels for processing my dataset? How many channels should color-Image, depth-image and segmentation mask contain?

My second question is about the segmentation mask. I use NDDS to synthesize a dataset. In the end I can get a class-based segmentation mask and a instance-based segmentation mask. Which one should I use for training if I want my trained model to detect different instances of one object-class?

Thank you very much for any advice and help

Solved that issue by using instance-segmentation-mask and this modification: label = label[:,:,0:3]

Hello Katharina,

im also trying to use NDDS to generate data for training. Do you know how we can generate the cam_R_m2c and cam_t_m2c from NDDS groundtruth data? Or do you have a source to read more about these two annotations?

Thank you!

Hi,
here you can find a description of all the annotations, which the NDDS generates: FAT Dataset.
I assume, that you are looking for the pose of the camera relative to the world coordinate system. This is camera data in the annotation file for each scene.
Hope I was able to help you with this information.

Thank you for your fast reply!
I totally get how the exported NDDS data is annotated. My problem is to somehow find the both camera rotation and translation matrices, cam_R_m2c and cam_t_m2c. Since in NDDS the camera is fixed but the object keeps moving in each captured frame.

Im looking right now at your repository to see how you used the NDDS-data ^^

@KatharinaSchmidt I have tried your greate code for using NDDS-data. The 2D bounding box works perfectly but sadly I cannot align the 3D-bb with your methods.
Screenshot from 2021-01-05 23-43-03

You have discussed this problem under this issiue and I think the last key which is missing for me is the camera.txt. Im not sure if Im using the Intrinsic matrix correctly or is the mistake in somewhere else. Could you please upload your camera.txt or help me with this problem?

I appreciate your help and time in advance

Hi friend,
i also meet the same problem
ValueError: operands could not be broadcast together with shapes (480,640) (3,)

But I don't understand what instance segmentation mask means. Can you give me some more specific suggestions
thanke you!

@TheIOne instance segmentation mask is the image you get from NDDS where each obejct has a unique colour. In contrast to that you can also get a class segmentation mask where all objects from the same class have the same colour.

hello,i also meet this error ,and i dont understand "this modification: label = label[:,:,0:3]"