Niharmahesh commited on
Commit
5f6154a
·
verified ·
1 Parent(s): 96faedc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- # Release MediaPipe resources
168
- hands.close()
 
 
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()