fffiloni commited on
Commit
671ed54
1 Parent(s): 61bc1e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -14
app.py CHANGED
@@ -1,7 +1,5 @@
1
  import gradio as gr
2
 
3
- from share_btn import community_icon_html, loading_icon_html, share_js
4
-
5
  from modelscope.pipelines import pipeline
6
  from modelscope.outputs import OutputKeys
7
 
@@ -14,7 +12,7 @@ def infer (image_in):
14
  output_video_path = pipe(IMG_PATH, output_video='output.mp4')[OutputKeys.OUTPUT_VIDEO]
15
  print(output_video_path)
16
 
17
- return output_video_path, gr.Group.update(visible=True)
18
 
19
  css="""
20
  #col-container {
@@ -124,7 +122,7 @@ with gr.Blocks(css=css) as demo:
124
 
125
  image_in = gr.Image(
126
  label = "Source Image",
127
- source = "upload",
128
  type = "filepath",
129
  elem_id = "image-in"
130
  )
@@ -141,11 +139,6 @@ with gr.Blocks(css=css) as demo:
141
 
142
  with gr.Row():
143
 
144
- with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
145
- community_icon = gr.HTML(community_icon_html)
146
- loading_icon = gr.HTML(loading_icon_html)
147
- share_button = gr.Button("Share with Community", elem_id="share-btn")
148
-
149
  gr.Markdown("""
150
 
151
  [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-lg.svg#center)](https://huggingface.co/spaces/fffiloni/MS-Image2Video-cloning?duplicate=true)
@@ -222,11 +215,9 @@ with gr.Blocks(css=css) as demo:
222
  image_in
223
  ],
224
  outputs = [
225
- video_out,
226
- share_group
227
- ]
228
  )
229
 
230
- share_button.click(None, [], [], _js=share_js)
231
-
232
  demo.queue(max_size=6).launch(show_api=False)
 
1
  import gradio as gr
2
 
 
 
3
  from modelscope.pipelines import pipeline
4
  from modelscope.outputs import OutputKeys
5
 
 
12
  output_video_path = pipe(IMG_PATH, output_video='output.mp4')[OutputKeys.OUTPUT_VIDEO]
13
  print(output_video_path)
14
 
15
+ return output_video_path
16
 
17
  css="""
18
  #col-container {
 
122
 
123
  image_in = gr.Image(
124
  label = "Source Image",
125
+ sources = ["upload"],
126
  type = "filepath",
127
  elem_id = "image-in"
128
  )
 
139
 
140
  with gr.Row():
141
 
 
 
 
 
 
142
  gr.Markdown("""
143
 
144
  [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-lg.svg#center)](https://huggingface.co/spaces/fffiloni/MS-Image2Video-cloning?duplicate=true)
 
215
  image_in
216
  ],
217
  outputs = [
218
+ video_out
219
+ ],
220
+ show_api=False
221
  )
222
 
 
 
223
  demo.queue(max_size=6).launch(show_api=False)