Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Fix stupid error

laurenspriem06774aeb611c
diff --git a/mobile/lib/services/machine_learning/semantic_search/frameworks/onnx/onnx_image_encoder.dart b/mobile/lib/services/machine_learning/semantic_search/frameworks/onnx/onnx_image_encoder.dart
index e101a34399..c750ad461d 100644
--- a/mobile/lib/services/machine_learning/semantic_search/frameworks/onnx/onnx_image_encoder.dart
+++ b/mobile/lib/services/machine_learning/semantic_search/frameworks/onnx/onnx_image_encoder.dart
@@ -93,8 +93,7 @@ class OnnxImageEncoder {
final int v2 = min(max(v.round(), 0), 255);
- // createTensorWithDataList is dump compared to reshape and hence has to be given with one channel after another
- final int i = (y * scaledWidth + x) + (c % 3) * 224 * 224; // TODO: is the use of scaledWidth here intentional, or is it a mistake to not use requiredWidth?
+ final int i = (y * requiredWidth + x) + c * 224 * 224;
result[i] = ((v2 / 255) - mean[c]) / std[c];
}