Ejemplo n.º 1
0
 def test_keep_aspect_ratio_resizer_overrided_by_user_pad(self):
     self.pipeline_config._model_params['resizer_min_dimension'] = 600
     self.pipeline_config._model_params['resizer_max_dimension'] = 1024
     self.pipeline_config._model_params['pad_to_max_dimension'] = True
     self.graph.graph['user_shapes'] = {'image_tensor': [{'shape': [1, 400, 300, 3]}]}
     self.assertTupleEqual((1024, 1024),
                           calculate_placeholder_spatial_shape(self.graph, self.match, self.pipeline_config))
Ejemplo n.º 2
0
 def test_default_keep_aspect_ratio_resizer(self):
     self.pipeline_config._model_params['resizer_min_dimension'] = 600
     self.pipeline_config._model_params['resizer_max_dimension'] = 1024
     self.assertTupleEqual(
         (600, 600),
         calculate_placeholder_spatial_shape(self.graph, self.match,
                                             self.pipeline_config))
Ejemplo n.º 3
0
 def test_default_fixed_shape_resizer(self):
     self.pipeline_config._model_params['resizer_image_height'] = 300
     self.pipeline_config._model_params['resizer_image_width'] = 600
     self.assertTupleEqual(
         (300, 600),
         calculate_placeholder_spatial_shape(self.graph, self.match,
                                             self.pipeline_config))
Ejemplo n.º 4
0
 def test_fixed_shape_resizer_overrided_by_user(self):
     self.pipeline_config._model_params['resizer_image_height'] = 300
     self.pipeline_config._model_params['resizer_image_width'] = 600
     self.graph.graph['user_shapes'] = {
         'image_tensor': [{
             'shape': [1, 400, 500, 3]
         }]
     }
     self.assertTupleEqual(
         (400, 500),
         calculate_placeholder_spatial_shape(self.graph, self.match,
                                             self.pipeline_config))