Skip to content

Commit f016f9c

Browse files
authored
Merge pull request #98 from donno2048/main
Trivial fixes
2 parents 2626c91 + f63783c commit f016f9c

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

deep_daze/clip.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
import urllib
1212
import warnings
1313
from typing import Union, List
14-
15-
import torch
16-
from PIL import Image
17-
from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize
14+
from torchvision.transforms import Compose, Normalize
1815
from tqdm import tqdm
1916

2017
_MODELS = {
@@ -613,9 +610,7 @@ def build_model(state_dict: dict):
613610
model.load_state_dict(state_dict)
614611
return model.eval()
615612

616-
import gzip
617613
import html
618-
import os
619614
from functools import lru_cache
620615

621616
import ftfy
@@ -745,6 +740,4 @@ def decode(self, tokens):
745740
text = ''.join([self.decoder[token] for token in tokens])
746741
text = bytearray([self.byte_decoder[c] for c in text]).decode('utf-8', errors="replace").replace('</w>', ' ')
747742
return text
748-
import gzip
749-
750743
_tokenizer = SimpleTokenizer()

deep_daze/deep_daze.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import random
66
from datetime import datetime
77
from pathlib import Path
8-
from shutil import copy
9-
108
import torch
119
import torch.nn.functional as F
1210
from siren_pytorch import SirenNet, SirenWrapper
@@ -16,7 +14,7 @@
1614

1715
from PIL import Image
1816
import torchvision.transforms as T
19-
from torchvision.utils import save_image
17+
#from torchvision.utils import save_image
2018

2119
from tqdm import trange, tqdm
2220

@@ -74,7 +72,7 @@ def open_folder(path):
7472
cmd_list = ['xdg-open', path]
7573
elif sys.platform in ['win32', 'win64']:
7674
cmd_list = ['explorer', path.replace('/', '\\')]
77-
if cmd_list == None:
75+
if cmd_list is None:
7876
return
7977

8078
try:

0 commit comments

Comments
 (0)