-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.py
29 lines (19 loc) · 783 Bytes
/
demo.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
import argparse
from ifusion import finetune, inference, optimize_pose
from util.util import load_config, parse_model, set_random_seed
def main(config):
model = parse_model(config.model)
if not config.inference.use_single_view:
print("[INFO] Pose optimization")
optimize_pose(model, **config.pose)
print("[INFO] Sparse-view finetuning")
finetune(model, **config.finetune)
print("[INFO] Inference")
inference(model, **config.inference)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--config", type=str, default="config/demo.yaml")
args, extras = parser.parse_known_args()
config = load_config(args.config, cli_args=extras)
set_random_seed(config.seed)
main(config)