wangyida / forknet

ForkNet: Adversarial Semantic Scene Completion from a Single Depth Image - ICCV 2019

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get "depth_tsdf_bin" ?

lt-ice opened this issue · comments

Hello,
I have some problems when I use depth_backproject.py. I found it depends on depth_tsdf_bin. In your demo, there is a folder named depth_tsdf_bin in the path of "/forknet-master/depth-tsdf/data". So how can I get these bin files if I use other depth pictures?

What's more, I found some errors about reshape in the process of "vox_max = np.reshape(checkVox, (80, 48, 80))" in depthbin2surface.py. I don't know what I did wrong. In order to generate the file normally, I made the following modifications by referring to the relevant code of VVNet. I'm still curious to know how you did it. Can you help me ?

Looking forward to your reply. Thanks a lot.

The changes I made :
vox_size = np.array([240, 144, 240])
scaled_vox_size = np.array([80, 48, 80])
labels, vox_nums = [np.squeeze(x) for x in np.split(np.array(checkVoxValIter).reshape([-1, 2]), 2, axis=1)]
full_voxel = np.full(vox_size, 37, np.uint8).reshape([-1])
offset = 0
for label, vox_num in zip(labels, vox_nums):
if label != 255:
full_voxel[offset:offset+vox_num] = label
offset += vox_num
full_voxel = np.take(seg_class_map, full_voxel)
full_voxel = np.reshape(full_voxel, vox_size)
final_voxel = semantic_down_sample_voxel(full_voxel, scaled_vox_size)
vox_max = final_voxel

Those depth_bin files are provided by SUNCG as well, you can produce the TSDF volumes from depth images with the help of camera intrinsics once you have a pretrained model on hand

Thank you. I got it. I forgot to to create the folder name depth_tsdf_bin in advance . And as a result, the command line "./depth-tsdf/back-project" did not generate the related bin files successfully.