Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
facundoq committed Jul 12, 2022
1 parent 86e26d7 commit f4f68e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ Dataset class for PyTorch and the TinyImageNet dataset.

# How to use
````
split ="train" # can also be "val" or "test". Note that "test" does not have labels
dataset = TinyImageNet(Path("~/.torchvision/tinyimagenet/"),split=split)
n = len(dataset)
print(f"TinyImageNet, split {split}, has {n} samples.")
print("Showing some samples")
for i in range(0,n,n//5):
image,klass = dataset[i]
print(f"Sample of class {klass:3d}, image {image}, words {dataset.idx_to_words[klass]}")
from tinyimagenet import TinyImageNet
import logging
from pathlib import Path
logging.basicConfig(level=logging.INFO)
split ="val"
dataset = TinyImageNet(Path("~/.torchvision/tinyimagenet/"),split=split)
n = len(dataset)
print(f"TinyImageNet, split {split}, has {n} samples.")
n_samples = 5
print(f"Showing info of {n_samples} samples...")
for i in range(0,n,n//n_samples):
image,klass = dataset[i]
print(f"Sample of class {klass:3d}, image {image}, words {dataset.idx_to_words[klass]}")
````
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


url="https://github.com/facundoq/torchvision-tinyimagenet"
VERSION="0.1"
VERSION="0.2"

class UploadCommand(Command):
"""Support setup.py upload."""
Expand Down
1 change: 1 addition & 0 deletions tinyimagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def load_words_classes(self,root:Path):


if __name__ == '__main__':

logging.basicConfig(level=logging.INFO)

split ="val"
Expand Down

0 comments on commit f4f68e7

Please sign in to comment.