Skip to content

Commit cd2dfb3

Browse files
authored
Merge pull request #3187 from Wovchena/demos/interactive_face_detection-fix-slices
demos/interactive_face_detection: fix slices
2 parents e7d758c + bd383a4 commit cd2dfb3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

demos/interactive_face_detection_demo/cpp/detectors.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void AntispoofingClassifier::enqueue(const cv::Mat& face) {
207207
}
208208
ov::Tensor batch = request.get_input_tensor();
209209
batch.set_shape(inShape);
210-
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces, inShape[1], inShape[2], inShape[3]}});
210+
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces + 1, inShape[1], inShape[2], inShape[3]}});
211211
enquedFaces++;
212212
}
213213

@@ -259,7 +259,7 @@ void AgeGenderDetection::enqueue(const cv::Mat &face) {
259259
}
260260
ov::Tensor batch = request.get_input_tensor();
261261
batch.set_shape(inShape);
262-
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces, inShape[1], inShape[2], inShape[3]}});
262+
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces + 1, inShape[1], inShape[2], inShape[3]}});
263263
enquedFaces++;
264264
}
265265

@@ -317,7 +317,7 @@ void HeadPoseDetection::enqueue(const cv::Mat &face) {
317317
}
318318
ov::Tensor batch = request.get_input_tensor();
319319
batch.set_shape(inShape);
320-
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces, inShape[1], inShape[2], inShape[3]}});
320+
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces + 1, inShape[1], inShape[2], inShape[3]}});
321321
enquedFaces++;
322322
}
323323

@@ -374,7 +374,7 @@ void EmotionsDetection::enqueue(const cv::Mat &face) {
374374
}
375375
ov::Tensor batch = request.get_input_tensor();
376376
batch.set_shape(inShape);
377-
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces, inShape[1], inShape[2], inShape[3]}});
377+
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces + 1, inShape[1], inShape[2], inShape[3]}});
378378
enquedFaces++;
379379
}
380380

@@ -452,7 +452,7 @@ void FacialLandmarksDetection::enqueue(const cv::Mat &face) {
452452
}
453453
ov::Tensor batch = request.get_input_tensor();
454454
batch.set_shape(inShape);
455-
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces, inShape[1], inShape[2], inShape[3]}});
455+
resize2tensor(face, ov::Tensor{batch, {enquedFaces, 0, 0, 0}, {enquedFaces + 1, inShape[1], inShape[2], inShape[3]}});
456456
enquedFaces++;
457457
}
458458

0 commit comments

Comments
 (0)