barakmeiri commited on
Commit
e11e948
·
verified ·
1 Parent(s): bff370f

Update src/editor.py

Browse files

support inserting pil image directly instead of image path

Files changed (1) hide show
  1. 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
- return center_crop(PIL.Image.open(im_path)).resize((512, 512))
 
 
 
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: