forked from aleju/imgaug
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Performance of ElasticTransformation (aleju#624)
This patch applies various performance-related changes to `ElasticTransformation`. These cover: (a) the re-use of generated random samples for multiple images in the same batch (with some adjustments so that they are not identical), (b) the caching of generated and re-useable arrays, (c) a performance-optimized smoothing method for the underlying displacement maps and (d) the use of nearest neighbour interpolation (`order=0`) instead of cubic interpolation (`order=3`) as the new default parameter for `order`. These changes lead to a speedup of about 3x to 4x (more for larger images) at a slight loss of visual quality (mainly from `order=0`) and variety (due to the re-use of random samples within each batch). The new smoothing method leads to slightly stronger displacements for larger `sigma` values.
- Loading branch information
Showing
7 changed files
with
285 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Improved Performance of `ElasticTransformation` #624 | ||
|
||
This patch applies various performance-related changes to | ||
`ElasticTransformation`. These cover: (a) the re-use of | ||
generated random samples for multiple images in the same | ||
batch (with some adjustments so that they are not identical), | ||
(b) the caching of generated and re-useable arrays, | ||
(c) a performance-optimized smoothing method for the | ||
underlying displacement maps and (d) the use of nearest | ||
neighbour interpolation (`order=0`) instead of cubic | ||
interpolation (`order=3`) as the new default parameter | ||
for `order`. | ||
|
||
These changes lead to a speedup of about 3x to 4x (more | ||
for larger images) at a slight loss of visual | ||
quality (mainly from `order=0`) and variety (due to the | ||
re-use of random samples within each batch). | ||
The new smoothing method leads to slightly stronger | ||
displacements for larger `sigma` values. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.