[Model] Refactoring code of YOLOv5Cls with new model type (#1237)

* Refactoring code of YOLOv5Cls with new model type

* fix reviewed problem

* Normalize&HWC2CHW -> NormalizeAndPermute

* remove cast()
This commit is contained in:
guxukai
2023-02-08 11:19:00 +08:00
committed by GitHub
parent c5b414a774
commit 9cd00ad4c5
14 changed files with 593 additions and 248 deletions

View File

@@ -44,8 +44,9 @@ args = parse_arguments()
runtime_option = build_option(args)
model = fd.vision.classification.YOLOv5Cls(
args.model, runtime_option=runtime_option)
model.postprocessor.topk = args.topk
# 预测图片分类结果
im = cv2.imread(args.image)
result = model.predict(im, args.topk)
result = model.predict(im)
print(result)