-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add tests for Cityscapes Dataset #1079
Conversation
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.
This looks awesome, thanks a lot for the great PR!
I'm just waiting for CI to finish, and then this is good to merge!
Can you add a test for having multiple target types, e.g semantic and polygon? |
Codecov Report
@@ Coverage Diff @@
## master #1079 +/- ##
==========================================
+ Coverage 63.92% 64.52% +0.59%
==========================================
Files 68 68
Lines 5406 5406
Branches 829 829
==========================================
+ Hits 3456 3488 +32
+ Misses 1707 1666 -41
- Partials 243 252 +9
Continue to review full report at Codecov.
|
@TheCodez yep can do +1 |
@fmassa I'll do it in this PR I think +1 |
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.
LGTM 👍
def cityscapes_root(): | ||
|
||
def _make_image(file): | ||
PIL.Image.fromarray(np.zeros((1024, 2048, 3), dtype=np.uint8)).save(file) |
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 don't know how big the impact is but maybe we could use a smaller image size here instead of the original size to make the tests run faster?
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.
We are not performing any significant operations on the inputs, so this should not be a problem speed-wise.
But good point!
semantic
,instance
,polygon
,color
) and modes (gtFine
,gtCoarse
).generic_segmentation_dataset_test
- checks the outputs (image and mask) are bothPIL.Image
target_dir_zip
for coarse mode (discovered with tests ;))Tried to base this on the style of the other dataset tests - it's a bit more involved with Cityscapes mocking, but let me know if you have any further ideas/refinements for testing and I can incorporate.