Merge branch 'main' into search_improvements

This commit is contained in:
Vishnu Mohandas 2024-01-11 21:42:52 +05:30 committed by GitHub
commit 15905a99f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 7 deletions

View file

@ -498,7 +498,7 @@
},
"remindToEmptyEnteTrash": "Also empty your \"Trash\" to claim the freed up space",
"sparkleSuccess": "✨ Success",
"duplicateFileCountWithStorageSaved": "Your have cleaned up {count, plural, one{{count} duplicate file} other{{count} duplicate files}}, saving ({storageSaved}!)",
"duplicateFileCountWithStorageSaved": "You have cleaned up {count, plural, one{{count} duplicate file} other{{count} duplicate files}}, saving ({storageSaved}!)",
"@duplicateFileCountWithStorageSaved": {
"description": "The text to display when the user has successfully cleaned up duplicate files",
"type": "text",

View file

@ -409,6 +409,7 @@
"machineLearning": "机器学习",
"magicSearch": "魔法搜索",
"magicSearchDescription": "请使用我们的桌面应用程序来为您库中的待处理项目建立索引。",
"loadingModel": "正在下载模型...",
"status": "状态",
"indexedItems": "已索引项目",
"pendingItems": "待处理项目",

View file

@ -43,9 +43,10 @@ class OnnxImageEncoder {
for (int y = 0; y < ny; y++) {
for (int x = 0; x < nx; x++) {
final int i = 3 * (y * nx + x);
inputImage[i] = rgb.getPixel(x, y).r.toDouble();
inputImage[i + 1] = rgb.getPixel(x, y).g.toDouble();
inputImage[i + 2] = rgb.getPixel(x, y).b.toDouble();
final pixel = rgb.getPixel(x, y);
inputImage[i] = pixel.r.toDouble();
inputImage[i + 1] = pixel.g.toDouble();
inputImage[i + 2] = pixel.b.toDouble();
}
}
@ -111,8 +112,9 @@ class OnnxImageEncoder {
for (int i = 0; i < 512; i++) {
imageNormalization += embedding[i] * embedding[i];
}
final double sqrtImageNormalization = sqrt(imageNormalization);
for (int i = 0; i < 512; i++) {
embedding[i] = embedding[i] / sqrt(imageNormalization);
embedding[i] = embedding[i] / sqrtImageNormalization;
}
return embedding;
}

View file

@ -50,9 +50,10 @@ class OnnxTextEncoder {
for (int i = 0; i < 512; i++) {
textNormalization += embedding[i] * embedding[i];
}
final double sqrtTextNormalization = sqrt(textNormalization);
for (int i = 0; i < 512; i++) {
embedding[i] = embedding[i] / sqrt(textNormalization);
embedding[i] = embedding[i] / sqrtTextNormalization;
}
return (embedding);