ysharma HF staff commited on
Commit
849dabd
1 Parent(s): c5cd466
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -71,9 +71,9 @@ def generate_gifs(gif_transcript, words, words_timestamp):
71
  #generated .gif image
72
  gen_moviepy_gif(start_seconds, end_seconds)
73
  #("./gifimage.gif")
74
- html_out = "<img src='../gifimage.gif' alt='create a gif from video' width='100%'/>"
75
 
76
- return
77
 
78
 
79
  #calling the hosted model
@@ -163,7 +163,7 @@ def gen_moviepy_gif(start_seconds, end_seconds):
163
  video = mp.VideoFileClip(video_path)
164
  final_clip = video.subclip(start_seconds, end_seconds)
165
  #final_clip.write_videofile("/content/gdrive/My Drive/AI/videoedit/gif1.mp4")
166
- final_clip.write_gif("./gifimage.gif",)
167
  final_clip.close()
168
  return
169
 
@@ -203,11 +203,11 @@ with demo:
203
  # print(f"html output is : {html_out}")
204
  # return
205
  with gr.Row():
206
- #out_gif = gr.HTML(label="Generated GIF from transcript selected", show_label=True)
207
- out_gif_video = gr.Video(value='./gifimage.gif')
208
 
209
  button_transcript.click(generate_transcripts, input_video, [text_transcript, text_words, text_wordstimestamps ])
210
- button_gifs.click(generate_gifs, [text_gif_transcript, text_words, text_wordstimestamps]) #, out_gif )
211
 
212
 
213
  demo.launch(debug=True)
 
71
  #generated .gif image
72
  gen_moviepy_gif(start_seconds, end_seconds)
73
  #("./gifimage.gif")
74
+ html_out = "<img src='./gifimage.gif' alt='create a gif from video' width='100%'/>"
75
 
76
+ return html_out
77
 
78
 
79
  #calling the hosted model
 
163
  video = mp.VideoFileClip(video_path)
164
  final_clip = video.subclip(start_seconds, end_seconds)
165
  #final_clip.write_videofile("/content/gdrive/My Drive/AI/videoedit/gif1.mp4")
166
+ final_clip.write_gif("./gifimage.gif")
167
  final_clip.close()
168
  return
169
 
 
203
  # print(f"html output is : {html_out}")
204
  # return
205
  with gr.Row():
206
+ out_gif = gr.HTML(label="Generated GIF from transcript selected", show_label=True)
207
+ #out_gif_video = gr.Video(value='./gifimage.gif')
208
 
209
  button_transcript.click(generate_transcripts, input_video, [text_transcript, text_words, text_wordstimestamps ])
210
+ button_gifs.click(generate_gifs, [text_gif_transcript, text_words, text_wordstimestamps], out_gif )
211
 
212
 
213
  demo.launch(debug=True)