def main(): try: """ LOAD SETUP VARIABLES """ cfg = load_config() debug_mode = cfg['debug_mode'] model_type = cfg['model_type'] """ LOG FORMAT MODE """ log_format(debug_mode) """ START DETECTION, FPS, FPS PRINT """ fps = FPS(cfg) fps_counter_proc = fps.start_counter() fps_console_proc = fps.start_console() if model_type == 'face_v0': from lib.detection_face_v0 import FACEV0 detection = FACEV0() detection.start(cfg) else: raise IOError(("Unknown model_type.")) fps_counter_proc.join() fps_console_proc.join() except Exception as e: import traceback traceback.print_exc() finally: pass
def main(): try: """ LOAD SETUP VARIABLES """ cfg = load_config() debug_mode = cfg['debug_mode'] model_type = cfg['model_type'] """ LOG FORMAT MODE """ log_format(debug_mode) """ START DETECTION, FPS, FPS PRINT """ fps = FPS(cfg) fps_counter_proc = fps.start_counter() fps_console_proc = fps.start_console() if model_type == 'nms_v0': from lib.detection_nms_v0 import NMSV0 detection = NMSV0() detection.start(cfg) elif model_type == 'nms_v1': from lib.detection_nms_v1 import NMSV1 detection = NMSV1() detection.start(cfg) elif model_type == 'nms_v2': from lib.detection_nms_v2 import NMSV2 detection = NMSV2() detection.start(cfg) elif model_type == 'trt_v1': from lib.detection_trt_v1 import TRTV1 detection = TRTV1() detection.start(cfg) elif model_type == 'mask_v1': from lib.mtdetection_mask_v1 import MASKV1 detection = MASKV1() detection.start(cfg) elif model_type == 'faster_v2': from lib.detection_faster_v2 import FasterV2 detection = FasterV2() detection.start(cfg) elif model_type == 'deeplab_v3': from lib.detection_deeplab_v3 import DeepLabV3 detection = DeepLabV3() detection.start(cfg) else: raise IOError(("Unknown model_type.")) fps_counter_proc.join() fps_console_proc.join() except Exception as e: import traceback traceback.print_exc() finally: pass
def main(): try: """ LOAD SETUP VARIABLES """ cfg = load_config() debug_mode = cfg['debug_mode'] """ LOG FORMAT MODE """ log_format(debug_mode) # download_model() """ START DETECTION, FPS, FPS PRINT """ fps = FPS(cfg) fps_counter_proc = fps.start_counter() fps_console_proc = fps.start_console() model = cfg['model'] if model == 'mask_rcnn_resnet50_atrous_coco': from lib.detection_trt_mask_v1 import TRTV1 detection = TRTV1() detection.start(cfg) elif model == 'faster_rcnn_resnet50_coco': from lib.detection_trt_v1 import TRTV1 detection = TRTV1() detection.start(cfg) else: raise IOError(("Unknown model.")) fps_counter_proc.join() fps_console_proc.join() except Exception as e: import traceback traceback.print_exc() finally: pass