Created
June 9, 2022 13:12
-
-
Save zaleslaw/ceb891704cb758e11f406c04ea21cf8f to your computer and use it in GitHub Desktop.
Image Preprocessing DSL
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
val preprocessing = preprocess { | |
transformImage { | |
centerCrop { | |
size = 214 | |
} | |
pad { | |
top = 10 | |
bottom = 10 | |
left = 10 | |
right = 10 | |
mode = PaddingMode.Fill(Color.BLACK) | |
} | |
convert { | |
colorMode = ColorMode.BGR | |
} | |
} | |
transformTensor { | |
normalize { | |
mean = floatArrayOf(103.939f, 116.779f, 123.68f) | |
std = floatArrayOf(57.375f, 57.12f, 58.395f) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment