Omnibus commited on
Commit
175f376
1 Parent(s): fc34e82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -21,11 +21,13 @@ def dl(inp):
21
  inp_out=inp.replace("https://","")
22
  inp_out=inp_out.replace("/","_").replace(".","_").replace("=","_").replace("?","_")
23
  os.system(f'yt-dlp "{inp}" --trim-filenames 160 -o "{inp_out}.mp4" -S res,mp4 --recode mp4')
24
- out_f = f"{inp_out}.mp4"
25
- out_ap = os.path.abspath(out_f)
26
- out = f'https://omnibus-reverse-image.hf.space/file={out_ap}'
 
27
  except Exception as e:
28
- out = f'{e}'
 
29
  return out
30
 
31
  def process_vid(file):
@@ -39,8 +41,8 @@ def process_vid(file):
39
  print(i)
40
  capture.set(cv2.CAP_PROP_POS_FRAMES, i)
41
  ret, frame_f = capture.read(i)
42
- cv2.imwrite(f"{uid}-vid_tmp.png", frame_f)
43
- out = os.path.abspath(f"{uid}-vid_tmp.png")
44
  out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
45
  print(out)
46
  res = rev_img_searcher.search(out_url)
@@ -128,7 +130,7 @@ with gr.Blocks() as app:
128
  with gr.Box(visible=False) as vid_box:
129
  vid_url=gr.Textbox(label="Video URL")
130
  vid_url_btn=gr.Button("Load URL")
131
- inp_vid=gr.Video(label="Search Video",type='filepath')
132
  go_btn_vid=gr.Button()
133
  gr.Column()
134
  #paste_clip = gr.Button("Paste from Clipboard")
 
21
  inp_out=inp.replace("https://","")
22
  inp_out=inp_out.replace("/","_").replace(".","_").replace("=","_").replace("?","_")
23
  os.system(f'yt-dlp "{inp}" --trim-filenames 160 -o "{inp_out}.mp4" -S res,mp4 --recode mp4')
24
+ out = f"{inp_out}.mp4"
25
+ #out_ap = os.path.abspath(out_f)
26
+ #out = f'https://omnibus-reverse-image.hf.space/file={out_ap}'
27
+ print (out)
28
  except Exception as e:
29
+ print (e)
30
+ #out = f'{e}'
31
  return out
32
 
33
  def process_vid(file):
 
41
  print(i)
42
  capture.set(cv2.CAP_PROP_POS_FRAMES, i)
43
  ret, frame_f = capture.read(i)
44
+ cv2.imwrite(f"{uid}-vid_tmp{i}.png", frame_f)
45
+ out = os.path.abspath(f"{uid}-vid_tmp{i}.png")
46
  out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
47
  print(out)
48
  res = rev_img_searcher.search(out_url)
 
130
  with gr.Box(visible=False) as vid_box:
131
  vid_url=gr.Textbox(label="Video URL")
132
  vid_url_btn=gr.Button("Load URL")
133
+ inp_vid=gr.Video(label="Search Video")
134
  go_btn_vid=gr.Button()
135
  gr.Column()
136
  #paste_clip = gr.Button("Paste from Clipboard")