cagcoach / BlenderPlot

A script for plotting Voxel Diagrams using Blender
GNU General Public License v3.0
12 stars 0 forks source link

A question about input file #1

Open LongruiDong opened 5 years ago

LongruiDong commented 5 years ago

Hi, I found your codes from https://stackoverflow.com/questions/48214144/how-to-export-3d-pointcloud-as-a-rendered-voxel-grid . I am also trying to visualize .ply file which is the output of SSCNet.But I don not know what is “NYU0077_0000.mat”,i only have some files like NYU0077_0000_gt_d4.mat or NYU0077_0000_vol_d4.mat. What is the difference between them? To figure out this, I have loaded NYU0077_0000_gt_d4.mat by following codes

import numpy as np
import random

import numpy
import h5py

rootDir= '/home/dlr/Project/sscnet/data/eval/NYUtest/'

file = 'NYU0077_0000_gt_d4.mat'

print(rootDir + file)
data = h5py.File( rootDir + file) 

for k, v in data.items():
    print(k)
    print(v)

and got some information

camPose
<HDF5 dataset "camPose": shape (4, 3), type "<f8">
sceneVox_ds
<HDF5 dataset "sceneVox_ds": shape (60, 36, 60), type "<f8">
voxOriginWorld
<HDF5 dataset "voxOriginWorld": shape (1, 3), type "<f8">

These information indicates that “data” does not have KEY 'label'.

Since I am still new to these data formats, I don't know how to modify your code next,If you can give me some advice, it would be better,thanks alot!!

cagcoach commented 5 years ago

"data" is an 3 dimensional array containing an integer corresponding to the label at that position.

I did not work with the dataset for a quite long time now, But for visiualizing the ground truth you might have to take the "sceneVox_ds" as your "data".

I hope that helps...

Greedings, Christian.

mgarbade commented 4 years ago

I didn't work with the .ply files created by SSCNet. My recommendation is to crowbar some lines of code that export your voxel grid volume as mat file, eg using from scipy.io import savemat wich conveniently allows you to do that from within python. As far as I remember the evalution code was written in Matlab anyway so exporting should not be difficult using that code.