mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-23 03:26:35 +00:00
working yolo default model with opencv
This commit is contained in:
@@ -28,11 +28,13 @@ std::vector<Detection> Inference::runInference(const cv::Mat &input)
|
||||
int rows = outputs[0].size[1];
|
||||
int dimensions = outputs[0].size[2];
|
||||
|
||||
bool yolov8 = false;
|
||||
bool yolov8 = true;
|
||||
// yolov5 has an output of shape (batchSize, 25200, 85) (Num classes + box[x,y,w,h] + confidence[c])
|
||||
// yolov8 has an output of shape (batchSize, 84, 8400) (Num classes + box[x,y,w,h])
|
||||
/*
|
||||
if (dimensions > rows) // Check if the shape[2] is more than shape[1] (yolov8)
|
||||
{
|
||||
std::cout << "yolov8 = " << yolov8 << std::endl;
|
||||
yolov8 = true;
|
||||
rows = outputs[0].size[2];
|
||||
dimensions = outputs[0].size[1];
|
||||
@@ -40,6 +42,8 @@ std::vector<Detection> Inference::runInference(const cv::Mat &input)
|
||||
outputs[0] = outputs[0].reshape(1, dimensions);
|
||||
cv::transpose(outputs[0], outputs[0]);
|
||||
}
|
||||
*/
|
||||
|
||||
float *data = (float *)outputs[0].data;
|
||||
|
||||
float x_factor = modelInput.cols / modelShape.width;
|
||||
|
||||
Reference in New Issue
Block a user