From ea909844812c23172b9a127e312174c8ebfca6be Mon Sep 17 00:00:00 2001 From: arodik Date: Thu, 29 Feb 2024 12:09:33 +0200 Subject: [PATCH] Fix dependencies --- .../src/services/facescan/plugins/adaface/data.py | 8 ++++---- .../services/facescan/plugins/adaface/dataset/__init__.py | 0 .../plugins/adaface/dataset/five_validation_dataset.py | 2 +- .../facescan/plugins/adaface/face_alignment/__init__.py | 0 .../adaface/face_alignment/mtcnn_pytorch/__init__.py | 0 .../src/services/facescan/plugins/adaface/inference.py | 3 --- .../src/services/facescan/plugins/adaface/main.py | 6 +++--- .../src/services/facescan/plugins/adaface/train_val.py | 6 +++--- .../plugins/adaface/validation_lq/PFE/__init__.py | 0 .../facescan/plugins/adaface/validation_lq/__init__.py | 0 .../plugins/adaface/validation_lq/validate_IJB_S.py | 4 ++-- .../facescan/plugins/adaface/validation_mixed/__init__.py | 0 .../validation_mixed/insightface_ijb_helper/__init__.py | 0 13 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 embedding-calculator/src/services/facescan/plugins/adaface/dataset/__init__.py create mode 100644 embedding-calculator/src/services/facescan/plugins/adaface/face_alignment/__init__.py create mode 100644 embedding-calculator/src/services/facescan/plugins/adaface/face_alignment/mtcnn_pytorch/__init__.py create mode 100644 embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/PFE/__init__.py create mode 100644 embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/__init__.py create mode 100644 embedding-calculator/src/services/facescan/plugins/adaface/validation_mixed/__init__.py create mode 100644 embedding-calculator/src/services/facescan/plugins/adaface/validation_mixed/insightface_ijb_helper/__init__.py diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/data.py b/embedding-calculator/src/services/facescan/plugins/adaface/data.py index 8ef327c8e1..b3db3ae5f3 100644 --- a/embedding-calculator/src/services/facescan/plugins/adaface/data.py +++ b/embedding-calculator/src/services/facescan/plugins/adaface/data.py @@ -4,10 +4,10 @@ from torchvision import transforms import numpy as np import pandas as pd -import evaluate_utils -from dataset.image_folder_dataset import CustomImageFolderDataset -from dataset.five_validation_dataset import FiveValidationDataset -from dataset.record_dataset import AugmentRecordDataset +import src.services.facescan.plugins.adaface.evaluate_utils +from src.services.facescan.plugins.adaface.dataset.image_folder_dataset import CustomImageFolderDataset +from src.services.facescan.plugins.adaface.dataset.five_validation_dataset import FiveValidationDataset +from src.services.facescan.plugins.adaface.dataset.record_dataset import AugmentRecordDataset class DataModule(pl.LightningDataModule): diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/dataset/__init__.py b/embedding-calculator/src/services/facescan/plugins/adaface/dataset/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/dataset/five_validation_dataset.py b/embedding-calculator/src/services/facescan/plugins/adaface/dataset/five_validation_dataset.py index 7ff91208ce..bab5d787f1 100644 --- a/embedding-calculator/src/services/facescan/plugins/adaface/dataset/five_validation_dataset.py +++ b/embedding-calculator/src/services/facescan/plugins/adaface/dataset/five_validation_dataset.py @@ -1,6 +1,6 @@ from torch.utils.data import Dataset import numpy as np -import evaluate_utils +import src.services.facescan.plugins.adaface.evaluate_utils import torch class FiveValidationDataset(Dataset): diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/face_alignment/__init__.py b/embedding-calculator/src/services/facescan/plugins/adaface/face_alignment/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/face_alignment/mtcnn_pytorch/__init__.py b/embedding-calculator/src/services/facescan/plugins/adaface/face_alignment/mtcnn_pytorch/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/inference.py b/embedding-calculator/src/services/facescan/plugins/adaface/inference.py index e12f77d0f2..9e96320093 100644 --- a/embedding-calculator/src/services/facescan/plugins/adaface/inference.py +++ b/embedding-calculator/src/services/facescan/plugins/adaface/inference.py @@ -4,9 +4,6 @@ import numpy as np from src.constants import ENV -#with open('config.json', 'r') as f: -# config = json.load(f) - device = ENV.DEVICE model_mame = ENV.RECOGNITION_MODEL model_path = ENV.RECOGNITION_MODEL_PATH diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/main.py b/embedding-calculator/src/services/facescan/plugins/adaface/main.py index b6fe03a246..2f62bd8543 100644 --- a/embedding-calculator/src/services/facescan/plugins/adaface/main.py +++ b/embedding-calculator/src/services/facescan/plugins/adaface/main.py @@ -6,10 +6,10 @@ from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.loggers import CSVLogger, WandbLogger from pytorch_lightning import seed_everything -import config +import src.services.facescan.plugins.adaface.config import os -from utils import dotdict -import train_val +from src.services.facescan.plugins.adaface.utils import dotdict +import src.services.facescan.plugins.adaface.train_val as train_val import data import inspect diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/train_val.py b/embedding-calculator/src/services/facescan/plugins/adaface/train_val.py index abba4cccdc..7a521dbc6c 100644 --- a/embedding-calculator/src/services/facescan/plugins/adaface/train_val.py +++ b/embedding-calculator/src/services/facescan/plugins/adaface/train_val.py @@ -3,9 +3,9 @@ import torch.optim.lr_scheduler as lr_scheduler from pytorch_lightning.core import LightningModule from torch.nn import CrossEntropyLoss -import evaluate_utils -import head -import net +import src.services.facescan.plugins.adaface.evaluate_utils as evaluate_utils +import src.services.facescan.plugins.adaface.head as head +import src.services.facescan.plugins.adaface.net as net import numpy as np import utils diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/PFE/__init__.py b/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/PFE/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/__init__.py b/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/validate_IJB_S.py b/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/validate_IJB_S.py index f8ad9195a0..265fd018c8 100644 --- a/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/validate_IJB_S.py +++ b/embedding-calculator/src/services/facescan/plugins/adaface/validation_lq/validate_IJB_S.py @@ -1,13 +1,13 @@ import torch import numpy as np from tqdm import tqdm -import data_utils +import src.services.facescan.plugins.adaface.validation_lq.data_utils as data_utils import argparse import pandas as pd import evaluate_helper import sys, os sys.path.insert(0, os.path.dirname(os.getcwd())) -import net +import src.services.facescan.plugins.adaface.net as net def str2bool(v): diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/validation_mixed/__init__.py b/embedding-calculator/src/services/facescan/plugins/adaface/validation_mixed/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/embedding-calculator/src/services/facescan/plugins/adaface/validation_mixed/insightface_ijb_helper/__init__.py b/embedding-calculator/src/services/facescan/plugins/adaface/validation_mixed/insightface_ijb_helper/__init__.py new file mode 100644 index 0000000000..e69de29bb2