Skip to content

Commit

Permalink
fix learning methods tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzoh authored and dave7895 committed Mar 27, 2021
1 parent dce537d commit 3b4e683
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/learning_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In essence, the learning method interface allows us to implement these steps and
Next to FastAI.jl, you'll need to install

```juliarepl
] add DataAugmentation DLPipelines
] add DataAugmentation DLPipelines Colors
```

## Datasets
Expand Down Expand Up @@ -96,8 +96,8 @@ We implement [`encodeinput`](#) using [DataAugmenation.jl](https://github.com/lo
{cell=main}
```julia
using DataAugmentation
# for normalization
using FastAI: IMAGENET_MEANS, IMAGENET_STDS
using Colors: RGB
using FastAI: IMAGENET_MEANS, IMAGENET_STDS # color statistics for normalization

# Helper for crop based on context
getresizecrop(context::Training, sz) = DataAugmentation.RandomResizeCrop(sz)
Expand All @@ -110,6 +110,7 @@ function DLPipelines.encodeinput(
image)
tfm = DataAugmentation.compose(
getresizecrop(context, method.size),
ToEltype(RGB{Float32}),
ImageToTensor(),
Normalize(IMAGENET_MEANS, IMAGENET_STDS);
)
Expand Down

0 comments on commit 3b4e683

Please sign in to comment.