-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (25 loc) · 932 Bytes
/
main.py
File metadata and controls
30 lines (25 loc) · 932 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 argparse
from omegaconf import OmegaConf
from config import ObjectsParamsGroups, ParamsGroups
from training import ObjectTrainer
from training import SceneTrainer
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--object", action="store_true", help="generate object or scene"
)
parser.add_argument("--config", required=True, help="path to the yaml config file")
args, extras = parser.parse_known_args()
if args.object:
pg = OmegaConf.structured(ObjectsParamsGroups)
cfg = OmegaConf.merge(
pg, OmegaConf.load(args.config), OmegaConf.from_cli(extras)
)
trainer = ObjectTrainer(cfg)
else:
pg = OmegaConf.structured(ParamsGroups())
cfg = OmegaConf.merge(
pg, OmegaConf.load(args.config), OmegaConf.from_cli(extras)
)
trainer = SceneTrainer(cfg)
trainer.train()