Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,6 @@ model = AutoModelForImageClassification.from_pretrained('0-ma/vit-geometric-shap
|
|
17 |
|
18 |
|
19 |
def predict(image):
|
20 |
-
feature_extractor = AutoImageProcessor.from_pretrained('0-ma/vit-geometric-shapes-tiny')
|
21 |
-
model = AutoModelForImageClassification.from_pretrained('0-ma/vit-geometric-shapes-tiny')
|
22 |
inputs = feature_extractor(images=[image], return_tensors="pt")
|
23 |
logits = model(**inputs)['logits'].cpu().detach().numpy()[0]
|
24 |
logits_positive = logits
|
@@ -31,10 +29,8 @@ def predict(image):
|
|
31 |
return confidences
|
32 |
|
33 |
|
34 |
-
#return {"predicted_label" : predicted_labels[0] }
|
35 |
-
|
36 |
title = "Geometric Shape Classifier"
|
37 |
-
description = "
|
38 |
examples = ['example/1_None.jpg','example/2_Circle.jpg','example/3_Triangle.jpg','example/4_Square.jpg','example/5_Pentagone.jpg','example/6_Hexagone.jpg']
|
39 |
|
40 |
|
|
|
17 |
|
18 |
|
19 |
def predict(image):
|
|
|
|
|
20 |
inputs = feature_extractor(images=[image], return_tensors="pt")
|
21 |
logits = model(**inputs)['logits'].cpu().detach().numpy()[0]
|
22 |
logits_positive = logits
|
|
|
29 |
return confidences
|
30 |
|
31 |
|
|
|
|
|
32 |
title = "Geometric Shape Classifier"
|
33 |
+
description = "The geometric shape classifier: 0-ma/vit-geometric-shapes-tiny."
|
34 |
examples = ['example/1_None.jpg','example/2_Circle.jpg','example/3_Triangle.jpg','example/4_Square.jpg','example/5_Pentagone.jpg','example/6_Hexagone.jpg']
|
35 |
|
36 |
|