Open lanbao2021 opened 2 years ago
Hi, Lan.
the error came from your code or my custom weight? or anything else to modified?
To be honest, there is no way to know. The best way here is debugging the code and check where the seg fault happens.
Also, double check if you are using a .onnx
file or .pt
file. OpenCV only works with .onnx
@doleron Thank you for your early reply!
I will try to figure it out by myself.
Hi, doleron.
I would like to add some information.
I debugged the yolo.cpp
by setting flag_num
as the image above.
Maybe the problem was caused by the data += 85
?
😵Could you please help me to understand the constant dimension
and rows
?
@doleron
@lanbao2021 85 is 80 (number of COCO classes) + 1 (confidence) + 4 (xywh). If your model has only 10 classes, replace 85 by 15. Check this article where I explain that, in particular the section "Unwrapping the output".
ohhhhhh! it works! !
😍Thank you very much! @doleron
Thanks for the feedback @lanbao2021 !
I'll keep this issue open to make it more visible for someone looking for the same problem.
@lanbao2021 85 is 80 (number of COCO classes) + 1 (confidence) + 4 (xywh). If your model has only 10 classes, replace 85 by 15. Check this article where I explain that, in particular the section "Unwrapping the output".
This article is really helpful !! and, can you please teach me how to calculate or find the rows if I change the input size, for example 416*416?
@lanbao2021 85 is 80 (number of COCO classes) + 1 (confidence) + 4 (xywh). If your model has only 10 classes, replace 85 by 15. Check this article where I explain that, in particular the section "Unwrapping the output".
This article is really helpful !! and, can you please teach me how to calculate or find the rows if I change the input size, for example 416*416?
@hanyuan97 Hello. Thank you! If you have some question about the article, can you ask there in medium?
Hi, it's me again.
I exported my custom weight file and modified
yolo.cpp
towards the path and classes.txt towards the labels.the error came from your code or my custom weight? or anything else to modified?
hope to your reply😍