Skip to content

Commit

Permalink
Update documentation (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermolenkodev committed Aug 23, 2022
1 parent 02fb056 commit 76d90cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
26 changes: 13 additions & 13 deletions docs/transfer_learning.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ You can do so via the Image Preprocessing Pipeline description, and building a d

Here's code that will go through a folder structure received via ```dogsCatsSmallDatasetPath()```, loads and resizes the images, and applies the VGG-19 specific preprocessing.


**Note**: The preprocessing DSL has changed in KotlinDL 0.5.0.
You can find the docs for the previous version of the DSL [here](https://github.com/Kotlin/kotlindl/blob/release_0.4/docs/transfer_learning.md).

```kotlin
val preprocessing: Preprocessing = preprocess {
transformImage {
resize {
outputHeight = 224
outputWidth = 224
interpolation = InterpolationType.BILINEAR
}
convert { colorMode = ColorMode.BGR }
val preprocessing = pipeline<BufferedImage>()
.resize {
outputHeight = 224
outputWidth = 224
interpolation = InterpolationType.BILINEAR
}
transformTensor {
sharpen {
modelTypePreprocessing = TFModels.CV.VGG19()
}
.convert { colorMode = ColorMode.BGR }
.toFloatArray { }
.sharpen {
modelTypePreprocessing = TFModels.CV.VGG19()
}
}

val dogsVsCatsDatasetPath = dogsCatsSmallDatasetPath()

Expand Down
25 changes: 12 additions & 13 deletions docs/transfer_learning_functional.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,23 @@ This way makes it easier to get the labels for all the examples based on the fol
Now we need to create a `Dataset` from these images.
You can do so via the Image Preprocessing Pipeline description, and building a dataset from those.

**Note**: The preprocessing DSL has changed in KotlinDL 0.5.0.
You can find the docs for the previous version of the DSL [here](https://github.com/Kotlin/kotlindl/blob/release_0.4/docs/transfer_learning.md).

Here's code that will go through a folder structure received via ```dogsCatsSmallDatasetPath()```, loads and resizes the images, and applies the ResNet'50 specific preprocessing.

```kotlin
val preprocessing: Preprocessing = preprocess {
transformImage {
resize {
outputHeight = 224
outputWidth = 224
interpolation = InterpolationType.BILINEAR
}
convert { colorMode = ColorMode.BGR }
val preprocessing = pipeline<BufferedImage>()
.resize {
outputHeight = 224
outputWidth = 224
interpolation = InterpolationType.BILINEAR
}
transformTensor {
sharpen {
modelTypePreprocessing = TFModels.CV.ResNet50()
}
.convert { colorMode = ColorMode.RGB }
.toFloatArray { }
.sharpen {
modelTypePreprocessing = TFModels.CV.ResNet50()
}
}

val dogsVsCatsDatasetPath = dogsCatsSmallDatasetPath()
val dataset = OnFlyImageDataset.create(
Expand Down

0 comments on commit 76d90cb

Please sign in to comment.