Skip to content

Commit 8d80713

Browse files
Big docs & readme update (#98)
The goal is to simplify the docs: to contain only what's this package about so we can keep it up-to-date, no duplicates (rather use cross-references), simpler structure, less talking. The biggest change in README is the addition of contributing section. Main changes in docs: Menu structure is simpler New example for integration with Flux.jl Added docs for MapFun and AggregateThenMapFun Removed the "Working with images in Julia" page (instead, it is only a tiny section in introduction that refers to JuliaImages docs) Removed indices.md Co-authored-by: Johnny Chen <[email protected]>
1 parent b3a1873 commit 8d80713

16 files changed

+379
-819
lines changed

Diff for: README.md

+43-39
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,33 @@
77
[![unittest][action-img]][action-url]
88
[![codecov][codecov-img]][codecov-url]
99

10-
A **fast** Julia library for increasing the number of training
11-
images by applying various transformations.
12-
13-
Augmentor is a real-time image augmentation library designed to
14-
render the process of artificial dataset enlargement more
15-
convenient, less error prone, and easier to reproduce. It offers
16-
the user the ability to build a *stochastic image-processing
17-
pipeline* -- which we will also refer to as *augmentation
18-
pipeline* -- using image operations as building blocks. For our
19-
purposes, an augmentation pipeline can be understood as a
20-
sequence of operations for which the parameters can (but need
21-
not) be random variables.
10+
**Augmentor.jl** is a *fast* Julia library designed to make the process of
11+
image augmentation more convenient, less error-prone, and easier to reproduce.
12+
It offers a simple way to build flexible **augmentation pipelines**. For our
13+
purposes, an augmentation pipeline can be understood as a sequence of
14+
operations for which the parameters can (but need not) be random variables.
15+
16+
When augmenting, Augmentor.jl uses multiple heuristics to generate efficient
17+
tailor-made code for the concrete user-specified augmentation pipeline. In
18+
particular, Augmentor tries to avoid the need for any intermediate images and
19+
aims to compute the output image directly from the input in one single pass.
20+
21+
## Overview
22+
23+
Augmentor.jl provides many augmentation operations such as rotations, flipping,
24+
blurring, and more. See the
25+
[documentation](https://evizero.github.io/Augmentor.jl/stable/operations/) for
26+
the complete list of available operations.
27+
28+
The package uses the `|>` operator to **compose** operations into a pipeline.
29+
30+
Prepared pipelines are applied to images by calling one of the higher-level
31+
functions: `augment`, `augment!`, or `augmentbatch!`.
32+
33+
The full documentation is available at
34+
[evizero.github.io/Augmentor.jl/](https://evizero.github.io/Augmentor.jl/).
35+
36+
## Example
2237

2338
```julia
2439
julia> pl = ElasticDistortion(6, scale=0.3, border=true) |>
@@ -38,44 +53,33 @@ julia> augment(img, pl)
3853

3954
![](https://evizero.github.io/Augmentor.jl/dev/mnist_preview.gif)
4055

41-
The Julia version of Augmentor is engineered specifically for
42-
high performance applications. It makes use of multiple
43-
heuristics to generate efficient tailor-made code for the
44-
concrete user-specified augmentation pipeline. In particular
45-
Augmentor tries to avoid the need for any intermediate images,
46-
but instead aims to compute the output image directly from the
47-
input in one single pass.
48-
49-
**Augmentor.jl** is the [Julia](http://julialang.org)
50-
implementation for Augmentor. The Python version of the same name
51-
is available [here](https://github.com/mdbloice/Augmentor).
56+
For more examples, see [the documentation](https://evizero.github.io/Augmentor.jl/).
5257

53-
## Package Overview
58+
## Contributing
5459

55-
Augmentor.jl provides:
60+
Contributions are greatly appreciated!
5661

57-
* predefined augmentation operations, e.g., `FlipX`
58-
* `|>` operator to compose operations into a pipeline
59-
* higher-lvel functions (`augment`, `augment!` and `augmentbatch!`) that works on a pipeline and image(s).
60-
61-
Check the [documentation](https://evizero.github.io/Augmentor.jl/stable/operations/) for a full list of operations.
62+
To report a potential **bug** or propose a **new feature**, please file a *new
63+
issue*. *Pull requests* are always welcome. However, to make sure the PR gets
64+
accepted, it is generally preferred when it follows a particular issue to which
65+
it refers.
6266

6367
## Citing Augmentor
6468

65-
If you use Augmentor for academic research and wish to cite it,
66-
please use the following paper.
69+
If you use Augmentor for academic research and wish to cite it, please use the
70+
following paper.
6771

68-
Marcus D. Bloice, Christof Stocker, and Andreas Holzinger,
69-
*Augmentor: An Image Augmentation Library for Machine Learning*,
70-
arXiv preprint **arXiv:1708.04680**,
72+
Marcus D. Bloice, Christof Stocker, and Andreas Holzinger, *Augmentor: An Image
73+
Augmentation Library for Machine Learning*, arXiv preprint **arXiv:1708.04680**,
7174
<https://arxiv.org/abs/1708.04680>, 2017.
7275

7376
## Acknowledgments
7477

75-
This package makes heavy use of the following packages in order
76-
to provide it's main functionality. To see at full list of
77-
utilized packages, please take a look at the [REQUIRE](./REQUIRE)
78-
file.
78+
This package is inspired by a Python library of the same name available at
79+
[github.com/mdbloice/Augmentor](https://github.com/mdbloice/Augmentor).
80+
81+
To provide most of the operations, Augmentor.jl makes heavy use of many
82+
packages. To name a few:
7983

8084
- [FugroRoames/CoordinateTransformations.jl](https://github.com/FugroRoames/CoordinateTransformations.jl)
8185
- [JuliaImages/ImageTransformations.jl](https://github.com/JuliaImages/ImageTransformations.jl)

Diff for: docs/Project.toml

+3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ Augmentor = "02898b10-1f73-11ea-317c-6393d7073e15"
33
DemoCards = "311a05b2-6137-4a5a-b473-18580a3d38b5"
44
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
55
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
6+
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
67
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
78
ImageDraw = "4381153b-2b60-58ae-a1ba-fd683676385f"
89
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
910
ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31"
1011
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
12+
MLDataUtils = "cc2ba9b6-d476-5e6d-8eaf-a92d5412d41d"
1113
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
14+
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
1215
MosaicViews = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389"
1316
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
1417
PaddedViews = "5432bcbf-9aad-5242-b902-cca2824c8663"

Diff for: docs/examples/examples/assets/mnist_elastic.gif

-89.9 KB
Binary file not shown.

Diff for: docs/examples/examples/mnist_elastic.md

-125
This file was deleted.

Diff for: docs/examples/index.md

-12
This file was deleted.

Diff for: docs/make.jl

+31-25
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,53 @@ ENV["DATADEPS_ALWAYS_ACCEPT"] = true # MLDatasets
1515

1616
op_templates, op_theme = cardtheme("grid")
1717
operations, operations_cb = makedemos("operations", op_templates)
18-
examples_templates, examples_theme = cardtheme("list")
19-
examples, examples_cb = makedemos("examples", examples_templates)
2018

2119
format = Documenter.HTML(edit_link = "master",
2220
prettyurls = get(ENV, "CI", nothing) == "true",
2321
assets = [
2422
joinpath("assets", "favicon.ico"),
2523
joinpath("assets", "style.css"),
26-
op_theme,
27-
examples_theme
24+
op_theme
2825
]
2926
)
3027

28+
About = "Introduction" => "index.md"
29+
30+
GettingStarted = "gettingstarted.md"
31+
32+
UserGuide = "User's guide" => [
33+
"interface.md",
34+
operations
35+
]
36+
37+
DevGuide = "Developer's guide" => [
38+
"wrappers.md"
39+
]
40+
41+
Examples = "Examples" => [
42+
"examples/flux.md"
43+
]
44+
45+
License = "License" => "license.md"
46+
47+
PAGES = [
48+
About,
49+
GettingStarted,
50+
UserGuide,
51+
DevGuide,
52+
Examples,
53+
License
54+
]
55+
3156
makedocs(
3257
modules = [Augmentor],
3358
sitename = "Augmentor.jl",
3459
authors = "Christof Stocker",
35-
# linkcheck = true,
3660
format = format,
37-
pages = [
38-
"Home" => "index.md",
39-
"gettingstarted.md",
40-
"Introduction and Motivation" => [
41-
"background.md",
42-
"images.md",
43-
],
44-
"User's Guide" => [
45-
"interface.md",
46-
operations
47-
],
48-
"Developer's Guide" => [
49-
"wrappers.md"
50-
],
51-
"Tutorials" => examples,
52-
hide("Indices" => "indices.md"),
53-
"LICENSE.md",
54-
],
55-
# doctest=:fix, # used to fix outdated doctest
61+
checkdocs = :exports,
62+
pages = PAGES
5663
)
5764

5865
operations_cb()
59-
examples_cb()
6066

6167
deploydocs(repo = "github.com/Evizero/Augmentor.jl.git")

Diff for: docs/operations/misc/config.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"order":[
33
"layout.jl",
4-
"utilities.jl"
4+
"utilities.jl",
5+
"higherorder.jl"
56
]
67
}

Diff for: docs/operations/misc/higherorder.jl

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ---
2+
# title: Higher-order functions
3+
# description: a set of helper opeartions that allow applying any function
4+
# ---
5+
6+
# These operations are useful to perform an operation that is not explicitly
7+
# defined in Augmentor.
8+
9+
using Augmentor
10+
using Random
11+
using Statistics: mean
12+
13+
Random.seed!(1337)
14+
15+
DecreaseContrast = MapFun(pixel -> pixel / 2)
16+
IncreaseBrightness = AggregateThenMapFun(img -> mean(img),
17+
(pixel, M) -> pixel + M / 5)
18+
19+
img_in = testpattern(RGB, ratio=0.5)
20+
img_out = augment(img_in, DecreaseContrast |> IncreaseBrightness)
21+
22+
# ## References
23+
24+
#md # ```@docs
25+
#md # MapFun
26+
#md # AggregateThenMapFun
27+
#md # ```
28+

Diff for: docs/operations/misc/utilities.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ---
22
# title: Composition utilities
33
# cover: utilities.gif
4-
# description: a set of helper opeartions that may be useful when compositing more complex augmentation workflow
4+
# description: a set of helper operations that may be useful when compositing more complex augmentation workflow
55
# ---
66

77
# Aside from "true" operations that specify some kind of transformation, there are also a couple of

0 commit comments

Comments
 (0)