mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 00:33:03 +08:00
[Other]Update im.copy() to im in examples (#854)
* Update keypointdetection result docs * Update im.copy() to im in examples
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -54,7 +54,7 @@ else:
|
||||
image = args.image
|
||||
|
||||
im = cv2.imread(image)
|
||||
result = model.predict(im.copy())
|
||||
result = model.predict(im)
|
||||
print(result)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
||||
# 预测结果可视化
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
# 可视化结果
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
# 可视化结果
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
# 可视化结果
|
||||
|
Reference in New Issue
Block a user