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

Function get_tex_model_list

pointersect/data/genlist.py:19–49  ·  view source on GitHub ↗

given setting (train/test), generate a list of obj file names in the tex dataset Args: setting: train/test num_classes: number of class in training rnd_seed: random seed Returns: a list of filenames

(
        setting: str,
        num_classes: int = 3,
        rnd_seed: int = 0
)

Source from the content-addressed store, hash-verified

17# randomly pick mesh files from datasets
18
19def get_tex_model_list(
20 setting: str,
21 num_classes: int = 3,
22 rnd_seed: int = 0
23) -> list:
24 """
25 given setting (train/test), generate a list of obj file names in the tex dataset
26 Args:
27 setting: train/test
28 num_classes: number of class in training
29 rnd_seed: random seed
30
31 Returns:
32 a list of filenames
33
34 """
35 class_list = ['buddha', 'buddha2', 'bunny', 'cat', 'feline', 'tiger', 'zebra']
36
37 if rnd_seed > 0: # negative: use sorted class_list
38 np.random.seed(rnd_seed)
39 class_list = np.random.permutation(class_list).tolist()
40
41 if setting == 'train':
42 class_list = class_list[:num_classes]
43 elif setting == 'test':
44 class_list.reverse()
45 class_list = class_list[:num_classes]
46
47 obj_path_list = [c + '.obj' for c in class_list]
48
49 return obj_path_list
50
51
52def get_ShapeNet_model_list(

Callers 1

get_mesh_filenamesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected