Dataset wrapper zoo

wolterlw: <p>A lot of my time working on any research project is spent figuring building <code>Dataset</code> subclasses to wrap publicly available datasets, also most of the “official implementation of *” repositories have different wrappers for the same datasets that basically do the same thing, but each time you have to figure out exactly what transformations are applied, how the data is sampled etc., which is repetitive and probably the least appealing part of work.</p>
<p>PyTorch has already a generally standardized way of implementing dataset classes and transformers, so creating a single repository for people to contribute wrappers of publicly available datasets doesn’t seem like a stretch. Even if a particular project needs data packaged differently it’s still way better to have a starting point.</p>
<p>I don’t think I’m the first one to come up with the idea, so my question is why Dataset Wrapper Zoo is not a thing yet.</p>

ptrblck: <p><code>torchvision.datasets</code> contains a lot of public datasets or wrappers for common datasets such as ImageNet.<br>
You could of course contribute new datasets to it.</p>
<p>I’m not sure what kind of data you are using, but it it’s not a vision dataset, you might want to e.g. contribute to <code>torchtext</code>.</p>

wolterlw: <p>As far as I understand datasets provided in <code>torchvision.datasets</code> are supposed to be available for setup in a single function call.<br>
What about datasets that need you to first register for access, than download a bunch of archives using your credentials and extract them.<br>
Such datasets need something like a short readme with installation instructions and sometimes even have their own dependencies.<br>
Are these suitable for <code>torchvision.datasets</code>?</p>

ptrblck: <p>I think they might still be suitable, if they will make your life easier once you get the dataset.<br>
<a href="https://pytorch.org/docs/stable/torchvision/datasets.html#imagenet">ImageNet</a> is such an example.<br>
There was a period, where you could directly download the dataset, but if I’m not mistaken, the download link was taken down, so that you would need to register now in order to download the dataset.</p>

wolterlw: <p>OK, thank you.<br>
There’s currently an unresolved issue about how to best structure dataset wrappers, so that is probably what creates friction for potential contributors.</p>

ptrblck: <p>Could you post a link to the issue?<br>
Also, maybe your idea of a community based dataset zoo could fit in the torch hub?</p>
<p>CC <a class="mention" href="/u/ailzhang">@ailzhang</a></p>

wolterlw: <p>So far it seems like reaching consensus proved to be difficult as both datasets and tasks they’re used for vary a lot.<br>
IMO a good starting point would be to first collect a bunch of contributed datasets someplace, possibly torch hub as you’ve suggested, to get a feel of how they’re used. After that it would be easier to create a robust abstraction.<br>
Because now every research repo has it’s own Datasets and custom DataLoaders. These are often times a pain to work with when you try to combine datasets from several different repos.<br>
<aside class="onebox githubissue">
  <header class="source">
      <a href="https://github.com/pytorch/vision/issues/1080" target="_blank" rel="nofollow noopener">github.com/pytorch/vision</a>
  </header>
  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewbox="0 0 14 16" aria-hidden="true"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/pytorch/vision/issues/1080" target="_blank" rel="nofollow noopener">Standardization of the datasets</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2019-07-03" data-time="12:30:46" data-timezone="UTC">12:30PM - 03 Jul 19 UTC</span>
      </div>


      <div class="user">
        <a href="https://github.com/pmeier" target="_blank" rel="nofollow noopener">
          <img alt="pmeier" src="https://avatars0.githubusercontent.com/u/6849766?v=4" class="onebox-avatar-inline" width="20" height="20">
          pmeier
        </a>
      </div>
    </div>
  </div>
</div>

<div class="github-row">
  <p class="github-content">This is a discussion issue which was kicked of by #1067. Some PRs that contain ideas are #1015 and #1025. I...</p>
</div>

<div class="labels">
    <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">module: datasets</span>
    <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">needs discussion</span>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
</p>

ptrblck: <aside class="quote no-group" data-username="wolterlw" data-post="7" data-topic="69540">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/wolterlw/48/9365_2.png" class="avatar"> wolterlw:</div>
<blockquote>
<p>Because now every research repo has it’s own Datasets and custom DataLoaders. These are often times a pain to work with when you try to combine datasets from several different repos.</p>
</blockquote>
</aside>
<p>Yes, that’s true and also maintaining/creating a dataset might be quite a lot of work.<br>
What is your feeling about the number of stale datasets “in the wild”?</p>

wolterlw: <p>A LOT of datasets still only have Matlab code samples, so yeah…</p>