MCPcopy Create free account
hub / github.com/apple/ml-pointersect / get_Sketchfab_model_list

Function get_Sketchfab_model_list

pointersect/data/genlist.py:165–181  ·  view source on GitHub ↗
(
        rootpath: str,
        setting: str,
        num_classes: int = 3,
        rnd_seed: int = 0
)

Source from the content-addressed store, hash-verified

163
164
165def get_Sketchfab_model_list(
166 rootpath: str,
167 setting: str,
168 num_classes: int = 3,
169 rnd_seed: int = 0
170) -> list:
171 np.random.seed(rnd_seed)
172 if setting == 'train':
173 off_list = sorted(os.listdir(os.path.join(rootpath, 'train_mesh')))
174 elif setting == 'test':
175 off_list = sorted(os.listdir(os.path.join(rootpath, 'test_mesh')))
176
177 off_list = np.random.permutation(off_list).tolist()
178
179 off_list = [setting + '_mesh/' + off for off in off_list[:num_classes]]
180
181 return off_list
182
183
184# below are only for debug this function individually

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected