Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
curegit committed Feb 21, 2023
1 parent 2441f8e commit 9b8a25b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utilities/image.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from PIL import Image
from PIL.Image import Resampling
from numpy import rint, asarray, uint8, float32

def load_image(filepath, size):
img = Image.open(filepath).convert("RGB").resize(size, Image.LANCZOS)
img = Image.open(filepath).convert("RGB").resize(size, Resampling.LANCZOS)
return (asarray(img, dtype=uint8).transpose(2, 0, 1) / 255).astype(float32)

def load_image_uint8(filepath, size):
img = Image.open(filepath).convert("RGB").resize(size, Image.LANCZOS)
img = Image.open(filepath).convert("RGB").resize(size, Resampling.LANCZOS)
return asarray(img, dtype=uint8).transpose(2, 0, 1)

def uint8_to_float(array):
Expand Down

0 comments on commit 9b8a25b

Please sign in to comment.