Skip to content

Commit

Permalink
array index out of range, error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre-AMALOR-RAJ authored and gireg.roussel committed Dec 27, 2024
1 parent 8a00712 commit d2f9e09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion edge_streamlit/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def main():
caps = {index: cv2.VideoCapture(index) for index in selected_cameras}
columns = st.columns(len(selected_cameras))
frames_video = {index: columns[i].empty() for i, index in enumerate(selected_cameras)}
frames_image = {index: columns[i].empty() for i, index in enumerate(selected_cameras)}

if st.button("Trigger"):
payload = None
Expand Down
3 changes: 2 additions & 1 deletion edge_streamlit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def list_cameras() -> List[str]:
cap = cv2.VideoCapture(index)
if not cap.read()[0]:
break
available_cameras.append(f"Cam {index}")
else:
available_cameras.append(f"Cam {index}")
cap.release()
index += 1
return available_cameras
Expand Down

0 comments on commit d2f9e09

Please sign in to comment.