MCPcopy Index your code
hub / github.com/apple/ml-pointersect / launch

Function launch

pointersect/inference/main.py:2076–2138  ·  view source on GitHub ↗

launch the inference, using the parameters in the config yaml file. Args: config_filename: yaml filename

(
        config_filename: str,
)

Source from the content-addressed store, hash-verified

2074
2075
2076def launch(
2077 config_filename: str,
2078):
2079 """
2080 launch the inference, using the parameters in the config yaml file.
2081
2082 Args:
2083 config_filename:
2084 yaml filename
2085 """
2086
2087 with open(config_filename) as file:
2088 config_dict = yaml.load(file, Loader=yaml.FullLoader)
2089
2090 assert 'procedure' in config_dict
2091 procedure = config_dict['procedure']
2092 del config_dict['procedure']
2093
2094 repo_root = os.path.normpath(os.path.join(__file__, '../../..'))
2095
2096
2097 # model filename
2098 default_model_pth_filename = os.path.normpath(
2099 os.path.join(
2100 repo_root, 'pointersect/checkpoint/epoch700.pth'))
2101
2102 model_filename = config_dict['model_filename']
2103 if model_filename is None or model_filename == 'null':
2104 model_filename = default_model_pth_filename
2105
2106 if isinstance(model_filename, str):
2107 model_filename = [model_filename]
2108
2109 for i in range(len(model_filename)):
2110 if model_filename[i] is None or model_filename[i] == 'null':
2111 model_filename[i] = default_model_pth_filename
2112 config_dict['model_filename'] = model_filename
2113
2114 if procedure == 'render_mesh':
2115 render_mesh(**config_dict)
2116 elif procedure == 'render_hypersim':
2117 render_hypersim(**config_dict)
2118 elif procedure == 'batch_render_mesh':
2119 batch_render_mesh(
2120 dataset_name=config_dict['dataset_name'],
2121 config_dict=config_dict,
2122 )
2123 elif procedure == 'render_arkitscenes':
2124 render_arkitscenes(
2125 **config_dict,
2126 )
2127 elif procedure == 'render_point_cloud':
2128 render_point_cloud(
2129 **config_dict,
2130 )
2131 elif procedure == 'render_point_clouds':
2132 render_point_clouds(
2133 **config_dict,

Callers

nothing calls this directly

Calls 7

render_meshFunction · 0.85
render_hypersimFunction · 0.85
batch_render_meshFunction · 0.85
render_arkitscenesFunction · 0.85
render_point_cloudFunction · 0.85
render_point_cloudsFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected