ysharma HF staff commited on
Commit
28c97fa
1 Parent(s): 4a2e5d1
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -66,7 +66,7 @@ def generate_gifs(gif_transcript, words, words_timestamp):
66
  #indx_tmp = [num for num in get_gif_word_indexes(words, giflist)]
67
  #print(f"index temp is : {indx_tmp}")
68
  giflist_indxs = list(list(get_gif_word_indexes(words, giflist))[0])
69
-
70
  #getting start and end timestamps for a gif video
71
  start_seconds, end_seconds = get_gif_timestamps(giflist_indxs, words_timestamp)
72
  print(f"start_seconds, end_seconds are : ({start_seconds}, {end_seconds})")
@@ -151,12 +151,19 @@ def get_gif_word_indexes(total_words_list, gif_words_list):
151
 
152
  #getting start and end timestamps for gif transcript
153
  def get_gif_timestamps(giflist_indxs, words_timestamp):
 
154
  #giflist_indxs = list(list(get_gif_word_indexes(words, giflist))[0])
155
  min_idx = min(giflist_indxs)
156
  max_idx = max(giflist_indxs)
157
-
 
 
158
  gif_words_timestamp = words_timestamp[min_idx : max_idx+1]
 
 
159
  start_seconds, end_seconds = gif_words_timestamp[0][0], gif_words_timestamp[-1][-1]
 
 
160
  return start_seconds, end_seconds
161
 
162
 
 
66
  #indx_tmp = [num for num in get_gif_word_indexes(words, giflist)]
67
  #print(f"index temp is : {indx_tmp}")
68
  giflist_indxs = list(list(get_gif_word_indexes(words, giflist))[0])
69
+ print(f"giflist_indxs is : {giflist_indxs}")
70
  #getting start and end timestamps for a gif video
71
  start_seconds, end_seconds = get_gif_timestamps(giflist_indxs, words_timestamp)
72
  print(f"start_seconds, end_seconds are : ({start_seconds}, {end_seconds})")
 
151
 
152
  #getting start and end timestamps for gif transcript
153
  def get_gif_timestamps(giflist_indxs, words_timestamp):
154
+ print(f"******** Inside get_gif_timestamps() **********")
155
  #giflist_indxs = list(list(get_gif_word_indexes(words, giflist))[0])
156
  min_idx = min(giflist_indxs)
157
  max_idx = max(giflist_indxs)
158
+ print(f"min_idx is :{min_idx}")
159
+ print(f"max_idx is :{max_idx}")
160
+
161
  gif_words_timestamp = words_timestamp[min_idx : max_idx+1]
162
+ print(f"gif_words_timestamp is :{gif_words_timestamp}")
163
+
164
  start_seconds, end_seconds = gif_words_timestamp[0][0], gif_words_timestamp[-1][-1]
165
+ print(f"start_seconds, end_seconds are :{start_seconds},{end_seconds}")
166
+
167
  return start_seconds, end_seconds
168
 
169