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

docs: introduce MosaicViews as dataset preview utils #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31"
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
5 changes: 3 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Documenter, MLDatasets
using ImageShow # for better image display

## Commented out since gives warning
# DocMeta.setdocmeta!(MLDatasets, :DocTestSetup, :(using MLDatasets); recursive=true)
Expand Down Expand Up @@ -34,7 +35,7 @@ makedocs(
"Iris" => "datasets/Iris.md",
"Boston Housing" => "datasets/BostonHousing.md",
],

"Text" => Any[
"PTBLM" => "datasets/PTBLM.md",
"UD_English" => "datasets/UD_English.md",
Expand All @@ -54,4 +55,4 @@ makedocs(
)


deploydocs(repo = "github.com/JuliaML/MLDatasets.jl.git")
deploydocs(repo = "github.com/JuliaML/MLDatasets.jl.git")
17 changes: 17 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,20 @@ will trigger a download dialog to `~/.julia/datadeps/MNIST`. To
overwrite this on a case by case basis, it is possible to specify
a data directory directly in `traindata(dir = <directory>)` and
`testdata(dir = <directory>)`.

## Preview

For image dataset, [`MosaicViews`](https://github.com/JuliaArrays/MosaicViews.jl) provides a very simple interface to display a list
of images.
Comment on lines +61 to +62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that MosaicViews is not directly used in the code below is a bit confusing.
Maybe we can just point to the mosaic function from ImageCore.


```@example
using MLDatasets
using ImageCore

# The original dataset is stored in row-major order, to display it
# normally in Julia, we need to permute the first two dimensions.
test_x = Gray.(PermutedDimsArray(MNIST.testtensor(), (2, 1, 3)));
test_x_sample = @view test_x[:, :, 1:64];

mosaic(test_x_sample, nrow=8)
```