Example #1
0
def main():
    gui.Application.instance.initialize()

    # Font changes must be done after initialization but before creating
    # a window.

    # MODE_SERIF changes the English font; Chinese will not be displayed
    font = None
    if mode == MODE_SERIF:
        font = gui.FontDescription(serif)
    # MODE_COMMON_HANYU uses the default English font and adds common Chinese
    elif mode == MODE_COMMON_HANYU:
        font = gui.FontDescription()
        font.add_typeface_for_language(hanzi, "zh")
    # MODE_SERIF_AND_COMMON_HANYU uses a serif English font and adds common
    # Chinese characters
    elif mode == MODE_SERIF_AND_COMMON_HANYU:
        font = gui.FontDescription(serif)
        font.add_typeface_for_language(hanzi, "zh")
    # MODE_COMMON_HANYU_EN the Chinese font for both English and the common
    # characters
    elif mode == MODE_COMMON_HANYU_EN:
        font = gui.FontDescription(hanzi)
        font.add_typeface_for_language(hanzi, "zh")
    # MODE_ALL_HANYU uses the default English font but includes all the Chinese
    # characters (which uses a substantial amount of memory)
    elif mode == MODE_ALL_HANYU:
        font = gui.FontDescription()
        font.add_typeface_for_language(hanzi, "zh_all")
    elif mode == MODE_CUSTOM_CHARS:
        range = [0x2654, 0x2655, 0x2656, 0x2657, 0x2658, 0x2659]
        font = gui.FontDescription()
        font.add_typeface_for_code_points(chess, range)

    if font is not None:
        gui.Application.instance.set_font(gui.Application.DEFAULT_FONT_ID,
                                          font)

    w = ExampleWindow()
    gui.Application.instance.run()
Example #2
0
        help='YAML config file path. Please refer to default_config.yml as a '
        'reference. It overrides the default config file, but will be '
        'overridden by other command line inputs.')
    parser.add(
        '--default_dataset',
        help='Default dataset is used when config file is not provided. '
        'Default dataset may be selected from the following options: '
        '[lounge, bedroom, jack_jack]',
        default='lounge')
    parser.add('--path_npz',
               help='path to the npz file that stores voxel block grid.',
               default='output.npz')
    config = parser.get_config()

    if config.path_dataset == '':
        config = get_default_dataset(config)

    # Extract RGB-D frames and intrinsic from bag file.
    if config.path_dataset.endswith(".bag"):
        assert os.path.isfile(
            config.path_dataset), (f"File {config.path_dataset} not found.")
        print("Extracting frames from RGBD video file")
        config.path_dataset, config.path_intrinsic, config.depth_scale = extract_rgbd_frames(
            config.path_dataset)

    app = gui.Application.instance
    app.initialize()
    mono = app.add_font(gui.FontDescription(gui.FontDescription.MONOSPACE))
    w = ReconstructionWindow(config, mono)
    app.run()