diff --git a/examples/vision/classification/resnet/python/infer.py b/examples/vision/classification/resnet/python/infer.py index b8b268f3a..ba22304fc 100644 --- a/examples/vision/classification/resnet/python/infer.py +++ b/examples/vision/classification/resnet/python/infer.py @@ -46,5 +46,5 @@ model = fd.vision.classification.ResNet( args.model, runtime_option=runtime_option) # 预测图片分类结果 im = cv2.imread(args.image) -result = model.predict(im.copy(), args.topk) +result = model.predict(im, args.topk) print(result) diff --git a/examples/vision/classification/yolov5cls/python/infer.py b/examples/vision/classification/yolov5cls/python/infer.py index 576db32f2..55974a764 100644 --- a/examples/vision/classification/yolov5cls/python/infer.py +++ b/examples/vision/classification/yolov5cls/python/infer.py @@ -47,5 +47,5 @@ model = fd.vision.classification.YOLOv5Cls( # 预测图片分类结果 im = cv2.imread(args.image) -result = model.predict(im.copy(), args.topk) +result = model.predict(im, args.topk) print(result) diff --git a/examples/vision/detection/nanodet_plus/python/infer.py b/examples/vision/detection/nanodet_plus/python/infer.py index 9e7bf184f..a60f3a3b4 100644 --- a/examples/vision/detection/nanodet_plus/python/infer.py +++ b/examples/vision/detection/nanodet_plus/python/infer.py @@ -52,7 +52,7 @@ if args.image is None: else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/scaledyolov4/python/infer.py b/examples/vision/detection/scaledyolov4/python/infer.py index 9d990d77b..cd23e84e3 100644 --- a/examples/vision/detection/scaledyolov4/python/infer.py +++ b/examples/vision/detection/scaledyolov4/python/infer.py @@ -52,7 +52,7 @@ if args.image is None: else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolor/python/infer.py b/examples/vision/detection/yolor/python/infer.py index d5ab3dd7f..4111fa0ae 100644 --- a/examples/vision/detection/yolor/python/infer.py +++ b/examples/vision/detection/yolor/python/infer.py @@ -54,7 +54,7 @@ else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov5/python/infer.py b/examples/vision/detection/yolov5/python/infer.py index fdded06c9..462740e9c 100644 --- a/examples/vision/detection/yolov5/python/infer.py +++ b/examples/vision/detection/yolov5/python/infer.py @@ -52,7 +52,7 @@ if args.image is None: else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov5/quantize/python/infer.py b/examples/vision/detection/yolov5/quantize/python/infer.py index da502fe93..996bc5419 100644 --- a/examples/vision/detection/yolov5/quantize/python/infer.py +++ b/examples/vision/detection/yolov5/quantize/python/infer.py @@ -71,7 +71,7 @@ model = fd.vision.detection.YOLOv5( # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov5lite/python/infer.py b/examples/vision/detection/yolov5lite/python/infer.py index b1ec69046..2242a33a5 100644 --- a/examples/vision/detection/yolov5lite/python/infer.py +++ b/examples/vision/detection/yolov5lite/python/infer.py @@ -52,7 +52,7 @@ if args.image is None: else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov6/python/infer.py b/examples/vision/detection/yolov6/python/infer.py index 0a0a163fb..47bf3e689 100644 --- a/examples/vision/detection/yolov6/python/infer.py +++ b/examples/vision/detection/yolov6/python/infer.py @@ -52,7 +52,7 @@ if args.image is None: else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov6/quantize/python/infer.py b/examples/vision/detection/yolov6/quantize/python/infer.py index da9fa3d97..77f46d4c2 100644 --- a/examples/vision/detection/yolov6/quantize/python/infer.py +++ b/examples/vision/detection/yolov6/quantize/python/infer.py @@ -71,7 +71,7 @@ model = fd.vision.detection.YOLOv6( # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov7/python/infer.py b/examples/vision/detection/yolov7/python/infer.py index b0ece7e47..468b47dc5 100644 --- a/examples/vision/detection/yolov7/python/infer.py +++ b/examples/vision/detection/yolov7/python/infer.py @@ -52,7 +52,7 @@ if args.image is None: else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) # 预测结果可视化 vis_im = fd.vision.vis_detection(im, result) diff --git a/examples/vision/detection/yolov7/quantize/python/infer.py b/examples/vision/detection/yolov7/quantize/python/infer.py index de84e4061..d07834c7c 100644 --- a/examples/vision/detection/yolov7/quantize/python/infer.py +++ b/examples/vision/detection/yolov7/quantize/python/infer.py @@ -71,7 +71,7 @@ model = fd.vision.detection.YOLOv7( # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov7end2end_ort/python/infer.py b/examples/vision/detection/yolov7end2end_ort/python/infer.py index 2b812b71a..914facb59 100644 --- a/examples/vision/detection/yolov7end2end_ort/python/infer.py +++ b/examples/vision/detection/yolov7end2end_ort/python/infer.py @@ -44,7 +44,7 @@ model = fd.vision.detection.YOLOv7End2EndORT( # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolov7end2end_trt/python/infer.py b/examples/vision/detection/yolov7end2end_trt/python/infer.py index d179de06f..b1ad8ea0c 100644 --- a/examples/vision/detection/yolov7end2end_trt/python/infer.py +++ b/examples/vision/detection/yolov7end2end_trt/python/infer.py @@ -44,7 +44,7 @@ model = fd.vision.detection.YOLOv7End2EndTRT( # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 diff --git a/examples/vision/detection/yolox/python/infer.py b/examples/vision/detection/yolox/python/infer.py index 69203010b..c5e71754a 100644 --- a/examples/vision/detection/yolox/python/infer.py +++ b/examples/vision/detection/yolox/python/infer.py @@ -52,7 +52,7 @@ if args.image is None: else: image = args.image im = cv2.imread(image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 vis_im = fd.vision.vis_detection(im, result) diff --git a/examples/vision/facealign/face_landmark_1000/python/infer.py b/examples/vision/facealign/face_landmark_1000/python/infer.py index bbb3a19c8..9eaedfb63 100644 --- a/examples/vision/facealign/face_landmark_1000/python/infer.py +++ b/examples/vision/facealign/face_landmark_1000/python/infer.py @@ -82,7 +82,7 @@ model = fd.vision.facealign.FaceLandmark1000( # for image im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 vis_im = fd.vision.vis_face_alignment(im, result) diff --git a/examples/vision/facealign/pfld/python/infer.py b/examples/vision/facealign/pfld/python/infer.py index 622fbf822..0a695e8c6 100755 --- a/examples/vision/facealign/pfld/python/infer.py +++ b/examples/vision/facealign/pfld/python/infer.py @@ -80,7 +80,7 @@ model = fd.vision.facealign.PFLD(args.model, runtime_option=runtime_option) # for image im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 vis_im = fd.vision.vis_face_alignment(im, result) diff --git a/examples/vision/facealign/pipnet/python/infer.py b/examples/vision/facealign/pipnet/python/infer.py index 628b86f79..46f9c2d90 100644 --- a/examples/vision/facealign/pipnet/python/infer.py +++ b/examples/vision/facealign/pipnet/python/infer.py @@ -85,7 +85,7 @@ model = fd.vision.facealign.PIPNet(args.model, runtime_option=runtime_option) model.num_landmarks = args.num_landmarks # for image im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 vis_im = fd.vision.vis_face_alignment(im, result) diff --git a/examples/vision/facedet/retinaface/python/infer.py b/examples/vision/facedet/retinaface/python/infer.py index 3b0152b1c..6b7f63e5e 100644 --- a/examples/vision/facedet/retinaface/python/infer.py +++ b/examples/vision/facedet/retinaface/python/infer.py @@ -43,7 +43,7 @@ model = fd.vision.facedet.RetinaFace(args.model, runtime_option=runtime_option) # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 vis_im = fd.vision.vis_face_detection(im, result) diff --git a/examples/vision/facedet/scrfd/python/infer.py b/examples/vision/facedet/scrfd/python/infer.py index a99e66385..af141e011 100644 --- a/examples/vision/facedet/scrfd/python/infer.py +++ b/examples/vision/facedet/scrfd/python/infer.py @@ -43,7 +43,7 @@ model = fd.vision.facedet.SCRFD(args.model, runtime_option=runtime_option) # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 vis_im = fd.vision.vis_face_detection(im, result) diff --git a/examples/vision/facedet/scrfd/rknpu2/python/infer.py b/examples/vision/facedet/scrfd/rknpu2/python/infer.py index 3b3fc9d83..77e57a0f1 100644 --- a/examples/vision/facedet/scrfd/rknpu2/python/infer.py +++ b/examples/vision/facedet/scrfd/rknpu2/python/infer.py @@ -49,7 +49,7 @@ model.disable_normalize_and_permute() # 预测图片分割结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 diff --git a/examples/vision/facedet/ultraface/python/infer.py b/examples/vision/facedet/ultraface/python/infer.py index 5399110b9..2087ce5bf 100644 --- a/examples/vision/facedet/ultraface/python/infer.py +++ b/examples/vision/facedet/ultraface/python/infer.py @@ -43,7 +43,7 @@ model = fd.vision.facedet.UltraFace(args.model, runtime_option=runtime_option) # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 vis_im = fd.vision.vis_face_detection(im, result) diff --git a/examples/vision/facedet/yolov5face/python/infer.py b/examples/vision/facedet/yolov5face/python/infer.py index a9f044682..ca907afb4 100644 --- a/examples/vision/facedet/yolov5face/python/infer.py +++ b/examples/vision/facedet/yolov5face/python/infer.py @@ -43,7 +43,7 @@ model = fd.vision.facedet.YOLOv5Face(args.model, runtime_option=runtime_option) # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 预测结果可视化 vis_im = fd.vision.vis_face_detection(im, result) diff --git a/examples/vision/headpose/fsanet/python/infer.py b/examples/vision/headpose/fsanet/python/infer.py index 866ce6d5c..488e35153 100644 --- a/examples/vision/headpose/fsanet/python/infer.py +++ b/examples/vision/headpose/fsanet/python/infer.py @@ -80,7 +80,7 @@ model = fd.vision.headpose.FSANet(args.model, runtime_option=runtime_option) # for image im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 vis_im = fd.vision.vis_headpose(im, result) diff --git a/examples/vision/matting/modnet/python/infer.py b/examples/vision/matting/modnet/python/infer.py index 408ba2340..abb9be037 100644 --- a/examples/vision/matting/modnet/python/infer.py +++ b/examples/vision/matting/modnet/python/infer.py @@ -52,7 +52,7 @@ model.size = (256, 256) # 预测图片抠图结果 im = cv2.imread(args.image) bg = cv2.imread(args.bg) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 vis_im = fd.vision.vis_matting_alpha(im, result) diff --git a/examples/vision/matting/ppmatting/python/infer.py b/examples/vision/matting/ppmatting/python/infer.py index 61031e1b6..32a81eca7 100644 --- a/examples/vision/matting/ppmatting/python/infer.py +++ b/examples/vision/matting/ppmatting/python/infer.py @@ -56,7 +56,7 @@ model = fd.vision.matting.PPMatting( # 预测图片抠图结果 im = cv2.imread(args.image) bg = cv2.imread(args.bg) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 vis_im = fd.vision.vis_matting(im, result) diff --git a/examples/vision/matting/rvm/python/infer.py b/examples/vision/matting/rvm/python/infer.py index 11951b00f..fcde64fb2 100755 --- a/examples/vision/matting/rvm/python/infer.py +++ b/examples/vision/matting/rvm/python/infer.py @@ -73,7 +73,7 @@ if args.video is not None: # for video cap = cv2.VideoCapture(args.video) # Define the codec and create VideoWriter object - fourcc = cv2.VideoWriter_fourcc(*'mp4v') + fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v') composition = cv2.VideoWriter(output_composition, fourcc, 20.0, (1080, 1920)) alpha = cv2.VideoWriter(output_alpha, fourcc, 20.0, (1080, 1920)) @@ -100,7 +100,7 @@ if args.video is not None: if args.image is not None: # for image im = cv2.imread(args.image) - result = model.predict(im.copy()) + result = model.predict(im) print(result) # 可视化结果 vis_im = fd.vision.vis_matting(im, result) diff --git a/examples/vision/segmentation/paddleseg/python/infer.py b/examples/vision/segmentation/paddleseg/python/infer.py index 866e32bfb..9df7665a2 100644 --- a/examples/vision/segmentation/paddleseg/python/infer.py +++ b/examples/vision/segmentation/paddleseg/python/infer.py @@ -49,7 +49,7 @@ model = fd.vision.segmentation.PaddleSegModel( # 预测图片分割结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果 diff --git a/examples/vision/segmentation/paddleseg/quantize/python/infer.py b/examples/vision/segmentation/paddleseg/quantize/python/infer.py index f95f04d17..85a875c1e 100644 --- a/examples/vision/segmentation/paddleseg/quantize/python/infer.py +++ b/examples/vision/segmentation/paddleseg/quantize/python/infer.py @@ -72,5 +72,5 @@ model = fd.vision.segmentation.PaddleSegModel( # 预测图片检测结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) diff --git a/examples/vision/segmentation/paddleseg/rknpu2/python/infer.py b/examples/vision/segmentation/paddleseg/rknpu2/python/infer.py index 8841132a9..d7239eb42 100644 --- a/examples/vision/segmentation/paddleseg/rknpu2/python/infer.py +++ b/examples/vision/segmentation/paddleseg/rknpu2/python/infer.py @@ -53,7 +53,7 @@ model.disable_normalize_and_permute() # 预测图片分割结果 im = cv2.imread(args.image) -result = model.predict(im.copy()) +result = model.predict(im) print(result) # 可视化结果