update GanInverter
10
GanAttack.py
|
|
@ -1,3 +1,5 @@
|
|||
import sys
|
||||
sys.path.append('./GanInverter')
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.optim as optim
|
||||
|
|
@ -5,8 +7,10 @@ from torchvision import models
|
|||
from omegaconf import DictConfig, OmegaConf
|
||||
from data.dataset import get_dataset,get_adv_dataset
|
||||
from utils import get_model,set_requires_grad
|
||||
from model.GanInverter.models.stylegan2.model import Generator
|
||||
from model.GanInverter.inference.two_stage_inference import TwoStageInference
|
||||
from 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
|
||||
import torch.nn.functional as F
|
||||
import time
|
||||
|
|
@ -16,6 +20,8 @@ import hydra
|
|||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||
|
||||
|
||||
|
||||
|
||||
def get_stylegan_generator(cfg):
|
||||
|
||||
# ensure_checkpoint_exists(ckpt_path)
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 2.6 MiB |
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |