Skip to content

Commit

Permalink
Small model uses normalized image data
Browse files Browse the repository at this point in the history
  • Loading branch information
jtklein committed Jan 31, 2025
1 parent 4201754 commit 903dd15
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private void convertBitmapToByteBuffer(Bitmap bitmap) {
for (int x = 0; x < ImageClassifier.DIM_IMG_SIZE_X; x++) {
for (int y = 0; y < ImageClassifier.DIM_IMG_SIZE_Y; y++) {
int pixel = bitmap.getPixel(x, y);
if (mModelVersion.equals("1.0")) {
if (mModelVersion.equals("1.0") || mModelVersion.equals("small_2")) {
// Normalize channel values to [0.0, 1.0] for version 1.0
input[0][x][y][0] = Color.red(pixel) / 255.0f;
input[0][x][y][1] = Color.green(pixel) / 255.0f;
Expand Down

0 comments on commit 903dd15

Please sign in to comment.