Пример #1
0
            print("  -- extracting labels colors")
            labelsColors = semantizer.get_labelsColors_numpy()
            np.savez(
                os.path.join(voxels_directory, filename + "_labelsColors"),
                labelsColors)

if create_views:

    from python.viewGenerator import ViewGeneratorLauncher
    from python.viewGenerator import ViewGeneratorNoDisplay as ViewGenerator

    launcher = ViewGeneratorLauncher()

    for filename in filenames:
        print(filename)
        view_gen = ViewGenerator()
        view_gen.initialize_acquisition(directory, image_directory, filename)
        view_gen.set_camera_generator(
            ViewGenerator.cam_generator_random_vertical_cone)
        view_gen.opts["imsize"] = imsize
        view_gen.generate_cameras_scales(cam_number, distances=[5, 10, 20])
        view_gen.init()
        #launcher.launch(view_gen)

if create_images:
    from python.imageGenerator import ImageGenerator
    for filename in filenames:
        print(filename)
        # generate images
        print("  -- generating images")
        im_gen = ImageGenerator()
Пример #2
0
if not os.path.exists(directory):
    os.makedirs(directory)
if not os.path.exists(voxels_directory):
    os.makedirs(voxels_directory)
if not os.path.exists(image_directory):
    os.makedirs(image_directory)

voxel_size = config["voxel_size"]
imsize = config["imsize"]
cam_number = config["test_cam_number"]
create_mesh = config["test_create_mesh"]
create_views = config["test_create_views"]
create_images = config["test_create_mesh"]

view_gen = ViewGenerator()
view_gen.set_camera_generator(ViewGenerator.cam_generator_random_vertical_cone)
view_gen.opts["imsize"] = imsize

for filename in filenames:
    print(filename)

    if create_mesh:
        # create the mesher
        semantizer = Sem3D()
        semantizer.set_voxel_size(voxel_size)

        #loading data and voxelization
        print("  -- loading data")
        semantizer.load_Sem3D(os.path.join(input_dir, filename + ".txt"))