Fix build

Revisit todos
This commit is contained in:
Shailesh Pandit 2022-01-15 09:39:27 +05:30
parent 4845c1d605
commit d1bab5ec84
5 changed files with 9 additions and 5 deletions

View file

@ -225,7 +225,8 @@ class BlazeFaceDetectionService implements FaceDetectionService {
); );
} }
// TODO: we might miss 1st pass face actually having score within threshold // we might miss 1st pass face actually having score within threshold
// it is ok as results will be consistent with 2nd pass only detections
if (selected && selected.probability >= BLAZEFACE_SCORE_THRESHOLD) { if (selected && selected.probability >= BLAZEFACE_SCORE_THRESHOLD) {
// console.log("pass2: ", { imageBox, paddedBox, transform, selected }); // console.log("pass2: ", { imageBox, paddedBox, transform, selected });
detections.push(selected); detections.push(selected);

View file

@ -150,7 +150,7 @@ export class LocalMLSyncContext implements MLSyncContext {
this.concurrency = concurrency || CONCURRENCY; this.concurrency = concurrency || CONCURRENCY;
console.log('Using concurrency: ', this.concurrency); console.log('Using concurrency: ', this.concurrency);
// TODO: set timeout, timeout is added on downloads // timeout is added on downloads
// timeout on queue will keep the operation open till worker is terminated // timeout on queue will keep the operation open till worker is terminated
this.syncQueue = new PQueue({ concurrency: this.concurrency }); this.syncQueue = new PQueue({ concurrency: this.concurrency });
logQueueStats(this.syncQueue, 'sync'); logQueueStats(this.syncQueue, 'sync');

View file

@ -180,6 +180,7 @@ class MachineLearningService {
} }
// TODO: not required if ml data is stored as field inside ente file object // TODO: not required if ml data is stored as field inside ente file object
// remove, not required now
// it removes ml data for files in trash, they will be resynced if restored // it removes ml data for files in trash, they will be resynced if restored
// private async syncRemovedFiles(syncContext: MLSyncContext) { // private async syncRemovedFiles(syncContext: MLSyncContext) {
// const db = await mlIDbStorage.db; // const db = await mlIDbStorage.db;
@ -220,6 +221,7 @@ class MachineLearningService {
} }
// TODO: optimize, use indexdb indexes, move facecrops to cache to reduce io // TODO: optimize, use indexdb indexes, move facecrops to cache to reduce io
// remove, already done
private async getUniqueOutOfSyncFilesNoIdx( private async getUniqueOutOfSyncFilesNoIdx(
syncContext: MLSyncContext, syncContext: MLSyncContext,
files: File[] files: File[]
@ -343,7 +345,8 @@ class MachineLearningService {
} }
// TODO: throw errors not related to specific file // TODO: throw errors not related to specific file
// sync job run should stop after these errors // sync job run should stop after these errors
// don't persist these errors against file // don't persist these errors against file,
// can include indexeddb/cache errors too
switch (error.message) { switch (error.message) {
case CustomError.SESSION_EXPIRED_MESSAGE: case CustomError.SESSION_EXPIRED_MESSAGE:
case CustomError.NETWORK_ERROR: case CustomError.NETWORK_ERROR:

View file

@ -1,4 +1,4 @@
// TODO: these utils only work in env where OffscreenCanvas is available // these utils only work in env where OffscreenCanvas is available
import { BlobOptions, Dimensions } from 'types/image'; import { BlobOptions, Dimensions } from 'types/image';
import { enlargeBox } from 'utils/machineLearning'; import { enlargeBox } from 'utils/machineLearning';

View file

@ -129,7 +129,7 @@ export async function migrateFaceInterfaceUpdate() {
console.log('migrateFaceInterfaceUpdate updating: ', updatedFiles.length); console.log('migrateFaceInterfaceUpdate updating: ', updatedFiles.length);
await mlIDbStorage.putAllFilesInTx(updatedFiles); await mlIDbStorage.putAllFilesInTx(updatedFiles);
await mlIDbStorage.incrementIndexVersion('faceSchema'); await mlIDbStorage.setIndexVersion('faceSchema', 1);
console.log('migrateFaceInterfaceUpdate done'); console.log('migrateFaceInterfaceUpdate done');
console.timeEnd('migrateFaceInterfaceUpdate'); console.timeEnd('migrateFaceInterfaceUpdate');
} }