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

如何使用单张图片进行推理 #51

Open
hahher opened this issue Sep 25, 2024 · 3 comments
Open

如何使用单张图片进行推理 #51

hahher opened this issue Sep 25, 2024 · 3 comments

Comments

@hahher
Copy link

hahher commented Sep 25, 2024

我定时循环多个相机进行软触发获得cv::Mat图片,我获得的图片数据如何传入sophon-stream进行处理? decode配置文件目前指支持视频流或者文件夹,如果我需要定时推送cv::Mat图片数据需要如何实现

@Yi-sir
Copy link

Yi-sir commented Sep 25, 2024

stream没有很精准地支持过这种场景,可能自己写一段推理代码然后封装成一个服务更合适。如果一定要用stream做的话,可以考虑这样:
方案1:把图片写到一个固定的目录里,stream无限loop这个目录
方案2:输出base64流,stream的decode element接收这个流

@hahher
Copy link
Author

hahher commented Sep 25, 2024

如果自己写一段推理代码封装,有合适的demo参考嘛,是否可以吃满推理性能

@Yi-sir
Copy link

Yi-sir commented Sep 26, 2024

可以参考sophon-demo仓库的单路串行示例代码,这里以yolov5为例:https://github.com/sophgo/sophon-demo/tree/release/sample/YOLOv5
或者参考sophon-demo的并行示例代码:https://github.com/sophgo/sophon-demo/tree/release/application/YOLOv5_multi

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

No branches or pull requests

2 participants