Saving output to .binvox file
adarsh-knn opened this issue · 6 comments
adarsh-knn commented
Warm 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 :
- Can you please tell me the exact code line for
pred_volume
? - Where exactly in test.py file do we need to add the code mentioned in #11?
Please help me figure this out.
Thanks in advance!
adarsh-knn commented
Thank you!
But I am facing an issue wherein all the .binvox files are of 310 bytes and the following is the visualization of the binvox file for all categories (aeroplane, bench, cabinet, etc..).
This is the code I had used:
`pred_volume = generated_volume.squeeze()
threshold = 0.4
pred_volume = pred_volume > threshold`
`with open('/home/adarsh/Pix2Vox/output/%s.binvox' % taxonomy_id, 'wb') as f:
vox = utils.binvox_rw.Voxels(pred_volume.cpu().numpy(), (32,) * 3, (0,) * 3, 1, 'xyz')
vox.write(f)`
Can you please me to fix this?
hzxie commented
Please make sure that the values in `pred_volume` are 0 or 1.
…On Wed, Mar 29, 2023 at 3:21 PM adarsh-knn ***@***.***> wrote:
Thank you!
But I am facing an issue wherein all the .binvox files are of 310 bytes
and the following is the visualization of the binvox file.
[image: image]
<https://user-images.githubusercontent.com/71318160/228456523-d6561bac-5db7-4625-b206-22fa91666e47.png>
This is the code I had used:
` pred_volume = generated_volume.squeeze()
threshold = 0.4
pred_volume = pred_volume > threshold
with open('/home/adarsh/Pix2Vox/output/%s.binvox' % taxonomy_id, 'wb') as f:
vox = utils.binvox_rw.Voxels(pred_volume.cpu().numpy(), (32,) * 3, (0,) * 3, 1, 'xyz')
vox.write(f)`
Can you please me to fix this?
—
Reply to this email directly, view it on GitHub
<#99 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANGPSCBXKYEOCMGCPM473LW6PPINANCNFSM6AAAAAAWJOHQKM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
--
Haozhe Xie (谢浩哲)
Research Fellow, ***@***.*** <https://mmlab-ntu.com>
61 Nanyang Dr, Singapore 637335
adarsh-knn commented
hzxie commented
So you need to check why they are all ones.
…On Wed, Mar 29, 2023 at 3:32 PM adarsh-knn ***@***.***> wrote:
Currently, pred_volume contains:
[image: image]
<https://user-images.githubusercontent.com/71318160/228459539-c49900ec-0d9b-4995-a52b-b045e789a26e.png>
So it's all 1.
—
Reply to this email directly, view it on GitHub
<#99 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANGPSDE2UA6XLAGNBD6SB3W6PQRRANCNFSM6AAAAAAWJOHQKM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
--
Haozhe Xie (谢浩哲)
Research Fellow, ***@***.*** <https://mmlab-ntu.com>
61 Nanyang Dr, Singapore 637335
adarsh-knn commented
Okay, thanks a lot!