liangtian commited on
Commit
f26d6a7
1 Parent(s): db83e1d

Update wear_birthday_crown.py

Browse files
Files changed (1) hide show
  1. wear_birthday_crown.py +3 -7
wear_birthday_crown.py CHANGED
@@ -6,13 +6,9 @@ import PIL
6
  from PIL import Image
7
 
8
  def exec_cmd(image):
9
- # image_data=np.asarray(image)
10
- # cv2.imwrite(r"D:\PythonProject\birthday_crown\Creating-GIFs-with-OpenCV-master\images\me.jpg",image)
11
- image.save(r"D:\PythonProject\birthday_crown\Creating-GIFs-with-OpenCV-master\images\me.jpg")
12
- os.system("python create_gif.py --config config.json --image images/me.jpg --output me.gif")
13
- # output=cv2.imread(r"D:\PythonProject\birthday_crown\Creating-GIFs-with-OpenCV-master\me.gif")
14
- # output=Image.open(r"D:\PythonProject\birthday_crown\Creating-GIFs-with-OpenCV-master\me.gif")
15
- output=r"D:\PythonProject\birthday_crown\Creating-GIFs-with-OpenCV-master\me.gif"
16
  return output
17
 
18
  interface = gr.Interface(fn=exec_cmd, inputs=gr.inputs.Image(type="pil"),outputs=gr.outputs.Image(type="file"))
6
  from PIL import Image
7
 
8
  def exec_cmd(image):
9
+ image.save("me.jpg")
10
+ os.system("python create_gif.py --config config.json --image me.jpg --output result.gif")
11
+ output="result.gif"
 
 
 
 
12
  return output
13
 
14
  interface = gr.Interface(fn=exec_cmd, inputs=gr.inputs.Image(type="pil"),outputs=gr.outputs.Image(type="file"))