Skip to content

Commit f73e604

Browse files
committed
removed now unused TargetImage method defs
1 parent 09fc46b commit f73e604

File tree

3 files changed

+0
-56
lines changed

3 files changed

+0
-56
lines changed

src/pytti/LossAug/LatentLossClass.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,6 @@ def set_comp(self, pil_image, device=DEVICE):
3131
self.has_latent = False
3232
self.direct_loss.set_comp(pil_image.resize(self.image_shape, Image.LANCZOS))
3333

34-
@classmethod
35-
@vram_usage_mode("Latent Image Loss")
36-
@torch.no_grad()
37-
def TargetImage(
38-
cls, prompt_string, image_shape, pil_image=None, is_path=False, device=DEVICE
39-
):
40-
text, weight, stop = parse(
41-
prompt_string, r"(?<!^http)(?<!s):|:(?!/)", ["", "1", "-inf"]
42-
)
43-
weight, mask = parse(weight, r"_", ["1", ""])
44-
text = text.strip()
45-
mask = mask.strip()
46-
if pil_image is None and text != "" and is_path:
47-
pil_image = Image.open(fetch(text)).convert("RGB")
48-
comp = (
49-
MSELoss.make_comp(pil_image)
50-
if pil_image is not None
51-
else torch.zeros(1, 1, 1, 1, device=device)
52-
)
53-
out = cls(comp, weight, stop, text + " (latent)", image_shape)
54-
if pil_image is not None:
55-
out.set_comp(pil_image)
56-
out.set_mask(mask)
57-
return out
58-
5934
def set_mask(self, mask, inverted=False):
6035
self.direct_loss.set_mask(mask, inverted)
6136
super().set_mask(mask, inverted)

src/pytti/LossAug/MSELossClass.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,6 @@ def __init__(
3030
self.register_buffer("mask", torch.ones(1, 1, 1, 1, device=self.device))
3131
self.use_mask = False
3232

33-
@classmethod
34-
@vram_usage_mode("Loss Augs")
35-
@torch.no_grad()
36-
def TargetImage(
37-
cls, prompt_string, image_shape, pil_image=None, is_path=False, device=None
38-
):
39-
if device is None:
40-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
41-
text, weight, stop, mask, pil_image = parse_subprompt(
42-
prompt_string, is_path=is_path, pil_image=pil_image
43-
)
44-
45-
if pil_image:
46-
im = pil_image.resize(image_shape, Image.LANCZOS)
47-
comp = cls.make_comp(im)
48-
else:
49-
comp = torch.zeros(1, 1, 1, 1, device=device)
50-
51-
if image_shape is None:
52-
image_shape = pil_image.size
53-
out = cls(comp, weight, stop, text + " (direct)", image_shape, device=device)
54-
out.set_mask(mask)
55-
return out
56-
5733
@torch.no_grad()
5834
def set_mask(self, mask, inverted=False, device=None):
5935
if device is None:

src/pytti/LossAug/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@
88
from pytti.LossAug.EdgeLossClass import EdgeLoss
99
from pytti.LossAug.LatentLossClass import LatentLoss
1010
from pytti.LossAug.HSVLossClass import HSVLoss
11-
12-
# from loguru import logger
13-
# logger.debug(dir(HSVLoss))
14-
# logger.debug(help(HSVLoss.TargetImage))
15-
16-
# yeesh the ordering fragility in here...
17-
# TO DO: let's make this a class attribute on something

0 commit comments

Comments
 (0)