@@ -81,22 +81,26 @@ void SSD::serialize(std::shared_ptr<ov::Model>& ov_model) {
8181 layout = utils::getLayoutFromShape (input_tensor.get_partial_shape ());
8282 }
8383
84+ auto config = ov_model->has_rt_info (" model_info" ) ? ov_model->get_rt_info <ov::AnyMap>(" model_info" ) : ov::AnyMap{};
85+
8486 auto interpolation_mode = cv::INTER_LINEAR;
85- utils::RESIZE_MODE resize_mode = utils::RESIZE_FILL;
87+ utils::RESIZE_MODE resize_mode = utils::RESIZE_MODE::RESIZE_FILL;
88+ resize_mode = utils::get_from_any_maps (" resize_type" , config, ov::AnyMap{}, resize_mode);
8689
8790 auto shape = input_tensor.get_partial_shape ().get_max_shape ();
8891
8992 auto input_shape = ov::Shape{shape[ov::layout::width_idx (layout)], shape[ov::layout::height_idx (layout)]};
9093 uint8_t pad_value = 0 ;
91-
92- auto config = ov_model->has_rt_info (" model_info" ) ? ov_model->get_rt_info <ov::AnyMap>(" model_info" ) : ov::AnyMap{};
94+ pad_value = utils::get_from_any_maps (" pad_value" , config, ov::AnyMap{}, pad_value);
9395
9496 std::vector<float > scale_values;
9597 std::vector<float > mean_values;
9698 scale_values = utils::get_from_any_maps (" scale_values" , config, ov::AnyMap{}, scale_values);
9799 mean_values = utils::get_from_any_maps (" mean_values" , config, ov::AnyMap{}, mean_values);
98100
99101 bool reverse_input_channels = false ;
102+ reverse_input_channels =
103+ utils::get_from_any_maps (" reverse_input_channels" , config, ov::AnyMap{}, reverse_input_channels);
100104
101105 ov_model = utils::embedProcessing (ov_model,
102106 input_tensor.get_any_name (),
@@ -204,9 +208,9 @@ DetectionResult SSD::postprocessMultipleOutputs(InferenceResult& infResult) {
204208 float invertedScaleX = floatInputImgWidth / input_shape.width ,
205209 invertedScaleY = floatInputImgHeight / input_shape.height ;
206210 int padLeft = 0 , padTop = 0 ;
207- if (utils::RESIZE_KEEP_ASPECT == resize_mode || utils::RESIZE_KEEP_ASPECT_LETTERBOX == resize_mode) {
211+ if (utils::RESIZE_MODE:: RESIZE_KEEP_ASPECT == resize_mode || utils::RESIZE_MODE ::RESIZE_KEEP_ASPECT_LETTERBOX == resize_mode) {
208212 invertedScaleX = invertedScaleY = std::max (invertedScaleX, invertedScaleY);
209- if (utils::RESIZE_KEEP_ASPECT_LETTERBOX == resize_mode) {
213+ if (utils::RESIZE_MODE:: RESIZE_KEEP_ASPECT_LETTERBOX == resize_mode) {
210214 padLeft = (input_shape.width - int (std::round (floatInputImgWidth / invertedScaleX))) / 2 ;
211215 padTop = (input_shape.height - int (std::round (floatInputImgHeight / invertedScaleY))) / 2 ;
212216 }
0 commit comments