Nymbo commited on
Commit
319e8a0
·
verified ·
1 Parent(s): d4e29c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -29,7 +29,7 @@ def dl(inp):
29
  #os.system(f'yt-dlp "{inp}" --trim-filenames 160 -o "{inp_out}.mp4" -S res,mp4 --recode mp4')
30
  out = f"{uid}/{inp_out}.mp4"
31
  #out_ap = os.path.abspath(out_f)
32
- #out = f'https://omnibus-reverse-image.hf.space/file={out_ap}'
33
  print (out)
34
  except Exception as e:
35
  print (e)
@@ -56,7 +56,7 @@ def process_vid(file,cur_frame,every_n):
56
  ret, frame_f = capture.read(i)
57
  cv2.imwrite(f"{uid}-vid_tmp{i}.png", frame_f)
58
  out = os.path.abspath(f"{uid}-vid_tmp{i}.png")
59
- out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
60
  print(out)
61
  res = rev_img_searcher.search(out_url)
62
  #print (res)
@@ -90,14 +90,14 @@ def process_vid(file,cur_frame,every_n):
90
  return (gr.HTML('No frame matches found.'),"","")
91
 
92
  def process_im(file,url):
93
- if not url.startswith("https://omnibus"):
94
  return url
95
  else:
96
  read_file = Image.open(file)
97
  read_file.save(f"{uid}-tmp.png")
98
  action_input = f"{uid}-tmp.png"
99
  out = os.path.abspath(action_input)
100
- out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
101
  return (out_url)
102
 
103
  def rev_im(image):
@@ -108,7 +108,7 @@ def rev_im(image):
108
  image=cv2.imread(image)
109
  cv2.imwrite(f"{uid}-im_tmp.png", image)
110
  out = os.path.abspath(f"{uid}-im_tmp.png")
111
- out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
112
  rev_img_searcher = ReverseImageSearcher()
113
  res = rev_img_searcher.search(out_url)
114
  count = 0
 
29
  #os.system(f'yt-dlp "{inp}" --trim-filenames 160 -o "{inp_out}.mp4" -S res,mp4 --recode mp4')
30
  out = f"{uid}/{inp_out}.mp4"
31
  #out_ap = os.path.abspath(out_f)
32
+ #out = f'https://nymbo-reverse-image.hf.space/file={out_ap}'
33
  print (out)
34
  except Exception as e:
35
  print (e)
 
56
  ret, frame_f = capture.read(i)
57
  cv2.imwrite(f"{uid}-vid_tmp{i}.png", frame_f)
58
  out = os.path.abspath(f"{uid}-vid_tmp{i}.png")
59
+ out_url = f'https://nymbo-reverse-image.hf.space/file={out}'
60
  print(out)
61
  res = rev_img_searcher.search(out_url)
62
  #print (res)
 
90
  return (gr.HTML('No frame matches found.'),"","")
91
 
92
  def process_im(file,url):
93
+ if not url.startswith("https://nymbo"):
94
  return url
95
  else:
96
  read_file = Image.open(file)
97
  read_file.save(f"{uid}-tmp.png")
98
  action_input = f"{uid}-tmp.png"
99
  out = os.path.abspath(action_input)
100
+ out_url = f'https://nymbo-reverse-image.hf.space/file={out}'
101
  return (out_url)
102
 
103
  def rev_im(image):
 
108
  image=cv2.imread(image)
109
  cv2.imwrite(f"{uid}-im_tmp.png", image)
110
  out = os.path.abspath(f"{uid}-im_tmp.png")
111
+ out_url = f'https://nymbo-reverse-image.hf.space/file={out}'
112
  rev_img_searcher = ReverseImageSearcher()
113
  res = rev_img_searcher.search(out_url)
114
  count = 0