Skip to content

Commit

Permalink
Print only valid frame count if max count is None
Browse files Browse the repository at this point in the history
  • Loading branch information
bhky committed May 6, 2022
1 parent cc123a2 commit 28936ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hgd/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def video_to_landmarks(
mp_drawing.draw_detection(frame, detection)
flipped_frame = cv2.flip(frame, 1) # pylint: disable=no-member

text = f"{valid_frame_count} / {max_num_frames}"
text = f"{valid_frame_count} / {max_num_frames}" \
if max_num_frames else str(valid_frame_count)
cv2.putText( # pylint: disable=no-member
flipped_frame, text, (10, 20),
cv2.FONT_HERSHEY_SIMPLEX, # pylint: disable=no-member
Expand Down

0 comments on commit 28936ff

Please sign in to comment.