Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Support TFDS format for segmentation #1005

Merged
merged 1 commit into from
Apr 22, 2020

Conversation

hadusam
Copy link
Contributor

@hadusam hadusam commented Apr 20, 2020

What this patch does to fix the issue.

Close #1002

Link to any relevant issues or pull requests.

Refs

I referred to the official tutorial of segmentation to decide the TFDS feature format. (image, label, segmentation_mask)
https://www.tensorflow.org/tutorials/images/segmentation#download_the_oxford-iiit_pets_dataset

tfds.core.DatasetInfo(
    name='oxford_iiit_pet',
    version=3.0.0,
    description='The Oxford-IIIT pet dataset is a 37 category pet image dataset with roughly 200
images for each class. The images have large variations in scale, pose and
lighting. All images have an associated ground truth annotation of breed.
',
    urls=['http://www.robots.ox.ac.uk/~vgg/data/pets/'],
    features=FeaturesDict({
        'file_name': Text(shape=(), dtype=tf.string),
        'image': Image(shape=(None, None, 3), dtype=tf.uint8),
        'label': ClassLabel(shape=(), dtype=tf.int64, num_classes=37),
        'segmentation_mask': Image(shape=(None, None, 1), dtype=tf.uint8),
    }),
    total_num_examples=7349,
    splits={
        'test': 3669,
        'train': 3680,
    },
    supervised_keys=('image', 'label'),
    citation="""@InProceedings{parkhi12a,
      author       = "Parkhi, O. M. and Vedaldi, A. and Zisserman, A. and Jawahar, C.~V.",
      title        = "Cats and Dogs",
      booktitle    = "IEEE Conference on Computer Vision and Pattern Recognition",
      year         = "2012",
    }""",
    redistribution_info=,
)

@hadusam hadusam added the enhancement New feature or request label Apr 20, 2020
@hadusam hadusam self-assigned this Apr 20, 2020
@blueoil-butler blueoil-butler bot added the CI: auto-run Run CI automatically label Apr 20, 2020
@bo-code-review-bot
Copy link

This PR needs Approvals as follows.

  • Ownership Approval for / from iizukak, tkng, ruimashita
  • Readability Approval for Python from tkng, tsawada, tfujiwar

Please choose reviewers and requet reviews!

Click to see how to approve each reviews

You can approve this PR by triggered comments as follows.

  • Approve all reviews requested to you (readability and ownership) and LGTM review
    Approval, LGTM

  • Approve all ownership reviews
    Ownership Approval or OA

  • Approve all readability reviews
    Readability Approval or RA

  • Approve specified review targets

    • Example of Ownership Reviewer of /: Ownership Approval for / or OA for /
    • Example of Readability Reviewer of Python: Readability Approval for Python or RA for Python
  • Approve LGTM review
    LGTM

See all trigger comments

Please replace [Target] to review target

  • Ownership Approval
    • Ownership Approval for [Target]
    • OA for [Target]
    • Ownership Approval
    • OA
    • Approval
  • Readability Approval
    • Readability Approval for [Target]
    • RA for [Target]
    • [Target] Readability Approval
    • [Target] RA
    • Readability Approval
    • RA
    • Approval
  • LGTM
    • LGTM
    • lgtm

@hadusam hadusam requested review from iizukak and tfujiwar April 20, 2020 01:20
Copy link
Contributor

@tfujiwar tfujiwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability Approval
Thanks for expanding TFDS datasets!!

description="Custom TFDS dataset for segmentation",
features=tfds.features.FeaturesDict({
"image": tfds.features.Image(),
"label": tfds.features.ClassLabel(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the feature label is used for having a list of classes but not needed for every example. Is my understanding correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tfujiwar
Yes! Your understanding is correct! 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hadusam
Copy link
Contributor Author

hadusam commented Apr 20, 2020

I checked and compared trainings with TFDS and without TFDS(local image files on directories) with my sample config. (CamVid with IMAGE_SIZE = [160, 240])
This looks the same between them 👍

image

@hadusam hadusam requested a review from tkng April 21, 2020 00:02
Copy link
Member

@iizukak iizukak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OA

@iizukak
Copy link
Member

iizukak commented Apr 22, 2020

/ready

@bo-mergebot
Copy link
Contributor

bo-mergebot bot commented Apr 22, 2020

⏳Merge job is queued...

@bo-mergebot bo-mergebot bot merged commit de6f23d into blue-oil:master Apr 22, 2020
@hadusam hadusam deleted the tfds_segmentation branch April 22, 2020 09:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI: auto-run Run CI automatically enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support TFDS format for Segmentation
3 participants