Fix classification issue
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ model = AutoModelForImageClassification.from_pretrained(
|
|
14 |
label2id={'Crack': 0, 'Red-Dots': 1, 'Toothmark': 2}
|
15 |
)
|
16 |
|
17 |
-
def classify_image(image):
|
18 |
inputs = processor(images=image, return_tensors="pt")
|
19 |
with torch.no_grad():
|
20 |
outputs = model(**inputs)
|
|
|
14 |
label2id={'Crack': 0, 'Red-Dots': 1, 'Toothmark': 2}
|
15 |
)
|
16 |
|
17 |
+
def classify_image(image, threshold=0.5):
|
18 |
inputs = processor(images=image, return_tensors="pt")
|
19 |
with torch.no_grad():
|
20 |
outputs = model(**inputs)
|