Пример #1
0
def get_unfilled_gt_voxel_dataset(cat_id):
    config = VoxelConfig()
    return config.get_dataset(cat_id)
Пример #2
0
from mayavi import mlab
from shapenet.core.voxels.config import VoxelConfig
from shapenet.core import cat_desc_to_id, get_example_ids
from util3d.mayavi_vis import vis_voxels

cat_desc = 'plane'
cat_id = cat_desc_to_id(cat_desc)
example_ids = get_example_ids(cat_id)

config = VoxelConfig()
with config.get_dataset(cat_id) as dataset:
    for example_id in example_ids:
        voxels = dataset[example_id]
        vis_voxels(voxels.dense_data(), color=(0, 0, 1))
        mlab.show()
Пример #3
0
def get_unfilled_gt_voxel_dataset(cat_id):
    config = VoxelConfig()
    return config.get_dataset(cat_id)
Пример #4
0
#!/usr/bin/python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from shapenet.core.voxels.config import VoxelConfig
from shapenet.core import cat_desc_to_id
from util3d.mayavi_vis import vis_sliced
from mayavi import mlab
import numpy as np

cat_desc = 'watercraft'
cat_id = cat_desc_to_id(cat_desc)


base = VoxelConfig(voxel_dim=128)
filled = base.filled('orthographic')
with base.get_dataset(cat_id) as bds, filled.get_dataset(cat_id) as fds:
    for example_id in bds:
        base_data = bds[example_id].dense_data()
        filled_data = fds[example_id].dense_data()
        for dense_data in (base_data, filled_data):
            mlab.figure()
            vis_sliced(dense_data.astype(np.float32), axis_order='xyz')
        mlab.show()
        break