-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate.py
47 lines (37 loc) · 825 Bytes
/
generate.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
from utils.generate import load_pipeline, generate
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument(
"--image_folder",
type=str
)
parser.add_argument(
"--output_folder",
type=str
)
parser.add_argument(
"--trajectory_folder",
type=str
)
parser.add_argument(
"--num_frames",
type=int
)
parser.add_argument(
"--seed",
type=int,
default=12345
)
parser.add_argument(
"--checkpoint",
type=str,
)
args = parser.parse_args()
checkpoint = args.checkpoint
pipeline = load_pipeline(checkpoint)
image_path = os.listdir(args.image_folder)
assert len(image_path) == 1
image_path = os.path.join(args.image_folder, image_path[0])
generate(pipeline, args.trajectory_folder, image_path,
args.output_folder, args.num_frames, seed=args.seed)