Skip to content

Commit

Permalink
fix labelbox_utils mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tyesayan committed Dec 8, 2024
1 parent f29fceb commit f30b95b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions deeplake/integrations/labelbox/labelbox_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import numpy as np
from typing import Generator, Tuple
from typing import Generator, Tuple, Optional, Any
import labelbox as lb # type: ignore
import av
import requests
from collections import Counter



def is_remote_resource_public_(url):
try:
response = requests.head(url, allow_redirects=True)
Expand Down Expand Up @@ -37,7 +38,7 @@ def filter_video_paths_(video_paths, strategy):


def frame_generator_(
video_path: str, header: dict, retries: int = 5
video_path: str, header: Optional[dict[str, Any]] = None, retries: int = 5
) -> Generator[Tuple[int, np.ndarray], None, None]:
"""
Generate frames from a video file.
Expand Down Expand Up @@ -74,7 +75,7 @@ def get_video_container(current_retries):


def frames_batch_generator_(
video_path: str, header: dict = None, batch_size=100, retries: int = 5
video_path: str, header: Optional[dict[str, Any]] = None, batch_size=100, retries: int = 5
):
frames, indexes = [], []
for frame_num, frame in frame_generator_(video_path, header, retries):
Expand Down

0 comments on commit f30b95b

Please sign in to comment.