Skip to content

armgit / ente

Public Imported from GitHub
0

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

Tweak

Manav Rathie8445d99fb9f
diff --git a/web/packages/new/photos/services/ml/crop.ts b/web/packages/new/photos/services/ml/crop.ts
index 1e305bbe7c..cd0cafed85 100644
--- a/web/packages/new/photos/services/ml/crop.ts
+++ b/web/packages/new/photos/services/ml/crop.ts
@@ -1,7 +1,7 @@
import type { Box } from "@/new/photos/services/ml/types";
import { blobCache } from "@/next/blob-cache";
import { ensure } from "@/utils/ensure";
-import type { FaceAlignment } from "./f-index";
+import type { FaceAlignment } from "./index-face";
export const saveFaceCrop = async (
imageBitmap: ImageBitmap,
diff --git a/web/packages/new/photos/services/ml/embedding.ts b/web/packages/new/photos/services/ml/embedding.ts
index bfb104c0f5..42047dd326 100644
--- a/web/packages/new/photos/services/ml/embedding.ts
+++ b/web/packages/new/photos/services/ml/embedding.ts
@@ -13,7 +13,7 @@ import log from "@/next/log";
import { apiURL } from "@/next/origins";
import { z } from "zod";
import { saveFaceIndex } from "./db";
-import { faceIndexingVersion } from "./f-index";
+import { faceIndexingVersion } from "./index-face";
import { type FaceIndex } from "./types";
/**
diff --git a/web/packages/new/photos/services/ml/image.ts b/web/packages/new/photos/services/ml/image.ts
index d7875fa348..114247a91b 100644
--- a/web/packages/new/photos/services/ml/image.ts
+++ b/web/packages/new/photos/services/ml/image.ts
@@ -1,6 +1,4 @@
-// TODO: These arise from the array indexing in the pre-processing code. Isolate
-// once that code settles down to its final place (currently duplicated across
-// web and desktop).
+// See: [Note: Allowing non-null assertions selectively]
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { ensure } from "@/utils/ensure";
diff --git a/web/packages/new/photos/services/ml/f-index.ts b/web/packages/new/photos/services/ml/index-face.ts
similarity index 98%
rename from web/packages/new/photos/services/ml/f-index.ts
rename to web/packages/new/photos/services/ml/index-face.ts
index c5ab400b9b..aeea87e041 100644
--- a/web/packages/new/photos/services/ml/f-index.ts
+++ b/web/packages/new/photos/services/ml/index-face.ts
@@ -1,7 +1,9 @@
-// The ML code in this file involves imperative array indexing and processing,
-// and allowing non-null assertions ("!") are the easiest way to get tsc to
-// accept it in the presence of noUncheckedIndexedAccess without obfuscating the
-// original algorithms.
+// [Note: Allowing non-null assertions selectively]
+//
+// The code in this file involves a lot of imperative array processing and
+// indexing, and allowing non-null assertions ("!") is the easiest way to get
+// TypeScript to accept it in the presence of noUncheckedIndexedAccess without
+// obfuscating the original algorithms.
//
/* eslint-disable @typescript-eslint/no-non-null-assertion */
diff --git a/web/packages/new/photos/services/ml/worker.ts b/web/packages/new/photos/services/ml/worker.ts
index 723ff14618..1879125a97 100644
--- a/web/packages/new/photos/services/ml/worker.ts
+++ b/web/packages/new/photos/services/ml/worker.ts
@@ -5,7 +5,7 @@ import log from "@/next/log";
import { expose } from "comlink";
import { fileLogID } from "../../utils/file";
import { pullFaceEmbeddings, putFaceIndex } from "./embedding";
-import { indexFaces } from "./f-index";
+import { indexFaces } from "./index-face";
/**
* Run operations related to machine learning (e.g. indexing) in a Web Worker.