Skip to content

Commit 7591ae0

Browse files
Dmitry Sidnevanzhella-pankratova
andauthored
Fix preprocessing
Co-authored-by: Anzhella Pankratova <[email protected]>
1 parent 2a239e4 commit 7591ae0

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

demos/common/python/openvino/model_zoo/model_api/models/instance_segmentation.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,8 @@ def _get_segmentoly_outputs(self):
7373
return outputs
7474

7575
def preprocess(self, inputs):
76-
image = inputs
77-
meta = {'original_shape': image.shape}
78-
resized_image = self.resize(image, (self.w, self.h))
79-
meta.update({'resized_shape': resized_image.shape})
80-
input_image_size = resized_image.shape[:2]
81-
if self.resize_type == 'fit_to_window':
82-
resized_image = pad_image(resized_image, (self.w, self.h))
83-
resized_image = self.input_transform(resized_image)
84-
resized_image = self._change_layout(resized_image)
85-
dict_inputs = {self.image_blob_name: resized_image}
76+
dict_inputs, meta = super().preprocess(inputs)
77+
input_image_size = meta['resized_shape'].shape[:2]
8678
if self.type == 'segmentoly':
8779
assert len(self.image_info_blob_names) == 1
8880
input_image_info = np.asarray([[input_image_size[0], input_image_size[1], 1]], dtype=np.float32)

0 commit comments

Comments
 (0)