Skip to content
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

Places365 dataset #5382

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions torchvision/prototype/datasets/_builtin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
from .semeion import SEMEION
from .svhn import SVHN
from .voc import VOC
from .places365 import Places365Standard, Places365Challenge
76 changes: 76 additions & 0 deletions torchvision/prototype/datasets/_builtin/places365.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import io
from typing import Any, Callable, Dict, List, Optional

import torch
from torchdata.datapipes.iter import (
IterDataPipe,
Mapper,
Filter,
IterKeyZipper,
)
from torchvision.prototype.datasets.utils import (
Dataset,
DatasetConfig,
DatasetInfo,
HttpResource,
OnlineResource,
DatasetType,
)

from torchvision.prototype.datasets.utils._internal import INFINITE_BUFFER_SIZE, read_mat, hint_sharding, hint_shuffling

class Places365Standard(Dataset):
def _make_info(self) -> DatasetInfo:
return DatasetInfo(
name="places365standard",
type=DatasetType.IMAGE,
homepage="http://places2.csail.mit.edu/index.html",
)

def resources(self, config: DatasetConfig) -> List[OnlineResource]:
train_images = HttpResource(
"http://data.csail.mit.edu/places/places365/train_256_places365standard.tar",
sha256="",
)
val_images = HttpResource(
"http://data.csail.mit.edu/places/places365/val_256.tar",
sha256="",
)
test_images = HttpResource(
"http://data.csail.mit.edu/places/places365/test_256.tar",
sha256="",
)
file_list = (
"http://data.csail.mit.edu/places/places365/filelist_places365-standard.tar",
sha256="",
)
return [train_images, val_images, test_images, file_list]



class Places365Challenge(Dataset):
def _make_info(self) -> DatasetInfo:
return DatasetInfo(
name="places365challenge",
type=DatasetType.IMAGE,
homepage="http://places2.csail.mit.edu/index.html",
)

def resources(self, config: DatasetConfig) -> List[OnlineResource]:
train_images = HttpResource(
"http://data.csail.mit.edu/places/places365/train_large_places365challenge.tar",
sha256="",
)
val_images = HttpResource(
"http://data.csail.mit.edu/places/places365/val_256.tar",
sha256="",
)
test_images = HttpResource(
"http://data.csail.mit.edu/places/places365/test_256.tar",
sha256="",
)
file_list = (
"http://data.csail.mit.edu/places/places365/filelist_places365-challenge.tar",
sha256="",
)
return [train_images, val_images, test_images, file_list]
Loading