Spaces:
Running
on
A10G
Running
on
A10G
Update src/editor.py
Browse filessupport inserting pil image directly instead of image path
- src/editor.py +4 -1
src/editor.py
CHANGED
@@ -28,7 +28,10 @@ def center_crop(im):
|
|
28 |
|
29 |
|
30 |
def load_im_into_format_from_path(im_path):
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
|
34 |
class ImageEditorDemo:
|
|
|
28 |
|
29 |
|
30 |
def load_im_into_format_from_path(im_path):
|
31 |
+
if isinstance(im_path, str):
|
32 |
+
return center_crop(PIL.Image.open(im_path)).resize((512, 512))
|
33 |
+
else:
|
34 |
+
return center_crop(im_path).resize((512, 512))
|
35 |
|
36 |
|
37 |
class ImageEditorDemo:
|