-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PY-557] E2E test for Semantic Mask conversion #761
Conversation
@@ -512,7 +512,7 @@ def export( | |||
image = Image.fromarray(mask) | |||
image.save(outfile) | |||
|
|||
with open(output_dir / "class_mapping.csv", "w") as f: | |||
with open(output_dir / "class_mapping.csv", "w", newline="") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In windows, the files generated by the convert cli command have an extra line in b/w every row, which fails the e2e test - as it fails to compare the output and expected file content, but works perfectly fine on linux/macos for some reason. Found the fix from these links:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a difference between line endings for Windows and Linux/Posix being interpreted different by the writer (\r\n
vs \n
), but couldn't swear to it.
Either way, you've solved it. Nice one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, straightforward approach, like it.
@@ -512,7 +512,7 @@ def export( | |||
image = Image.fromarray(mask) | |||
image.save(outfile) | |||
|
|||
with open(output_dir / "class_mapping.csv", "w") as f: | |||
with open(output_dir / "class_mapping.csv", "w", newline="") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a difference between line endings for Windows and Linux/Posix being interpreted different by the writer (\r\n
vs \n
), but couldn't swear to it.
Either way, you've solved it. Nice one.
Problem
No e2e-test for
darwin convert semantic_mask ...
Solution
Add the parameterised
semantic_mask
e2e-testChangelog
Add darwin convert e2e-test for semantic_mask format