update GanInverter

This commit is contained in:
leewlving 2023-12-06 18:24:33 +08:00
parent 790867dd9f
commit fbf6c9a553
140 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,5 @@
import sys
sys.path.append('./GanInverter')
import torch import torch
import torch.nn as nn import torch.nn as nn
import torch.optim as optim import torch.optim as optim
@ -5,8 +7,10 @@ from torchvision import models
from omegaconf import DictConfig, OmegaConf from omegaconf import DictConfig, OmegaConf
from data.dataset import get_dataset,get_adv_dataset from data.dataset import get_dataset,get_adv_dataset
from utils import get_model,set_requires_grad from utils import get_model,set_requires_grad
from model.GanInverter.models.stylegan2.model import Generator from GanInverter.inference.two_stage_inference import TwoStageInference
from model.GanInverter.inference.two_stage_inference import TwoStageInference from GanInverter.models.stylegan2.model import Generator
# from models import GanAttack
import model
from model import GanAttack,CLIPLoss,VggLoss,get_prompt from model import GanAttack,CLIPLoss,VggLoss,get_prompt
import torch.nn.functional as F import torch.nn.functional as F
import time import time
@ -16,6 +20,8 @@ import hydra
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def get_stylegan_generator(cfg): def get_stylegan_generator(cfg):
# ensure_checkpoint_exists(ckpt_path) # ensure_checkpoint_exists(ckpt_path)

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 172 KiB

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Some files were not shown because too many files have changed in this diff Show More