forked from DLR-RM/BlenderProc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbash_render.py
More file actions
30 lines (22 loc) · 903 Bytes
/
Copy pathbash_render.py
File metadata and controls
30 lines (22 loc) · 903 Bytes
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
import yaml
import subprocess
import sys
with open('./scripts/room_configs.yaml', 'r') as f:
ALL_ROOM_CONFIG = yaml.load(f, Loader=yaml.FullLoader)
skip = {1003: [0,1,2,3], 1005: [0,1], 1008: [0], 1009:[0]}
all_scene_keys = ALL_ROOM_CONFIG.keys()
all_skip_keys = skip.keys()
for i in range(1038, 1041):
if i not in all_scene_keys:
print(f'Scene {i} does not have config.')
continue
scene_info = ALL_ROOM_CONFIG[i]
scene_room_configs = scene_info.keys()
for r in scene_room_configs:
if i in all_skip_keys:
if r in skip[i]:
print(f'Skip room {r} of scene {i}.')
continue
bashCommand = f"python cli.py run ./scripts/render.py --gpu 1 -s {i} -r {r} --render -nc"
process = subprocess.Popen(bashCommand.split(), stderr=sys.stderr, stdout=sys.stdout)
output, error = process.communicate()