Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -177,6 +177,20 @@ def tot_prob():
|
|
| 177 |
def fin_clear():
|
| 178 |
fin_sum.clear()
|
| 179 |
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
with gr.Blocks() as app:
|
| 181 |
gr.Markdown("""<center><h1>AI Image Detector<br><h4>(Test Demo - accuracy varies by model)""")
|
| 182 |
with gr.Column():
|
|
@@ -222,16 +236,7 @@ with gr.Blocks() as app:
|
|
| 222 |
outp5 = gr.HTML("""""")
|
| 223 |
hid_box=gr.Textbox(visible=False)
|
| 224 |
|
| 225 |
-
def upd(image):
|
| 226 |
-
rand_im = uuid.uuid4()
|
| 227 |
-
image.save(f"{rand_im}-vid_tmp_proc.png")
|
| 228 |
-
out = Image.open(f"{rand_im}-vid_tmp_proc.png")
|
| 229 |
|
| 230 |
-
#image.save(f"{rand_im}-vid_tmp_proc.png")
|
| 231 |
-
#out = os.path.abspath(f"{rand_im}-vid_tmp_proc.png")
|
| 232 |
-
#out_url = f'https://omnibus_AI_or_Not_dev.hf.space/file={out}'
|
| 233 |
-
#out_url = f"{rand_im}-vid_tmp_proc.png"
|
| 234 |
-
return out
|
| 235 |
inp.change(upd,inp,inp)
|
| 236 |
|
| 237 |
btn.click(fin_clear,None,fin,show_progress=False)
|
|
|
|
| 177 |
def fin_clear():
|
| 178 |
fin_sum.clear()
|
| 179 |
return None
|
| 180 |
+
|
| 181 |
+
def upd(image):
|
| 182 |
+
print (image)
|
| 183 |
+
rand_im = uuid.uuid4()
|
| 184 |
+
image.save(f"{rand_im}-vid_tmp_proc.png")
|
| 185 |
+
out = Image.open(f"{rand_im}-vid_tmp_proc.png")
|
| 186 |
+
|
| 187 |
+
#image.save(f"{rand_im}-vid_tmp_proc.png")
|
| 188 |
+
#out = os.path.abspath(f"{rand_im}-vid_tmp_proc.png")
|
| 189 |
+
#out_url = f'https://omnibus_AI_or_Not_dev.hf.space/file={out}'
|
| 190 |
+
#out_url = f"{rand_im}-vid_tmp_proc.png"
|
| 191 |
+
return out
|
| 192 |
+
|
| 193 |
+
|
| 194 |
with gr.Blocks() as app:
|
| 195 |
gr.Markdown("""<center><h1>AI Image Detector<br><h4>(Test Demo - accuracy varies by model)""")
|
| 196 |
with gr.Column():
|
|
|
|
| 236 |
outp5 = gr.HTML("""""")
|
| 237 |
hid_box=gr.Textbox(visible=False)
|
| 238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
inp.change(upd,inp,inp)
|
| 241 |
|
| 242 |
btn.click(fin_clear,None,fin,show_progress=False)
|