2052man commited on
Commit
8c31614
1 Parent(s): 17b65f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -1,3 +1,19 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/umm-maybe/AI-image-detector").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ pipe = pipeline("image-classification", "umm-maybe/AI-image-detector")
5
+
6
+ def image_classifier(image):
7
+ outputs = pipe(image)
8
+ results = {}
9
+ for result in outputs:
10
+ results[result['label']] = result['score']
11
+ return results
12
+
13
+ title = "ai-image-detector-net"
14
+ description = """
15
+ got ali
16
+ """
17
+
18
+ demo = gr.Interface(fn=image_classifier, inputs=gr.Image(type="pil"), outputs="label", title=title, description=description)
19
+ demo.launch(show_api=False)