Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ model.to(device)
|
|
| 46 |
def sigmoid(_outputs):
|
| 47 |
return 1.0 / (1.0 + np.exp(-_outputs))
|
| 48 |
|
| 49 |
-
def predict(image, threshold):
|
| 50 |
# Preprocess the image
|
| 51 |
processor = AutoImageProcessor.from_pretrained(checkpoint_name)
|
| 52 |
inputs = processor(images=image, return_tensors="pt").to(device)
|
|
|
|
| 46 |
def sigmoid(_outputs):
|
| 47 |
return 1.0 / (1.0 + np.exp(-_outputs))
|
| 48 |
|
| 49 |
+
def predict(image, threshold=0.5):
|
| 50 |
# Preprocess the image
|
| 51 |
processor = AutoImageProcessor.from_pretrained(checkpoint_name)
|
| 52 |
inputs = processor(images=image, return_tensors="pt").to(device)
|