This is an automated email from the ASF dual-hosted git repository.

bhulette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f02372a02e Remove normalization in Pytorch Image Segmentation example 
(#22371)
4f02372a02e is described below

commit 4f02372a02e30394fc48b6c60530d5a5eb00b06c
Author: Andy Ye <[email protected]>
AuthorDate: Tue Aug 2 11:52:40 2022 -0500

    Remove normalization in Pytorch Image Segmentation example (#22371)
    
    * Remove normalization
    
    * Unskip test
    
    * Remove normalize comments
---
 .../apache_beam/examples/inference/pytorch_image_segmentation.py     | 5 -----
 sdks/python/apache_beam/ml/inference/pytorch_inference_it_test.py    | 1 -
 2 files changed, 6 deletions(-)

diff --git 
a/sdks/python/apache_beam/examples/inference/pytorch_image_segmentation.py 
b/sdks/python/apache_beam/examples/inference/pytorch_image_segmentation.py
index e0e2e676052..8e4a682fb18 100644
--- a/sdks/python/apache_beam/examples/inference/pytorch_image_segmentation.py
+++ b/sdks/python/apache_beam/examples/inference/pytorch_image_segmentation.py
@@ -145,14 +145,9 @@ def read_image(image_file_name: str,
 
 def preprocess_image(data: Image.Image) -> torch.Tensor:
   image_size = (224, 224)
-  # Pre-trained PyTorch models expect input images normalized with the
-  # below values (see: https://pytorch.org/vision/stable/models.html)
-  normalize = transforms.Normalize(
-      mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
   transform = transforms.Compose([
       transforms.Resize(image_size),
       transforms.ToTensor(),
-      normalize,
   ])
   return transform(data)
 
diff --git a/sdks/python/apache_beam/ml/inference/pytorch_inference_it_test.py 
b/sdks/python/apache_beam/ml/inference/pytorch_inference_it_test.py
index 21b362d767d..5e377720408 100644
--- a/sdks/python/apache_beam/ml/inference/pytorch_inference_it_test.py
+++ b/sdks/python/apache_beam/ml/inference/pytorch_inference_it_test.py
@@ -93,7 +93,6 @@ class PyTorchInference(unittest.TestCase):
 
   @pytest.mark.uses_pytorch
   @pytest.mark.it_postcommit
-  @pytest.mark.skip  # TODO(https://github.com/apache/beam/issues/22413): 
Debug input data issue and unskip
   def test_torch_run_inference_coco_maskrcnn_resnet50_fpn(self):
     test_pipeline = TestPipeline(is_integration_test=True)
     # text files containing absolute path to the coco validation data on GCS

Reply via email to