def create_mb_tiny_fd_predictor(net, candidate_size=200, nms_method=None, sigma=0.5, device=None): predictor = Predictor(net, config.image_size, config.image_mean_test, config.image_std, nms_method=nms_method, iou_threshold=config.iou_threshold, candidate_size=candidate_size, sigma=sigma, device=device) return predictor
def create_mobilenetv2_ssd_lite_predictor(net, candidate_size=200, nms_method=None, sigma=0.5, device=torch.device('cpu')): predictor = Predictor(net, config.image_size, config.image_mean, config.image_std, nms_method=nms_method, iou_threshold=config.iou_threshold, candidate_size=candidate_size, sigma=sigma, device=device) return predictor
def create_mb_tiny_fd_predictor(net, model_path=None, candidate_size=200, nms_method=None, sigma=0.5, device=None, fuse=False): predictor = Predictor(net, config, model_path=model_path, nms_method=nms_method, candidate_size=candidate_size, sigma=sigma, device=device, fuse=fuse) return predictor
# if net_type == 'vgg16-ssd': # predictor = create_vgg_ssd_predictor(net, candidate_size=200) # elif net_type == 'mb1-ssd': # predictor = create_mobilenetv1_ssd_predictor(net, candidate_size=200) # elif net_type == 'mb1-ssd-lite': # predictor = create_mobilenetv1_ssd_lite_predictor(net, candidate_size=200) # elif net_type == 'mb2-ssd-lite': # predictor = create_mobilenetv2_ssd_lite_predictor(net, candidate_size=200) # elif net_type == 'sq-ssd-lite': # predictor = create_squeezenet_ssd_lite_predictor(net, candidate_size=200) # elif net_type == 'resnet-18': # predictor = create_resnet18_ssd_predictor(net, candidate_size=200) # if net_type == 'lstm-ssd': predictor = Predictor(net, config.image_size, config.image_mean, config.image_std, nms_method=None, iou_threshold=config.iou_threshold, candidate_size=200, sigma=None) dir_path = './data/sample/' imgs = [] for img_name in os.listdir(dir_path): img_path = os.path.join(dir_path, img_name) print(img_path) img = cv2.imread(img_path) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) imgs.append(img) video = np.array(imgs)