Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,19 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|