Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from transformers import AutoFeatureExtractor, AutoModelForImageClassification, pipeline
|
|
|
|
|
4 |
from numpy import exp
|
5 |
import pandas as pd
|
6 |
from PIL import Image
|
@@ -44,6 +46,7 @@ def softmax(vector):
|
|
44 |
|
45 |
|
46 |
fin_sum=[]
|
|
|
47 |
def aiornot0(image):
|
48 |
labels = ["Real", "AI"]
|
49 |
mod=models[0]
|
@@ -197,11 +200,11 @@ with gr.Blocks() as app:
|
|
197 |
n_out5=gr.Label(label="Output")
|
198 |
outp5 = gr.HTML("""""")
|
199 |
|
200 |
-
btn.click(fin_clear,None,fin)
|
201 |
load_btn.click(load_url,in_url,[inp,mes])
|
202 |
-
btn.click(aiornot0,[inp],[outp0,n_out0]).then(tot_prob,None,fin)
|
203 |
-
btn.click(aiornot1,[inp],[outp1,n_out1]).then(tot_prob,None,fin)
|
204 |
-
btn.click(aiornot2,[inp],[outp2,n_out2]).then(tot_prob,None,fin)
|
205 |
|
206 |
btn.click(image_classifier0,[inp],[n_out3])
|
207 |
btn.click(image_classifier1,[inp],[n_out4])
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
#from transformers import AutoFeatureExtractor, AutoModelForImageClassification, pipeline
|
4 |
+
from transformers import pipeline
|
5 |
+
|
6 |
from numpy import exp
|
7 |
import pandas as pd
|
8 |
from PIL import Image
|
|
|
46 |
|
47 |
|
48 |
fin_sum=[]
|
49 |
+
|
50 |
def aiornot0(image):
|
51 |
labels = ["Real", "AI"]
|
52 |
mod=models[0]
|
|
|
200 |
n_out5=gr.Label(label="Output")
|
201 |
outp5 = gr.HTML("""""")
|
202 |
|
203 |
+
#btn.click(fin_clear,None,fin)
|
204 |
load_btn.click(load_url,in_url,[inp,mes])
|
205 |
+
#btn.click(aiornot0,[inp],[outp0,n_out0]).then(tot_prob,None,fin)
|
206 |
+
#btn.click(aiornot1,[inp],[outp1,n_out1]).then(tot_prob,None,fin)
|
207 |
+
#btn.click(aiornot2,[inp],[outp2,n_out2]).then(tot_prob,None,fin)
|
208 |
|
209 |
btn.click(image_classifier0,[inp],[n_out3])
|
210 |
btn.click(image_classifier1,[inp],[n_out4])
|