Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YOLOv5-cls Model #335

Merged
merged 16 commits into from
Oct 12, 2022
Merged

Conversation

wjj19950828
Copy link
Collaborator

@wjj19950828 wjj19950828 commented Oct 9, 2022

PR types

New features

PR changes

Others

Describe

1、添加YOLOv5-cls模型部署支持
2、solved #138

eval_classify(YOLOv5n-cls)

后端 top1 top1_gt top5 top5_gt
OV(cpu) 64.6% 64.6% 85.4% 85.4%
ORT(cpu) 64.6% 64.6% 85.4% 85.4%
ORT(gpu) 64.6% 64.6% 85.4% 85.4%
TRT(gpu) 64.6% 64.6% 85.4% 85.4%

@@ -2,7 +2,7 @@

- YOLOv5 v6.0部署模型实现来自[YOLOv5](https://github.com/ultralytics/yolov5/tree/v6.0),和[基于COCO的预训练模型](https://github.com/ultralytics/yolov5/releases/tag/v6.0)
- (1)[官方库](https://github.com/ultralytics/yolov5/releases/tag/v6.0)提供的*.onnx可直接进行部署;
- (2)开发者基于自己数据训练的YOLOv5 v6.0模型,可使用[YOLOv5](https://github.com/ultralytics/yolov5)中的`export.py`导出ONNX文件后后,完成部署。
- (2)开发者基于自己数据训练的YOLOv5 v6.0模型,可使用[YOLOv5](https://github.com/ultralytics/yolov5)中的`export.py`导出ONNX文件后,完成部署。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yolov5-cls似乎不是 v6.0的版本?应该是v6.2

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是detection的yolov5,后后->后

@@ -15,6 +15,7 @@

#include "fastdeploy/core/config.h"
#ifdef ENABLE_VISION
#include "fastdeploy/vision/classification/contrib/yolov5.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

比较建议头文件的命名和模型名称保持一致,比如yolov5cls.h,这样能够和原来的yolov5区分开来

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

self.Predict(&mat, &res, topk);
return res;
})
.def_readwrite("size", &vision::classification::YOLOv5Cls::size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看到还有mean和std是public的成员,但这里没看到被pybind

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.在public的成员中将mean和std去掉

@@ -0,0 +1,116 @@
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。建议修改成yolov5cls.cc,这样也和python保持一致,我看到python是yolov5cls.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jiangjiajun
Copy link
Collaborator

增加单测

@wjj19950828
Copy link
Collaborator Author

wjj19950828 commented Oct 12, 2022

增加单测

Done.

@jiangjiajun jiangjiajun merged commit b557dbc into PaddlePaddle:develop Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants