Shuja007 commited on
Commit
a9a23f0
1 Parent(s): 2e7a04f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -23,9 +23,9 @@ def generate_video(image):
23
  response.raise_for_status()
24
  response_body = response.json()
25
 
26
- # The response from the API might include a video URL or base64-encoded video data
27
- # Adjust the return value based on the actual response
28
- return response_body # Modify this line based on the actual API response format
29
 
30
  # Create a Gradio interface with a heading
31
  def create_interface():
@@ -34,8 +34,8 @@ def create_interface():
34
  # Gradio Interface
35
  iface = gr.Interface(
36
  fn=generate_video,
37
- inputs=gr.inputs.Image(type="file", label="Upload Your Product Image"),
38
- outputs=gr.outputs.Video(label="Generated Product Video"),
39
  title=title,
40
  description="Upload a product shot to generate a moving video version of it."
41
  )
 
23
  response.raise_for_status()
24
  response_body = response.json()
25
 
26
+ # Assuming the response contains a URL to the generated video
27
+ video_url = response_body.get('video_url')
28
+ return video_url
29
 
30
  # Create a Gradio interface with a heading
31
  def create_interface():
 
34
  # Gradio Interface
35
  iface = gr.Interface(
36
  fn=generate_video,
37
+ inputs=gr.Image(type="file", label="Upload Your Product Image"),
38
+ outputs=gr.Video(label="Generated Product Video"), # Use gr.Video to display the video output
39
  title=title,
40
  description="Upload a product shot to generate a moving video version of it."
41
  )