Skip to content

armgit / ente

Public Imported from GitHub
0

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

Unabstract

Manav Rathi746a0230145e
diff --git a/web/apps/photos/src/services/ml/geom.ts b/web/apps/photos/src/services/ml/geom.ts
index 424c7ed7ac..d998dc64d5 100644
--- a/web/apps/photos/src/services/ml/geom.ts
+++ b/web/apps/photos/src/services/ml/geom.ts
@@ -7,14 +7,6 @@ export class Point {
this.y = y;
}
- public add(pt: Point): Point {
- return new Point(this.x + pt.x, this.y + pt.y);
- }
-
- public sub(pt: Point): Point {
- return new Point(this.x - pt.x, this.y - pt.y);
- }
-
public div(pt: Point): Point {
return new Point(this.x / pt.x, this.y / pt.y);
}
diff --git a/web/apps/photos/src/utils/machineLearning/index.ts b/web/apps/photos/src/utils/machineLearning/index.ts
index 352b79e13c..987eabc00e 100644
--- a/web/apps/photos/src/utils/machineLearning/index.ts
+++ b/web/apps/photos/src/utils/machineLearning/index.ts
@@ -18,12 +18,9 @@ import { getRenderableImage } from "utils/file";
import { clamp, warpAffineFloat32List } from "utils/image";
import mlIDbStorage from "utils/storage/mlIDbStorage";
-function getBoxCenterPt(topLeft: Point, bottomRight: Point): Point {
- return topLeft.add(bottomRight.sub(topLeft).div(new Point(2, 2)));
-}
-
export function enlargeBox(box: Box, factor: number = 1.5) {
- const center = getBoxCenterPt(box.topLeft, box.bottomRight);
+ const center = new Point(box.x + box.width / 2, box.y + box.height / 2);
+
const size = new Point(box.width, box.height);
const newHalfSize = new Point((factor * size.x) / 2, (factor * size.y) / 2);