e1010101 commited on
Commit
fba7380
1 Parent(s): f498967

Fix classification issue

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)