How to get "surface_semantic_npy" ?
a06271010 opened this issue · comments
Hello!
I want to retrain the forknet network for scene reconstruction. But I have some problems, could you help me to solve them?
In the config.py , you have used the surface_semantic_npy for training. I tried to use the data/depthbin2surfce.py to generate the data, but this script met some mistakes(out of memory).
Could you give some instruction for how to get "surface_semantic_npy" ?
Hi,
Those surface_semantic_npy files are generarted with our script from the original SUNCG binary data, although their website is currently down. The original data looks like :
NYU:
NYUtest/
NYUtrain/
SUNCG :
SUNCGtest_49700_49884/
SUNCGtrain_1001_3000/
SUNCGtrain_1_500/
SUNCGtrain_5001_7000/
SUNCGtrain_1001_2000/
SUNCGtrain_1_1000/
SUNCGtrain_3001_5000/
SUNCGtrain_501_1000/
I parsed data into numpy arrays to get it feed into the training pipeline. Now we provide a compact model in the pretrained_model folder as well
Hi, I have some problems about the generation of surface_semantic_npy.
I have the SUNCG binary data, which is organized like:
SUNCGtest_49700_49884/
SUNCGtrain_1001_3000/
SUNCGtrain_1_500/
SUNCGtrain_5001_7000/
SUNCGtrain_1001_2000/
SUNCGtrain_1_1000/
SUNCGtrain_3001_5000/
SUNCGtrain_501_1000/
The .bin file in these folders saved a 240×144×240 voxel, but in your depthbin2surface.py script, you try to reshape these voxels to 80×48×80, which leads to an error. The code is:
def bin2array(file_bin, dir_tar_voxel):
with open(file_bin, 'rb') as f:
float_size = 4
uint_size = 4
total_count = 0
cor = f.read(float_size * 3)
cors = unpack('fff', cor)
cam = f.read(float_size * 16)
cams = unpack('ffffffffffffffff', cam)
vox = f.read()
numC = len(vox) // uint_size
checkVoxValIter = unpack('I' * numC, vox)
checkVoxVal = checkVoxValIter[0::2]
checkVoxIter = checkVoxValIter[1::2]
checkVox = [
i for (val, repeat) in zip(checkVoxVal, checkVoxIter)
for i in np.tile(val, repeat)
]
# Down sampling according to maximum label
vox_max = np.reshape(checkVox, (80, 48, 80))
# convert 255 to -1
vox_max[vox_max == 255] = -1
# Save
name_start = int(file_bin.rfind('/'))
name_end = int(file_bin.find('.', name_start))
np.save(dir_tar_voxel + file_bin[name_start:name_end] + '.npy',
vox_max)
f.close()
In depthbin2npy.py file, the bin2array function will reshape the voxel to 240×144×240, so it can run normally. I want to ask that how can I generate surface_semantic_npy with depthbin2surface.py and SUNCG .bin files?
Hi the original data is provided in dim of 240 144 240, while I down sample it with https://github.com/wangyida/forknet/blob/master/data/depthbin2npy.py#L98