Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,14 @@ import urllib.request
|
|
| 8 |
import uuid
|
| 9 |
uid=uuid.uuid4()
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
def softmax(vector):
|
|
|
|
| 8 |
import uuid
|
| 9 |
uid=uuid.uuid4()
|
| 10 |
|
| 11 |
+
pipe = pipeline("image-classification", "umm-maybe/AI-image-detector")
|
| 12 |
+
|
| 13 |
+
def image_classifier(image):
|
| 14 |
+
outputs = pipe(image)
|
| 15 |
+
results = {}
|
| 16 |
+
for result in outputs:
|
| 17 |
+
results[result['label']] = result['score']
|
| 18 |
+
return results
|
| 19 |
|
| 20 |
|
| 21 |
def softmax(vector):
|