matplotlib optional as well

This commit is contained in:
kijai 2024-08-04 16:43:31 +03:00
parent 1afb92dee2
commit 2e7129fdb9
2 changed files with 2 additions and 7 deletions

View File

@ -4,11 +4,6 @@ from torchvision.transforms import functional as TF
from PIL import Image, ImageDraw, ImageFilter, ImageFont
import scipy.ndimage
import numpy as np
try:
import matplotlib.pyplot as plt
except:
print("Matplotlib not installed")
from contextlib import nullcontext
import os
@ -712,6 +707,7 @@ class CreateMagicMask:
def createmagicmask(self, frames, transitions, depth, distortion, seed, frame_width, frame_height):
from ..utility.magictex import coordinate_grid, random_transform, magic
import matplotlib.pyplot as plt
rng = np.random.default_rng(seed)
out = []
coords = coordinate_grid((frame_width, frame_height))

View File

@ -1,6 +1,4 @@
import torch
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
@ -1510,6 +1508,7 @@ or a .txt file with RealEstate camera intrinsics and coordinates, in a 3D plot.
def customize_legend(self, list_label):
from matplotlib.patches import Patch
import matplotlib.pyplot as plt
list_handle = []
for idx, label in enumerate(list_label):
color = plt.cm.rainbow(idx / len(list_label))