Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ model = AutoModelForImageClassification.from_pretrained("Amite5h/convnext-tiny-f
|
|
| 12 |
|
| 13 |
st.title("EuroSAT Detection")
|
| 14 |
|
| 15 |
-
file_name = st.file_uploader("Upload a
|
| 16 |
|
| 17 |
if file_name is not None:
|
| 18 |
col1, col2 = st.columns(2)
|
|
@@ -25,7 +25,7 @@ if file_name is not None:
|
|
| 25 |
image_tensor = extractor(images=image, return_tensors="pt")["pixel_values"]
|
| 26 |
predictions = model(image_tensor)
|
| 27 |
|
| 28 |
-
predicted_probabilities = torch.softmax(
|
| 29 |
predicted_labels = model.config.id2label
|
| 30 |
|
| 31 |
# Create a dictionary of labels and probabilities
|
|
|
|
| 12 |
|
| 13 |
st.title("EuroSAT Detection")
|
| 14 |
|
| 15 |
+
file_name = st.file_uploader("Upload a geospatial image")
|
| 16 |
|
| 17 |
if file_name is not None:
|
| 18 |
col1, col2 = st.columns(2)
|
|
|
|
| 25 |
image_tensor = extractor(images=image, return_tensors="pt")["pixel_values"]
|
| 26 |
predictions = model(image_tensor)
|
| 27 |
|
| 28 |
+
predicted_probabilities = torch.softmax(predictions.logits, dim=1)[0]
|
| 29 |
predicted_labels = model.config.id2label
|
| 30 |
|
| 31 |
# Create a dictionary of labels and probabilities
|