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

YOLOV8-SEG 如何快速获取mask掩码 #113

Closed
rrrrmy opened this issue Apr 12, 2024 · 6 comments
Closed

YOLOV8-SEG 如何快速获取mask掩码 #113

rrrrmy opened this issue Apr 12, 2024 · 6 comments

Comments

@rrrrmy
Copy link

rrrrmy commented Apr 12, 2024

No description provided.

@FeiYull
Copy link
Owner

FeiYull commented Apr 12, 2024

@rrrrmy

cv::imshow(m_param.winname, imgsBatch[bi] + m_img_canvas);

变量canvas

@rrrrmy
Copy link
Author

rrrrmy commented Apr 12, 2024

谢谢,已加星,但是获取到canvas需要用到YOLOv8Seg::showAndSave函数,我想实时在相机上获取对应照片的mask的话这个函数处理时间还是太高了,有什么间接的方法可以快速获得mask或者mask对应的多边形点吗?感谢! @FeiYull

@FeiYull
Copy link
Owner

FeiYull commented Apr 12, 2024

@rrrrmy

mask_instance = mask_instance > 0.5f;

对变量mask_instance执行opencv中查找凸包,或者轮廓函数,例如cv::findContours,如果你的图片中只有一个instance,循环一次,很快。越多越慢。

@rrrrmy
Copy link
Author

rrrrmy commented Apr 13, 2024

@FeiYull 谢谢你的耐心回答,另外我还发现在windows下的debug模式下,采用eigen库比利用opencv库做矩阵相乘与赋值的操作,eigen消耗的时间更久,不知道是不是debug模式的原因

@FeiYull
Copy link
Owner

FeiYull commented Apr 13, 2024

@rrrrmy 别用debug测速,可以自己改成opencv作矩阵乘法试一试

@rrrrmy
Copy link
Author

rrrrmy commented Apr 13, 2024

好的,谢谢!

@rrrrmy rrrrmy closed this as completed Apr 13, 2024
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