pytorch / pytorch/vision

[proposal] Add `instance` option to SBD dataset.

Open
#1,863 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement module: datasets
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

Hello,

Currently, the SBDataset does not have the option to return boundaries or segments of instances available on the original dataset, the function is fixed to class-specific only.

More info about the instances from the dataset README.

     o cls
     This directory contains category-specific segmentations and boundaries. There is one .mat file for
     each image. Each mat file contains a struct called GTcls with 3 fields:
         - GTcls.Segmentation is a single 2D image containing the segmentation. Pixels that belong to
         category k have value k, pixels that do not belong to any category have value 0.
         - GTcls.Boundaries is a cell array. GTcls.Boundaries{k} contains the boundaries of the k-th category.
         These have been stored as sparse arrays to conserve space, so make sure you convert them to full arrays
         when you want to use them/visualize them, eg : full(GTcls.Boundaries{15})
         - GTcls.CategoriesPresent is a list of the categories that are present.
 
     o inst
     This directory contains instance-specific segmentations and boundaries. There is one mat file for each
     image. Each mat file contains a struct called GTinst with 3 fields:
         - GTinst.Segmentation is a single 2D image containing the segmentation. Pixels belonging to the
         i-th instance have value i.
         - GTinst.Boundaries is a cell array. GTinst.Boundaries{i} contains the boundaries of the i-th instance.
         Again, these are sparse arrays.
         - GTinst.Categories is a vector with as many components as there are instances. GTinst.Categories(i) is
         the category label of the i-th instance.

Is this suggestion adequate?
I have already done these changes locally, if approved I will open a PR.

cc @pmeier

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SBDataset implementation and the instance section of the dataset README. Trace how the current class-specific segmentation and boundary data are selected, then verify that an instance option returns the corresponding instance segments and boundaries from the original dataset.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.