-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrender.py
More file actions
110 lines (95 loc) · 2.66 KB
/
render.py
File metadata and controls
110 lines (95 loc) · 2.66 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
"""
Copyright (c) 2025 Ning Gao, Shanghai Artificial Intelligence Laboratory
All rights reserved.
Licensed under the MIT License.
"""
import argparse
import os
import sys
# early import to avoid conflict with isaacsim
import pydantic
import torch
import numpy
from pydantic import BaseModel, Field
from isaacsim import SimulationApp # type: ignore[import-untyped]
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(current_dir)
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument(
"-cfg",
"--config",
default="configs/tasks/minimal.yml",
type=str,
help="Path to the YAML config file",
)
parser.add_argument(
"--record",
type=str,
required=False,
default="just for record",
help="Helps to record user name for monitoring in htop/nvidia-smi/nvitop etc.",
)
parser.add_argument(
"-l",
"--local",
action="store_true",
help="Run in local mode, a quick command to enable Isaac Sim GUI",
)
# Rendering options
parser.add_argument(
"-r",
"--render_first_frame",
action="store_true",
help="Only render the first frame",
)
parser.add_argument(
"-d",
"--downsample",
type=int,
default=1,
help="Downsample the rendering frame rate",
)
parser.add_argument(
"--high_quality", action="store_true", help="High quality rendering"
)
# Camera/Annotator options
parser.add_argument(
"-a",
"--add_random_position_camera",
action="store_true",
help="Add random position camera",
)
parser.add_argument(
"-ac",
"--add_cycle_camera",
action="store_true",
help="Add cycle camera",
)
parser.add_argument(
"-p",
"--save_pointcloud",
action="store_true",
help="Save pointcloud",
)
parser.add_argument(
"-wod",
"--without_depth",
action="store_true",
help="Without render and save depth info",
)
# Domain randomization options
parser.add_argument(
"-prr",
"--process_room_randomization",
action="store_true",
help="Process room randomization",
)
return parser.parse_args()
args = parse_args()
simulation_app = SimulationApp({"headless": not args.local})
simulation_app._carb_settings.set("/physics/cooking/ujitsoCollisionCooking", False)
from genmanip.demogen.workflow.render import RenderWorkflow
if __name__ == "__main__":
workflow = RenderWorkflow(args, simulation_app, current_dir)
workflow.run()