Skip to content

armgit / ente

Public Imported from GitHub
0

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

Show direction

Manav Rathic9acda1b6d4b
diff --git a/web/apps/photos/src/pages/cluster-debug.tsx b/web/apps/photos/src/pages/cluster-debug.tsx
index 62d2e05df4..0798ad608d 100644
--- a/web/apps/photos/src/pages/cluster-debug.tsx
+++ b/web/apps/photos/src/pages/cluster-debug.tsx
@@ -7,6 +7,7 @@ import {
type ClusterPreviewFaceWF,
type ClusterPreviewWF,
} from "@/new/photos/services/ml";
+import { faceDirection } from "@/new/photos/services/ml/face";
import {
FlexWrapper,
FluidContainer,
@@ -236,6 +237,8 @@ const FaceItem: React.FC<FaceItemProps> = ({ faceWF, clusterIDForFaceID }) => {
};
}, [faceID, enteFile]);
+ const fd = faceDirection(face.detection);
+ const d = fd == "straight" ? "β€’" : fd == "left" ? "←" : "β†’";
return (
<FaceChip
style={{
@@ -255,13 +258,19 @@ const FaceItem: React.FC<FaceItemProps> = ({ faceWF, clusterIDForFaceID }) => {
)}
<Stack direction="row" justifyContent="space-between">
<Typography variant="small" color="text.muted">
- {`b ${face.blur.toFixed(0)} b`}
+ {`b${face.blur.toFixed(0)} `}
</Typography>
<Typography variant="small" color="text.muted">
- {`s ${face.score.toFixed(2)}`}
+ {`s${face.score.toFixed(1)}`}
</Typography>
<Typography variant="small" color="text.muted">
- {`c ${cosineSimilarity.toFixed(2)}`}
+ {`c${cosineSimilarity.toFixed(1)}`}
+ </Typography>
+ <Typography variant="small" color="text.muted">
+ {`c${cosineSimilarity.toFixed(1)}`}
+ </Typography>
+ <Typography variant="small" color="text.muted">
+ {`d${d}`}
</Typography>
</Stack>
</FaceChip>
diff --git a/web/packages/new/photos/services/ml/face.ts b/web/packages/new/photos/services/ml/face.ts
index 891b605db2..d8616b7426 100644
--- a/web/packages/new/photos/services/ml/face.ts
+++ b/web/packages/new/photos/services/ml/face.ts
@@ -714,7 +714,7 @@ const detectBlur = (
type FaceDirection = "left" | "right" | "straight";
-const faceDirection = ({ landmarks }: FaceDetection): FaceDirection => {
+export const faceDirection = ({ landmarks }: FaceDetection): FaceDirection => {
const leftEye = landmarks[0]!;
const rightEye = landmarks[1]!;
const nose = landmarks[2]!;