Spaces:
Sleeping
Sleeping
fahmiaziz98
commited on
Commit
·
fc81503
1
Parent(s):
a523647
first commit
Browse files
app.py
CHANGED
@@ -70,15 +70,16 @@ if model_choice == "TinyBert Disaster Classification":
|
|
70 |
# **3. Image Classification**
|
71 |
if model_choice == "VIT Pose Classification":
|
72 |
uploaded_file = st.file_uploader("Upload Image", type=["jpg", "png", "jpeg"])
|
73 |
-
predict = st.button("Predict Image")
|
74 |
|
75 |
if uploaded_file is not None:
|
76 |
image = Image.open(uploaded_file)
|
|
|
77 |
col1, col2 = st.columns([1, 1])
|
78 |
|
79 |
with col1:
|
80 |
st.image(image, caption="Your Image", width=300)
|
81 |
-
|
82 |
with col2:
|
83 |
try:
|
84 |
image_processor = AutoImageProcessor.from_pretrained(local_path, use_fast=True)
|
@@ -87,7 +88,8 @@ if model_choice == "VIT Pose Classification":
|
|
87 |
st.error("❌ Model not found. Please download the model first.")
|
88 |
pipe = None
|
89 |
|
90 |
-
|
91 |
with st.spinner("Predicting..."):
|
92 |
output = pipe(image)
|
93 |
-
st.write(
|
|
|
|
70 |
# **3. Image Classification**
|
71 |
if model_choice == "VIT Pose Classification":
|
72 |
uploaded_file = st.file_uploader("Upload Image", type=["jpg", "png", "jpeg"])
|
73 |
+
predict = st.button("Predict Image")
|
74 |
|
75 |
if uploaded_file is not None:
|
76 |
image = Image.open(uploaded_file)
|
77 |
+
|
78 |
col1, col2 = st.columns([1, 1])
|
79 |
|
80 |
with col1:
|
81 |
st.image(image, caption="Your Image", width=300)
|
82 |
+
|
83 |
with col2:
|
84 |
try:
|
85 |
image_processor = AutoImageProcessor.from_pretrained(local_path, use_fast=True)
|
|
|
88 |
st.error("❌ Model not found. Please download the model first.")
|
89 |
pipe = None
|
90 |
|
91 |
+
if predict and pipe:
|
92 |
with st.spinner("Predicting..."):
|
93 |
output = pipe(image)
|
94 |
+
st.write("### Prediction Results:")
|
95 |
+
st.json(output)
|