Commit
·
57822a3
1
Parent(s):
103d9d6
just one file uploader
Browse files
app.py
CHANGED
|
@@ -21,23 +21,20 @@ model_trained = ViTForImageClassification.from_pretrained(
|
|
| 21 |
|
| 22 |
st.title("Detect Hurricane Damage")
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
col1, col2 = st.columns(2)
|
| 25 |
with col1:
|
| 26 |
st.markdown("## Pre-Trained Model")
|
| 27 |
-
file_name = st.file_uploader("Upload a satellite image")
|
| 28 |
-
|
| 29 |
if file_name is not None:
|
| 30 |
-
image = Image.open(file_name)
|
| 31 |
-
col1.image(image, use_container_width=True)
|
| 32 |
label = predict(model_untrained, image)
|
| 33 |
st.write(f"Predicted label: {label}")
|
| 34 |
|
| 35 |
with col2:
|
| 36 |
st.markdown("## Fine-Tuned Model")
|
| 37 |
-
file_name = st.file_uploader("Upload a satellite image")
|
| 38 |
-
|
| 39 |
if file_name is not None:
|
| 40 |
-
image = Image.open(file_name)
|
| 41 |
-
col2.image(image, use_container_width=True)
|
| 42 |
label = predict(model_trained, image)
|
| 43 |
st.write(f"Predicted label: {label}")
|
|
|
|
| 21 |
|
| 22 |
st.title("Detect Hurricane Damage")
|
| 23 |
|
| 24 |
+
file_name = st.file_uploader("Upload a satellite image")
|
| 25 |
+
if file_name is not None:
|
| 26 |
+
image = Image.open(file_name)
|
| 27 |
+
st.image(image, use_container_width=True)
|
| 28 |
+
|
| 29 |
col1, col2 = st.columns(2)
|
| 30 |
with col1:
|
| 31 |
st.markdown("## Pre-Trained Model")
|
|
|
|
|
|
|
| 32 |
if file_name is not None:
|
|
|
|
|
|
|
| 33 |
label = predict(model_untrained, image)
|
| 34 |
st.write(f"Predicted label: {label}")
|
| 35 |
|
| 36 |
with col2:
|
| 37 |
st.markdown("## Fine-Tuned Model")
|
|
|
|
|
|
|
| 38 |
if file_name is not None:
|
|
|
|
|
|
|
| 39 |
label = predict(model_trained, image)
|
| 40 |
st.write(f"Predicted label: {label}")
|