Remove
This commit is contained in:
parent
476edd8cf5
commit
e97225fa10
|
@ -151,22 +151,15 @@ const FaceCropImageView: React.FC<FaceCropImageViewProps> = ({ faceID }) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let didCancel = false;
|
let didCancel = false;
|
||||||
const electron = globalThis.electron;
|
if (faceID) {
|
||||||
|
blobCache("face-crops")
|
||||||
if (faceID && electron) {
|
.then((cache) => cache.get(faceID))
|
||||||
electron
|
.then((data) => {
|
||||||
.legacyFaceCrop(faceID)
|
|
||||||
.then(async (data) => {
|
|
||||||
if (data) return data;
|
|
||||||
/*
|
/*
|
||||||
TODO(MR): regen if needed and get this to work on web too.
|
TODO(MR): regen if needed and get this to work on web too.
|
||||||
cachedOrNew("face-crops", cacheKey, async () => {
|
cachedOrNew("face-crops", cacheKey, async () => {
|
||||||
return regenerateFaceCrop(faceId);
|
return regenerateFaceCrop(faceId);
|
||||||
})*/
|
})*/
|
||||||
const cache = await blobCache("face-crops");
|
|
||||||
return await cache.get(faceID);
|
|
||||||
})
|
|
||||||
.then((data) => {
|
|
||||||
if (data) {
|
if (data) {
|
||||||
const blob = new Blob([data]);
|
const blob = new Blob([data]);
|
||||||
if (!didCancel) setObjectURL(URL.createObjectURL(blob));
|
if (!didCancel) setObjectURL(URL.createObjectURL(blob));
|
||||||
|
|
|
@ -339,28 +339,6 @@ export interface Electron {
|
||||||
*/
|
*/
|
||||||
faceEmbeddings: (input: Float32Array) => Promise<Float32Array>;
|
faceEmbeddings: (input: Float32Array) => Promise<Float32Array>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a face crop stored by a previous version of ML.
|
|
||||||
*
|
|
||||||
* [Note: Legacy face crops]
|
|
||||||
*
|
|
||||||
* Older versions of ML generated and stored face crops in a "face-crops"
|
|
||||||
* cache directory on the Electron side. For the time being, we have
|
|
||||||
* disabled the face search whilst we put finishing touches to it. However,
|
|
||||||
* it'll be nice to still show the existing faces that have been clustered
|
|
||||||
* for people who opted in to the older beta.
|
|
||||||
*
|
|
||||||
* So we retain the older "face-crops" disk cache, and use this method to
|
|
||||||
* serve faces from it when needed.
|
|
||||||
*
|
|
||||||
* @param faceID An identifier corresponding to which the face crop had been
|
|
||||||
* stored by the older version of our app.
|
|
||||||
*
|
|
||||||
* @returns the JPEG data of the face crop if a file is found for the given
|
|
||||||
* {@link faceID}, otherwise undefined.
|
|
||||||
*/
|
|
||||||
legacyFaceCrop: (faceID: string) => Promise<Uint8Array | undefined>;
|
|
||||||
|
|
||||||
// - Watch
|
// - Watch
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue