Spaces:
Running
on
Zero
Running
on
Zero
Boboiazumi
commited on
Commit
•
9f851f0
1
Parent(s):
c20c7fc
Update app.py
Browse files
app.py
CHANGED
@@ -84,11 +84,11 @@ def load_pipeline(model_name):
|
|
84 |
img_pipe.to(device)
|
85 |
return pipe, img_pipe
|
86 |
|
87 |
-
def load_img(resize_width
|
88 |
img = Image.open(img)
|
89 |
width, height = img.size
|
90 |
scale = resize_width / width
|
91 |
-
resize_height = height * scale
|
92 |
|
93 |
img = img.resize((resize_width, resize_height), Image.Resampling.LANCZOS)
|
94 |
return img, resize_width, resize_height
|
|
|
84 |
img_pipe.to(device)
|
85 |
return pipe, img_pipe
|
86 |
|
87 |
+
def load_img(resize_width,img: str):
|
88 |
img = Image.open(img)
|
89 |
width, height = img.size
|
90 |
scale = resize_width / width
|
91 |
+
resize_height = int(height * scale)
|
92 |
|
93 |
img = img.resize((resize_width, resize_height), Image.Resampling.LANCZOS)
|
94 |
return img, resize_width, resize_height
|