Merge branch 'main' into search_improvements
This commit is contained in:
commit
15905a99f1
4 changed files with 11 additions and 7 deletions
|
@ -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",
|
||||
|
|
|
@ -409,6 +409,7 @@
|
|||
"machineLearning": "机器学习",
|
||||
"magicSearch": "魔法搜索",
|
||||
"magicSearchDescription": "请使用我们的桌面应用程序来为您库中的待处理项目建立索引。",
|
||||
"loadingModel": "正在下载模型...",
|
||||
"status": "状态",
|
||||
"indexedItems": "已索引项目",
|
||||
"pendingItems": "待处理项目",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue