Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,12 +85,17 @@ def process_vid(file,cur_frame,every_n):
|
|
| 85 |
return (gr.HTML('No frame matches found.'),"","")
|
| 86 |
|
| 87 |
def process_im(file):
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
def rev_im(image_url):
|
| 96 |
#image_url = 'https://i.pinimg.com/originals/c4/50/35/c450352ac6ea8645ead206721673e8fb.png'
|
|
|
|
| 85 |
return (gr.HTML('No frame matches found.'),"","")
|
| 86 |
|
| 87 |
def process_im(file):
|
| 88 |
+
if file.startswith("https://"):
|
| 89 |
+
return file
|
| 90 |
+
if file.startswith("http://"):
|
| 91 |
+
return file
|
| 92 |
+
else:
|
| 93 |
+
read_file = Image.open(file)
|
| 94 |
+
read_file.save(f"{uid}-tmp.png")
|
| 95 |
+
action_input = f"{uid}-tmp.png"
|
| 96 |
+
out = os.path.abspath(action_input)
|
| 97 |
+
out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
|
| 98 |
+
return (out_url)
|
| 99 |
|
| 100 |
def rev_im(image_url):
|
| 101 |
#image_url = 'https://i.pinimg.com/originals/c4/50/35/c450352ac6ea8645ead206721673e8fb.png'
|