Skip to content

Commit 384a961

Browse files
pushing empty mask so for ed_sensor_intagration to be able to apply correct labels from yolo per object
2 parents e068ed3 + ef9943d commit 384a961

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ void Utils::PostProcess(std::vector<Ort::Value>& output_tensors, const cv::Mat&
132132
if (output_tensors.empty())
133133
{
134134
CONSOLE_BRIDGE_logError("[SAM]: Decoder returned no outputs.");
135+
// Push empty mask to preserve index alignment with boxes (one mask slot per box).
136+
result.masks.push_back(cv::Mat());
135137
return;
136138
}
137139

@@ -148,6 +150,8 @@ void Utils::PostProcess(std::vector<Ort::Value>& output_tensors, const cv::Mat&
148150
if (masksIdx < 0)
149151
{
150152
CONSOLE_BRIDGE_logError("[SAM]: No 4D mask tensor found in decoder outputs.");
153+
// Push empty mask to preserve index alignment with boxes (one mask slot per box).
154+
result.masks.push_back(cv::Mat());
151155
return;
152156
}
153157

@@ -244,5 +248,7 @@ void Utils::PostProcess(std::vector<Ort::Value>& output_tensors, const cv::Mat&
244248
else
245249
{
246250
CONSOLE_BRIDGE_logError("[SAM]: Unexpected mask tensor shape.");
251+
// Push empty mask to preserve index alignment with boxes (one mask slot per box).
252+
result.masks.push_back(cv::Mat());
247253
}
248254
}

0 commit comments

Comments
 (0)