fix debug_image to not crash with non-RGB images.

This commit is contained in:
Kevin Turner 2022-12-04 20:12:47 -08:00
parent 875312080d
commit b2664e807e

View File

@ -1,17 +1,13 @@
import importlib
import torch
import numpy as np
import math
from collections import abc
from einops import rearrange
from functools import partial
import multiprocessing as mp
from threading import Thread
from queue import Queue
from collections import abc
from inspect import isfunction
from queue import Queue
from threading import Thread
import numpy as np
import torch
from PIL import Image, ImageDraw, ImageFont
@ -250,7 +246,7 @@ def debug_image(debug_image, debug_text, debug_show=True, debug_result=False, de
if not debug_status:
return
image_copy = debug_image.copy()
image_copy = debug_image.copy().convert("RGBA")
ImageDraw.Draw(image_copy).text(
(5, 5),
debug_text,