Skip to content

Commit

Permalink
Update image segmentation pipeline test (#18731)
Browse files Browse the repository at this point in the history
* Updated test values

The image segmentation pipeline tests - tests/pipelines/test_pipelines_image_segmentation.py - were failing after the merging of #1849  (49e44b2). This was due to the difference in rescaling. Previously the images were rescaled by `image = image / 255`. In the new commit, a `rescale` method was added, and images rescaled using `image = image * scale`. This was known to cause small differences in the processed images (see
[PR comment](#18499 (comment))).

Testing locally, changing the `rescale` method to divide by a scale factor (255) resulted in the tests passing. It was therefore decided the test values could be updated, as there was no logic difference between the commits.

* Use double quotes, like previous example

* Fix up
  • Loading branch information
amyeroberts authored Sep 15, 2022
1 parent 7743cac commit 30a28f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/pipelines/test_pipelines_image_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_integration_torch_image_segmentation(self):
self.assertEqual(
nested_simplify(outputs, decimals=4),
[
{"score": 0.9094, "label": "blanket", "mask": "85144e4bf8d624c2c6175f7faf57eb30"},
{"score": 0.9094, "label": "blanket", "mask": "6500201749480f87154fd967783b2b97"},
{"score": 0.9941, "label": "cat", "mask": "f3a7f80220788acc0245ebc084df6afc"},
{"score": 0.9987, "label": "remote", "mask": "7703408f54da1d0ebda47841da875e48"},
{"score": 0.9995, "label": "remote", "mask": "bd726918f10fed3efaef0091e11f923b"},
Expand All @@ -279,15 +279,15 @@ def test_integration_torch_image_segmentation(self):
nested_simplify(outputs, decimals=4),
[
[
{"score": 0.9094, "label": "blanket", "mask": "85144e4bf8d624c2c6175f7faf57eb30"},
{"score": 0.9094, "label": "blanket", "mask": "6500201749480f87154fd967783b2b97"},
{"score": 0.9941, "label": "cat", "mask": "f3a7f80220788acc0245ebc084df6afc"},
{"score": 0.9987, "label": "remote", "mask": "7703408f54da1d0ebda47841da875e48"},
{"score": 0.9995, "label": "remote", "mask": "bd726918f10fed3efaef0091e11f923b"},
{"score": 0.9722, "label": "couch", "mask": "226d6dcb98bebc3fbc208abdc0c83196"},
{"score": 0.9994, "label": "cat", "mask": "fa5d8d5c329546ba5339f3095641ef56"},
],
[
{"score": 0.9094, "label": "blanket", "mask": "85144e4bf8d624c2c6175f7faf57eb30"},
{"score": 0.9094, "label": "blanket", "mask": "6500201749480f87154fd967783b2b97"},
{"score": 0.9941, "label": "cat", "mask": "f3a7f80220788acc0245ebc084df6afc"},
{"score": 0.9987, "label": "remote", "mask": "7703408f54da1d0ebda47841da875e48"},
{"score": 0.9995, "label": "remote", "mask": "bd726918f10fed3efaef0091e11f923b"},
Expand Down

0 comments on commit 30a28f5

Please sign in to comment.