INNER CODE UNIT · Python

get_pitch_frames

chonyy/ML-auto-baseball-pitching-overlay · src/get_pitch_frames.py:18

def get_pitch_frames(video_path, infer, input_size, iou, score_threshold):
    print("Video from: ", video_path)
    vid = cv2.VideoCapture(video_path)

    width = int(vid.get(cv2.CAP_PROP_FRAME_WIDTH))
    height = int(vid.get(cv2.CAP_PROP_FRAME_HEIGHT))
    fps = int(vid.get(cv2.CAP_PROP_FPS))

    track_colors = [
        (161, 235, 52),
        (83, 254, 92),
        (255, 112, 52),
        (161, 235, 52),
        (255, 235, 52),
        (255, 38, 38),
        (255, 235, 52),
        (210, 235, 52),
        (52, 235, 131),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…