Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import torch
|
|
3 |
from transformers import AutoFeatureExtractor, AutoModelForImageClassification, pipeline
|
4 |
from numpy import exp
|
5 |
import pandas as pd
|
6 |
-
|
7 |
def softmax(vector):
|
8 |
e = exp(vector)
|
9 |
return e / e.sum()
|
@@ -91,7 +91,7 @@ def aiornot2(image):
|
|
91 |
return gr.HTML.update(html_out),results
|
92 |
def load_url(url):
|
93 |
try:
|
94 |
-
image =
|
95 |
mes = "Image Loaded"
|
96 |
except Exception as e:
|
97 |
image=None
|
|
|
3 |
from transformers import AutoFeatureExtractor, AutoModelForImageClassification, pipeline
|
4 |
from numpy import exp
|
5 |
import pandas as pd
|
6 |
+
from PIL import Image
|
7 |
def softmax(vector):
|
8 |
e = exp(vector)
|
9 |
return e / e.sum()
|
|
|
91 |
return gr.HTML.update(html_out),results
|
92 |
def load_url(url):
|
93 |
try:
|
94 |
+
image = Image.open(url)
|
95 |
mes = "Image Loaded"
|
96 |
except Exception as e:
|
97 |
image=None
|