Mixed bag of cleanups

This commit is contained in:
henryruhs
2025-02-05 19:08:50 +01:00
parent a1cd025f81
commit 989a81c751
9 changed files with 18 additions and 19 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[flake8]
select = E3, E4, F, I1, I2
select = E22, E23, E24, E27, E3, E4, E7, F, I1, I2
plugins = flake8-import-order
application_import_names = arcface_converter
application_import_names = arcface_converter, face_swapper
import-order-style = pycharm
per-file-ignores = preparing.py:E402
+1 -2
View File
@@ -4,13 +4,12 @@ from os.path import isfile
from typing import List
import numpy
numpy.bool = numpy.bool_
from mxnet.io import ImageRecordIter
from onnxruntime import InferenceSession
from tqdm import tqdm
from types import Embedding, EmbeddingPairs, VisionFrame
from .types import Embedding, EmbeddingPairs, VisionFrame
CONFIG = configparser.ConfigParser()
CONFIG.read('config.ini')
+2 -2
View File
@@ -10,8 +10,8 @@ from pytorch_lightning.tuner.tuning import Tuner
from torch import Tensor
from torch.utils.data import DataLoader, Dataset, TensorDataset, random_split
from networks.arcface_converter import ArcFaceConverter
from types import Batch, Loader
from .networks.arcface_converter import ArcFaceConverter
from .types import Batch, Loader
CONFIG = configparser.ConfigParser()
CONFIG.read('config.ini')
+2 -2
View File
@@ -7,8 +7,8 @@ import torch
import torchvision.transforms as transforms
from torch.utils.data import TensorDataset
from helper import read_image
from types import Batch, ImagePathList, ImagePathSet
from .helper import read_image
from .types import Batch, ImagePathList, ImagePathSet
class DataLoaderVGG(TensorDataset):
+1 -1
View File
@@ -6,7 +6,7 @@ import torch.nn
import torch.nn as nn
from torch import Tensor
from types import DiscriminatorOutputs
from .types import DiscriminatorOutputs
class NLayerDiscriminator(nn.Module):
+1 -1
View File
@@ -4,7 +4,7 @@ import torch
import torch.nn as nn
from torch import Tensor
from types import SourceEmbedding, TargetAttributes, VisionTensor
from .types import SourceEmbedding, TargetAttributes, VisionTensor
class AdaptiveEmbeddingIntegrationNetwork(nn.Module):
+1 -1
View File
@@ -4,7 +4,7 @@ import cv2
import numpy
import torch
from types import IdEmbedder, IdEmbedding, Padding, Tensor, VisionFrame, VisionTensor
from .types import IdEmbedder, IdEmbedding, Padding, Tensor, VisionFrame, VisionTensor
def is_windows() -> bool:
+3 -3
View File
@@ -3,9 +3,9 @@ import configparser
import cv2
import torch
from generator import AdaptiveEmbeddingIntegrationNetwork
from helper import calc_id_embedding, convert_to_vision_frame, convert_to_vision_tensor, read_image
from types import Generator, IdEmbedder, VisionFrame
from .generator import AdaptiveEmbeddingIntegrationNetwork
from .helper import calc_id_embedding, convert_to_vision_frame, convert_to_vision_tensor, read_image
from .types import Generator, IdEmbedder, VisionFrame
CONFIG = configparser.ConfigParser()
CONFIG.read('config.ini')
+5 -5
View File
@@ -12,11 +12,11 @@ from pytorch_msssim import ssim
from torch import Tensor
from torch.utils.data import DataLoader
from data_loader import DataLoaderVGG
from discriminator import MultiscaleDiscriminator
from generator import AdaptiveEmbeddingIntegrationNetwork
from helper import calc_id_embedding, hinge_fake_loss, hinge_real_loss
from types import Batch, DiscriminatorLossSet, DiscriminatorOutputs, FaceLandmark203, GeneratorLossSet, LossTensor, SourceEmbedding, SwapAttributes, TargetAttributes, VisionTensor
from .data_loader import DataLoaderVGG
from .discriminator import MultiscaleDiscriminator
from .generator import AdaptiveEmbeddingIntegrationNetwork
from .helper import calc_id_embedding, hinge_fake_loss, hinge_real_loss
from .types import Batch, DiscriminatorLossSet, DiscriminatorOutputs, FaceLandmark203, GeneratorLossSet, LossTensor, SourceEmbedding, SwapAttributes, TargetAttributes, VisionTensor
CONFIG = configparser.ConfigParser()
CONFIG.read('config.ini')