forked from fire717/movenet.pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_video.py
35 lines (25 loc) · 1.04 KB
/
create_video.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
"""
"""
import os, argparse
import random
from lib import init, Data, MoveNet, Task
from config import cfg
from lib.utils.utils import arg_parser
def main(cfg):
init(cfg)
# cfg["eval_img_path"] = '/home/ggoyal/data/h36m_cropped/eros_samples'
# cfg["eval_label_path"] = '/home/ggoyal/data/h36m_cropped/eros_samples/poses.json'
model = MoveNet(num_classes=cfg["num_classes"],
width_mult=cfg["width_mult"],
mode='train')
data = Data(cfg)
data_loader = data.getTestDataloader()
# NOTE: All image files in the folder "test_img_path" and it's subfolders will be considered for the inference
run_task = Task(cfg, model)
run_task.modelLoad('/home/ggoyal/data/h36m_cropped/runs/e48_valacc0.81777.pth')
# run_task.evaluate(data_loader)
# run_task.save_video(data_loader,'/home/ggoyal/data/h36m_cropped/tester/input_sample.avi')
run_task.infer_video(data_loader,'/home/ggoyal/data/h36m_cropped/tester/test.avi')
if __name__ == '__main__':
cfg = arg_parser(cfg)
main(cfg)