Skip to content

Commit

Permalink
Fix import star (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarx authored Jan 30, 2022
1 parent e42a05a commit 0fa3bdd
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Image/PixelImage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pytti import *
from pytti import DEVICE, named_rearrange, replace_grad, vram_usage_mode
from pytti.Image import DifferentiableImage
from pytti.LossAug import HSVLoss
from pytti.ImageGuide import DirectImageGuide
Expand Down
2 changes: 1 addition & 1 deletion Image/RGBImage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pytti import *
from pytti import DEVICE, clamp_with_grad
import torch
from torch import nn
from torchvision.transforms import functional as TF
Expand Down
2 changes: 1 addition & 1 deletion Image/VQGANImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
print("DEBUG: sys.path already contains ./taming transformers")
from taming.models import cond_transformer, vqgan

from pytti import *
from pytti import DEVICE, replace_grad, clamp_with_grad, vram_usage_mode
import torch
from torch.nn import functional as F
from pytti.Image import EMAImage
Expand Down
2 changes: 1 addition & 1 deletion Image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from torch import nn
import numpy as np
from PIL import Image
from pytti import *
from pytti import named_rearrange

SUPPORTED_MODES = ['L','RGB','I','F']
FORMAT_SAMPLES = {'L':1, 'RGB':3, 'I':1, 'F':1}
Expand Down
2 changes: 1 addition & 1 deletion ImageGuide.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from torch import optim, nn
from pytti.Notebook import tqdm
from pytti import *
from pytti import format_input
import pandas as pd
import math

Expand Down
3 changes: 1 addition & 2 deletions LossAug/LatentLoss.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from pytti.LossAug import MSELoss
import gc, torch, os, math
from pytti import DEVICE
from torchvision.transforms import functional as TF
from torch.nn import functional as F
from PIL import Image
import copy, re
from pytti import *
from pytti import DEVICE, fetch, parse, vram_usage_mode

class LatentLoss(MSELoss):
@torch.no_grad()
Expand Down
2 changes: 1 addition & 1 deletion LossAug/MSELoss.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from torch.nn import functional as F
from pytti.LossAug import Loss
from pytti.Notebook import Rotoscoper
from pytti import *
from pytti import DEVICE, fetch, parse, vram_usage_mode
import torch

class MSELoss(Loss):
Expand Down
2 changes: 1 addition & 1 deletion LossAug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch
from PIL import Image
from torchvision.transforms import functional as TF
from pytti import *
from pytti import DEVICE, replace_grad, parametric_eval

class Loss(nn.Module):
def __init__(self, weight, stop, name):
Expand Down
2 changes: 1 addition & 1 deletion Perceptor/Embedder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytti import *
import pytti
from pytti import DEVICE, format_input, cat_with_pad, format_module, normalize

import torch
from torch import nn
Expand Down
2 changes: 1 addition & 1 deletion Perceptor/Prompt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pytti import *
from pytti import DEVICE, format_input, cat_with_pad, replace_grad, fetch, parse, parametric_eval, vram_usage_mode
from pytti.Notebook import Rotoscoper
import torch
from torch import nn
Expand Down
2 changes: 1 addition & 1 deletion Transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch.nn.functional as F
from PIL import Image, ImageFilter
import numpy as np
from pytti import *
from pytti import DEVICE, parametric_eval
from pytti.LossAug.DepthLoss import DepthLoss
from infer import InferenceHelper

Expand Down
10 changes: 8 additions & 2 deletions workhorse.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@
# drive_mounted = False
drive_mounted = False
try:
from pytti.Notebook import *
from pytti.Notebook import (
is_notebook, change_tqdm_color, get_tqdm, get_last_file,
get_next_file, make_hbox, load_settings, write_settings,
save_settings, save_batch, CLIP_MODEL_NAMES, load_clip,
get_frames, build_loss, format_params, rotoscopers,
clear_rotoscopers, update_rotoscopers, Rotoscoper
)
except ModuleNotFoundError:
if drive_mounted:
#THIS IS NOT AN ERROR. This is the code that would
Expand Down Expand Up @@ -81,7 +87,7 @@
from pytti.Perceptor.Prompt import parse_prompt
from pytti.LossAug import TVLoss, HSVLoss, OpticalFlowLoss, TargetFlowLoss
from pytti.Transforms import zoom_2d, zoom_3d, apply_flow
from pytti import *
from pytti import DEVICE, fetch, parametric_eval, set_t, vram_usage_mode, print_vram_usage, reset_vram_usage, freeze_vram_usage, vram_profiling
from pytti.LossAug.DepthLoss import init_AdaBins
logger.info("pytti loaded.")

Expand Down

0 comments on commit 0fa3bdd

Please sign in to comment.