Skip to content

Commit c0bdef9

Browse files
authored
demos/interactive_face_detection: disable auto_resize (#3226)
There is only one model out of 6 which could make use of auto_resize. I don't think it's worth it to make it configurable.
1 parent f3e9321 commit c0bdef9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

demos/interactive_face_detection_demo/cpp/detectors.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ FaceDetection::FaceDetection(const std::string &pathToModel,
3030
void FaceDetection::submitRequest(const cv::Mat& frame) {
3131
width = static_cast<float>(frame.cols);
3232
height = static_cast<float>(frame.rows);
33-
request.set_input_tensor(wrapMat2Tensor(frame));
33+
resize2tensor(frame, request.get_input_tensor());
3434
request.start_async();
3535
}
3636

@@ -78,11 +78,8 @@ std::shared_ptr<ov::Model> FaceDetection::read(const ov::Core& core) {
7878
ov::preprocess::PrePostProcessor ppp(model);
7979
ppp.input().tensor().
8080
set_element_type(ov::element::u8).
81-
set_layout("NHWC").
82-
set_spatial_dynamic_shape();
83-
ppp.input().preprocess().
84-
resize(ov::preprocess::ResizeAlgorithm::RESIZE_LINEAR).
85-
convert_layout("NCHW");
81+
set_layout("NHWC");
82+
ppp.input().preprocess().convert_layout("NCHW");
8683
ppp.output(output).tensor().set_element_type(ov::element::f32);
8784
model = ppp.build();
8885
ov::set_batch(model, 1);

0 commit comments

Comments
 (0)