hzxie/Pix2Vox

Understanding generated output format and saving output to binvox file.

Closed this issue · 2 comments

Greetings,
I was trying to save the generated 3D volume in a binvox file. I followed your suggestions provided in issue #11 and have following questions :

  1. In test.py, on line 149,
    gv = generated_volume.cpu().numpy()
    this gv is a numpy array of shape (1, 32, 32, 32). and the sample output of gv is as follows

issue_image_2

How does these values represent our generated 3D volume ?

  1. As per your suggestions in issue #11, to save the generated output as a binvox file, I added following code snippet :
    Screenshot from 2021-01-05 23-45-38
    But, all saved binvox files are of size 310 bytes only.
    To solve this problem you suggested to convert np.array to np.bool before saving, but I did not understand how to do that as don't know what the array value represents.
    Can you help me to convert this np.array to np.bool ?
hzxie commented

These values are probabilities. You can simply convert them to booleans by:

threshold = 0.4
gv = gv > threshold

Thanks :)