From 465e7bf1e4fabc56a158ea93a32ea5bc885f513b Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 11 Sep 2024 13:11:12 +0200 Subject: [PATCH] Skip only non-face cluster for tagged files --- lib/Command/Classify.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/Command/Classify.php b/lib/Command/Classify.php index 5ee62625..5e407bfe 100644 --- a/lib/Command/Classify.php +++ b/lib/Command/Classify.php @@ -110,8 +110,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int ]; foreach ($this->storageService->getFilesInMount($mount['storage_id'], $mount['override_root'], $models, $lastFileId) as $file) { $i++; - // if retry flag is set, skip tagged files $lastFileId = $file['fileid']; + $queueFile = new QueueFile(); + $queueFile->setStorageId($mount['storage_id']); + $queueFile->setRootId($mount['root_id']); + $queueFile->setFileId($file['fileid']); + $queueFile->setUpdate(false); + + if ($file['image']) { + if (in_array(ClusteringFaceClassifier::MODEL_NAME, $models)) { + $queues[ClusteringFaceClassifier::MODEL_NAME][] = $queueFile; + } + } + // if retry flag is set, skip other classifiers for tagged files if ($input->getOption('retry')) { $fileTags = $this->tagManager->getTagsForFiles([$lastFileId]); // check if processed tag is already in the tags @@ -119,19 +130,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int continue; } } - $queueFile = new QueueFile(); - $queueFile->setStorageId($mount['storage_id']); - $queueFile->setRootId($mount['root_id']); - $queueFile->setFileId($file['fileid']); - $queueFile->setUpdate(false); - if ($file['image']) { if (in_array(ImagenetClassifier::MODEL_NAME, $models)) { $queues[ImagenetClassifier::MODEL_NAME][] = $queueFile; } - if (in_array(ClusteringFaceClassifier::MODEL_NAME, $models)) { - $queues[ClusteringFaceClassifier::MODEL_NAME][] = $queueFile; - } } if ($file['video']) { if (in_array(MovinetClassifier::MODEL_NAME, $models)) {