run ml definitely after 5 batches (200 files each)
This commit is contained in:
parent
d515186450
commit
85638acb2b
|
@ -97,3 +97,5 @@ export const SCENE_DETECTION_IMAGE_SIZE = 224;
|
|||
// SSD with Mobilenet v2 initialized from Imagenet classification checkpoint. Trained on COCO 2017 dataset (images scaled to 320x320 resolution).
|
||||
// https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2
|
||||
export const OBJECT_DETECTION_IMAGE_SIZE = 320;
|
||||
|
||||
export const BATCHES_BEFORE_SYNCING_INDEX = 5;
|
||||
|
|
|
@ -25,7 +25,10 @@ import { MLFactory } from './machineLearningFactory';
|
|||
import mlIDbStorage from 'utils/storage/mlIDbStorage';
|
||||
import { getMLSyncConfig } from 'utils/machineLearning/config';
|
||||
import { CustomError, parseServerError } from 'utils/error';
|
||||
import { MAX_ML_SYNC_ERROR_COUNT } from 'constants/machineLearning/config';
|
||||
import {
|
||||
BATCHES_BEFORE_SYNCING_INDEX,
|
||||
MAX_ML_SYNC_ERROR_COUNT,
|
||||
} from 'constants/machineLearning/config';
|
||||
import FaceService from './faceService';
|
||||
import PeopleService from './peopleService';
|
||||
import ObjectService from './objectService';
|
||||
|
@ -82,8 +85,8 @@ class MachineLearningService {
|
|||
// may be need to just take synced files on latest ml version for indexing
|
||||
if (
|
||||
syncContext.outOfSyncFiles.length <= 0 ||
|
||||
(syncContext.nSyncedFiles === syncContext.config.batchSize &&
|
||||
Math.random() < 0.2)
|
||||
syncContext.nSyncedFiles ===
|
||||
syncContext.config.batchSize * BATCHES_BEFORE_SYNCING_INDEX
|
||||
) {
|
||||
await this.syncIndex(syncContext);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue