-
Notifications
You must be signed in to change notification settings - Fork 80
/
run_net.py
36 lines (31 loc) · 985 Bytes
/
run_net.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
import os
import sys
import os.path as osp
# sys.path.insert(0, '/'.join(osp.realpath(__file__).split('/')[:-2]))
import logging
import numpy as np
import copy
import random
import json
import math
import itertools
import logging
# logger = logging.get_logger(__name__)
from utils.config import Config
from tools.videocomposer.inference_multi import inference_multi
from tools.videocomposer.inference_single import inference_single
def main():
"""
Main function to spawn the train and test process.
"""
cfg = Config(load=True)
if hasattr(cfg, "TASK_TYPE") and cfg.TASK_TYPE == "MULTI_TASK":
logging.info("TASK TYPE: %s " % cfg.TASK_TYPE)
inference_multi(cfg.cfg_dict)
elif hasattr(cfg, "TASK_TYPE") and cfg.TASK_TYPE == "SINGLE_TASK":
logging.info("TASK TYPE: %s " % cfg.TASK_TYPE)
inference_single(cfg.cfg_dict)
else:
logging.info('Not suport task %s' % (cfg.TASK_TYPE))
if __name__ == "__main__":
main()