Added cityscapes dataset#225
Conversation
|
Hello! This is my first contribution to tensorflow-datasets! I actually had a few quick questions / design items to discuss before merging this.
|
|
I've used pngquant to compress the fake images! |
|
@f1recracker some dataset's test generate own images and label like |
|
@f1recracker - for running the tests, you can also invoke them from command line directly (assuming you're in the top directory): python3 -m tensorflow_datasets.image.celeba_test |
|
I've fixed most of the changes but I have observed that If mocking extract is intentional, then I have a few work arounds to solve this issue:
|
|
@f1recracker - yes, you're right, this is an inconsistency in our testing framework that we introduced when adding DL_EXTRACT_RESULT. @pierrot0 - Pierre, can you comment on the extract issue and what is the recommended way @f1recracker should follow? |
|
Has there been any updates on this? Sorry I got a little caught up with some work during the past few weeks! |
|
It seems that the latest version fixed the inconsistency and also another error. I've also refactored my code to now use BuilderConfigs instead of having separate classes for Cityscapes - fine and Cityscapes - coarse. |
|
@f1recracker Thanks for the PR! Would it be also possible to add the depth data of the Cityscapes dataset as an additional feature? |
|
I wasn't aware of the depth maps - let me have a look at this. |
|
Thanks for taking a look! |
|
@f1recracker The stereo pair right images would also be a great addition to this PR. |
|
@lgeiger Added support for right images and disparity maps too. Cityscapes now has 4 configurations:
Let me know your thoughts on this configuration. Could this be reviewed again? There's significant changes since the last review (BuilderConfigs so no abcs, and the recent change with disparity maps)? Thanks! |
|
@f1recracker Thanks for working on this. |
|
Hey @netw0rkf10w as I see that there is high interest with this dataset, I'll try to merge it soon. |
|
@cyfra Thank you for your reply, and for your hard work! This is indeed a very popular dataset in computer vision, so the merge would benefit a lot of users. Looking forward to having this merged. |
|
|
||
| BUILDER_CONFIGS = [ | ||
| CityscapesConfig( | ||
| name='semantic_segmentation', |
There was a problem hiding this comment.
Instead of using configs, couldn't you merge all configs into a single one, and the user could afterward select only the feature he wants.
Or reduce the number of config to only two ?
Currently the code is quite difficult to read with a lot of if/else condition which make it difficult to understand.
There was a problem hiding this comment.
It was a deliberate choice - Disparity maps need additional permissions from the authors and aren't readily available. 'Extra' splits - whether for segmentation or for the disparity requires additional files (50GB). I chose this route so that each configuration so that it would work for all cases.
There was a problem hiding this comment.
I gave this some more thought today to see if I could refactor the code to use fewer if/else statements. The problem arises because Cityscapes has too many features that every user may not use.
- There's two 'datasets' for different tasks - semantic segmentation and disparity inference. Disparity tasks can also require the right images - another additional download.
- Every cityscapes 'dataset' (semantic seg / stereo depth) has an additional 'extra' split. This split is much larger and any labels provided are coarse grain instead.
I think we still need 4 (2 (task) x 2 (extra split)) configurations.
One feature that might reduce some if/else might be to use a constant feature dict and use a 'default' image tensor (since cityscape labels are images) if this is acceptable.
There was a problem hiding this comment.
Are there any tutorials on how to use this class please?
There was a problem hiding this comment.
You just have to do something along the lines of:
import tensorflow_datasets as tfds
dataset = tfds.load(name="cityscapes/semantic_segmentation_extra", split="train")
# Can also specify config from above.
I'd give a working Colab but unfortunately this is a pretty big dataset and requires manual download :)
There was a problem hiding this comment.
@f1recracker thank you for the reply!
I downloaded the dataset manually and will attempt to access it with the syntax you suggested
Thanks again.
|
Thanks a lot, @f1recracker, for continuing working on this! Unfortunately I am not yet familiar enough with the code to be able to help you. |
PiperOrigin-RevId: 287961867
|
Ok - dataset is submitted. Thanks a lot @f1recracker for your contribution and patience. |
Added Cityscapes dataset with segmentation labels. Fixes #214.