import platform from utils.sqlitedao import create_database from cfg import DataConfig, TaskConfig from task import TaskManager, ImgInfoPool, get_cfgDataHandler import importlib def args_parse(): parser = argparse.ArgumentParser() parser.add_argument('-i', type=str, help='input video') return parser.parse_args() if __name__ == "__main__": # Linux平台启动 if platform.system() == 'Linux': mp.set_start_method('spawn', force=True) img_info_pool = ImgInfoPool(max_size=30) tm = TaskManager(img_info_pool) args = args_parse() cfg_data = { "task_type": "collectTrack", "filepath": args.i, } task_type = cfg_data['task_type'] get_cfg = importlib.import_module(TaskConfig.SIMPLE_CFG_DIR + task_type).get_injected_cfg task_cfg = get_cfg(cfg_data) tm.submit(task_name=os.path.basename(args.i), task_cfg=task_cfg) tm.resume(task_name=os.path.basename(args.i), is_join=True)
from cfg import DataConfig, TaskConfig from task import TaskManager, ImgInfoPool, get_cfgDataHandler import importlib if __name__ == '__main__': # Linux平台启动 if platform.system() == 'Linux': mp.set_start_method('spawn', force=True) create_database(True) img_info_pool = ImgInfoPool(max_size=30) tm = TaskManager(img_info_pool) cfg_data = { "task_type": "crossRoadsTaskFake", "filename": "lot_15.mp4", "parking_monitoring_area": [[[1250, 800], [1250, 400], [750, 400], [750, 800]]], "lane_monitoring_area": [[[1250, 1000], [1250, 300], [500, 300], [500, 1000]]], "lane_no_allow_cars": { "2": ["car"] } } task_type = cfg_data['task_type'] get_cfg = importlib.import_module(TaskConfig.SCENE_CFG_DIR + task_type).get_injected_cfg task_cfg = get_cfg(cfg_data) tm.submit(task_name='lot_15.mp4', task_cfg=task_cfg) tm.resume(task_name='lot_15.mp4')
from cfg import DataConfig, TaskConfig from task import TaskManager, ImgInfoPool, get_cfgDataHandler import importlib if __name__ == '__main__': # Linux平台启动 if platform.system() == 'Linux': mp.set_start_method('spawn', force=True) create_database(True) img_info_pool = ImgInfoPool(max_size=30) tm = TaskManager(img_info_pool) cfg_data = { "task_type": "expresswayTaskFake", "filename": "gs.mp4", "parking_monitoring_area": [[[1250, 800], [1250, 400], [750, 400], [750, 800]]], "lane_monitoring_area": [[[1250, 800], [1250, 400], [750, 400], [750, 800]]], "lane_no_allow_cars": { "2": ["car"] } } task_type = cfg_data['task_type'] get_cfg = importlib.import_module(TaskConfig.SCENE_CFG_DIR + task_type).get_injected_cfg task_cfg = get_cfg(cfg_data) tm.submit(task_name='gs.mp4', task_cfg=task_cfg) tm.resume(task_name='gs.mp4')
from task import TaskManager, ImgInfoPool, get_cfgDataHandler import importlib def args_parse(): parser = argparse.ArgumentParser() parser.add_argument('-i', type=str, help='input video') parser.add_argument('-o', type=str, help='save path') return parser.parse_args() if __name__ == "__main__": # Linux平台启动 if platform.system() == 'Linux': mp.set_start_method('spawn', force=True) img_info_pool = ImgInfoPool(max_size=30) tm = TaskManager(img_info_pool) args = args_parse() cfg_data = { "task_type": "processVideo", "filepath": args.i, "write_path": args.o, "resolution": (1600, 900) } task_type = cfg_data['task_type'] get_cfg = importlib.import_module(TaskConfig.SIMPLE_CFG_DIR + task_type).get_injected_cfg task_cfg = get_cfg(cfg_data) tm.submit(task_name=os.path.basename(args.i), task_cfg=task_cfg) tm.resume(task_name=os.path.basename(args.i))