Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -161,8 +161,11 @@ with tab2:
|
|
161 |
if landmarks is not None:
|
162 |
fig = plot_hand_landmarks(landmarks, f"Hand Landmarks for {alphabet}")
|
163 |
st.pyplot(fig)
|
|
|
|
|
164 |
else:
|
165 |
st.error(f"Image not found for {alphabet}")
|
166 |
|
167 |
-
#
|
168 |
-
hands
|
|
|
|
161 |
if landmarks is not None:
|
162 |
fig = plot_hand_landmarks(landmarks, f"Hand Landmarks for {alphabet}")
|
163 |
st.pyplot(fig)
|
164 |
+
else:
|
165 |
+
st.error(f"Failed to process image for {alphabet}")
|
166 |
else:
|
167 |
st.error(f"Image not found for {alphabet}")
|
168 |
|
169 |
+
# Don't close hands here, as it might be None
|
170 |
+
if hands is not None:
|
171 |
+
hands.close()
|