Skip to content

Instantly share code, notes, and snippets.

View fmac2000's full-sized avatar
๐Ÿ˜Ž
Being cool

fmac2000

๐Ÿ˜Ž
Being cool
View GitHub Profile
@petered
petered / video_reader.py
Last active July 12, 2024 08:07
Defines a VideoReader class - which makes it easily to efficiently access frames in a video on request
import hashlib
import itertools
import os
from collections import OrderedDict
from dataclasses import dataclass
from typing import Optional, TypeVar, Generic, Hashable, Any
from typing import Tuple, Iterator
import av
import cv2