-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathprocess_collection.py
executable file
·88 lines (78 loc) · 2.46 KB
/
process_collection.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python3
import argparse
from drl_grasping.envs.models.utils import ModelCollectionRandomizer
def main(args=None):
model_collection_randomizer = ModelCollectionRandomizer(
owner=args.owner,
collection=args.collection,
server=args.server,
server_version=args.version,
unique_cache=True,
enable_blacklisting=True,
)
print("Processing all models from owner [%s]..." % args.owner)
model_collection_randomizer.process_all_models(
decimation_fraction_of_visual=args.decimate_fraction,
decimation_min_faces=args.decimate_min_faces,
decimation_max_faces=args.decimate_max_faces,
max_faces=40000,
max_vertices=None,
component_min_faces_fraction=0.1,
component_max_volume_fraction=0.35,
fix_mtl_texture_paths=True,
)
print("Processing finished")
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Process all models from a collection. "
+ "If local cache already contains one or more models from the owner [-o], "
+ "these models will be processed and [-s, -c, -v] arguments ignored."
)
parser.add_argument(
"-o",
"--owner",
action="store",
default="GoogleResearch",
help="Owner of the collection",
)
parser.add_argument(
"-c",
"--collection",
action="store",
default="Google Scanned Objects",
help="Name of the collection",
)
parser.add_argument(
"-s",
"--server",
action="store",
default="https://fuel.ignitionrobotics.org",
help="URI to Ignition Fuel server where the collection resides",
)
parser.add_argument(
"-v",
"--version",
action="store",
default="1.0",
help="Version of the Fuel server",
)
parser.add_argument(
"--decimate_fraction",
action="store",
default="0.25",
help="Fraction of faces collision geometry should have compared to visual geometry (min/max faces will be enforced)",
)
parser.add_argument(
"--decimate_min_faces",
action="store",
default="40",
help="Min number of faces for collision geometry",
)
parser.add_argument(
"--decimate_max_faces",
action="store",
default="200",
help="Max number of faces for collision geometry",
)
args = parser.parse_args()
main(args)