From d6bd2233e0542ae5a43c34095ea34ebadf750c37 Mon Sep 17 00:00:00 2001 From: Yazhou Cao Date: Wed, 27 Mar 2024 09:31:46 -0700 Subject: [PATCH] Attempt to support py 3.9 --- .github/workflows/ci_cd.yml | 2 +- vision_agent/tools/video.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index d21d703b..ade39771 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -9,7 +9,7 @@ jobs: Test: strategy: matrix: - python-version: [3.10.11] + python-version: [3.9, 3.10.11] os: [ ubuntu-22.04, windows-2022, macos-12 ] runs-on: ${{ matrix.os }} steps: diff --git a/vision_agent/tools/video.py b/vision_agent/tools/video.py index 5745c2fe..606166ed 100644 --- a/vision_agent/tools/video.py +++ b/vision_agent/tools/video.py @@ -2,7 +2,7 @@ import math import os from concurrent.futures import ProcessPoolExecutor, as_completed -from typing import cast +from typing import List, Tuple, cast import cv2 import numpy as np @@ -16,7 +16,7 @@ def extract_frames_from_video( video_uri: str, fps: int = 2, motion_detection_threshold: float = 0.06 -) -> list[tuple[np.ndarray, float]]: +) -> List[Tuple[np.ndarray, float]]: """Extract frames from a video Parameters: @@ -86,7 +86,7 @@ def _extract_frames_by_clip( end: float = -1, fps: int = 2, motion_detection_threshold: float = 0.06, -) -> list[tuple[np.ndarray, float]]: +) -> List[Tuple[np.ndarray, float]]: """Extract frames from a video clip with start and end time in seconds. Parameters: