Skip to content

Commit 35e8bf6

Browse files
committed
Minor fixes to documentation
1 parent 61a752b commit 35e8bf6

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ImageNetDataset"
22
uuid = "d141d81c-f7c4-4296-8313-8866e6f9f78a"
33
authors = ["Adrian Hill <[email protected]>"]
4-
version = "1.0.0-DEV"
4+
version = "0.1.0"
55

66
[deps]
77
DataAugmentation = "88a5189c-e7ff-4f85-ac6b-e6158070f02e"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ dataset = ImageNet(:val; transform=tfm)
5858
Custom transformations can be implemented by extending `AbstractTransformation`.
5959

6060
To apply a transformation outside of the `ImageNet` dataset,
61-
e.g. to preprocess a single image add a given `path`, run
61+
e.g. to preprocess a single image at a given `path`, run
6262

6363
```julia
6464
transform(tfm, path)
@@ -82,6 +82,6 @@ dataset = ImageNet(:val; transform=tfm)
8282

8383
> [!NOTE]
8484
> This repository is based on [MLDatasets.jl PR #146](https://github.com/JuliaML/MLDatasets.jl/pull/146)
85-
> and mirrors the MLDatasets API.
85+
> and mirrors the MLDatasets `v0.7` API.
8686
>
8787
> Copyright (c) 2015 Hiroyuki Shindo and contributors.

docs/src/installation.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,25 @@ Download the following files from the [ILSVRC2012 download page](https://image-n
7070
You can use ImageNetDataset.jl without downloading all splits.
7171

7272
After downloading the data, move and extract the training and validation images to
73-
labeled subfolders by running the following shell script:
73+
labeled subfolders by running the following shell scripts:
7474

75+
**Extract metadata from the devkit:**
76+
```bash
77+
mkdir -p ImageNet/devkit && tar -xvf ILSVRC2012_devkit_t12.tar -C ImageNet/devkit --strip-components=1
78+
```
79+
80+
**Extract the training data:**
7581
```bash
76-
# Extract the training data:
7782
mkdir -p ImageNet/train && tar -xvf ILSVRC2012_img_train.tar -C ImageNet/train
7883

7984
# Unpack all 1000 compressed tar-files, one for each category:
8085
cd ImageNet/train
8186
find . -name "*.tar" | while read NAME ; do mkdir -p "\${NAME%.tar}"; tar -xvf "\${NAME}" -C "\${NAME%.tar}"; rm -f "\${NAME}"; done
87+
```
8288

83-
# Extract the validation data:
84-
cd ../..
89+
**Extract the validation data:**
90+
```bash
8591
mkdir -p ImageNet/val && tar -xvf ILSVRC2012_img_val.tar -C ImageNet/val
86-
87-
# Extract metadata from the devkit:
88-
cd ../..
89-
mkdir -p ImageNet/devkit && tar -xvf ILSVRC2012_devkit_t12.tar.gz -C ImageNet/devkit --strip-components=1
9092
```
9193

9294
And run the following script
@@ -97,4 +99,3 @@ to create all class directories and move images into corresponding directories:
9799
cd ImageNet/val
98100
wget -qO- https://raw.githubusercontent.com/Julia-XAI/ImageNetDataset.jl/master/docs/src/valprep.sh | bash
99101
```
100-

src/imagenet.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ function ImageNet(
131131
test_dir="test",
132132
devkit_dir="devkit",
133133
)
134-
@assert split (:train, :val, :test)
135-
136134
depname = "ImageNet"
137135
root_dir = get_datadep_dir(depname, dir)
138136

@@ -146,9 +144,11 @@ function ImageNet(
146144
elseif split == :val
147145
paths = get_file_paths(joinpath(root_dir, val_dir))
148146
@assert length(paths) == VALSET_SIZE
149-
else
147+
elseif split == :test
150148
paths = get_file_paths(joinpath(root_dir, test_dir))
151149
@assert length(paths) == TESTSET_SIZE
150+
else
151+
throw(ArgumentError("Unknown split :$split"))
152152
end
153153
targets = [metadata["wnid_to_label"][wnid] for wnid in get_wnids(paths)]
154154
return ImageNet(split, transform, paths, targets, metadata)

0 commit comments

Comments
 (0)