Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/io_utils.py
Differential Revision: D104644929 fbshipit-source-id: 53867910385982e0620979b9a46049fe4d02224d
This commit is contained in:
committed by
meta-codesync[bot]
parent
2530a8a7af
commit
4cbac146c1
@@ -442,7 +442,13 @@ class TorchCodecDecoder:
|
|||||||
which are not supported by `torchcodec.decoders.SimpleVideoDecoder` yet.
|
which are not supported by `torchcodec.decoders.SimpleVideoDecoder` yet.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, source, dimension_order="NCHW", device="cpu", num_threads=1):
|
def __init__(
|
||||||
|
self,
|
||||||
|
source: Union[str, bytes],
|
||||||
|
dimension_order: str = "NCHW",
|
||||||
|
device: str = "cpu",
|
||||||
|
num_threads: int = 1,
|
||||||
|
) -> None:
|
||||||
from torchcodec import _core as core
|
from torchcodec import _core as core
|
||||||
|
|
||||||
self._source = source # hold a reference to the source to prevent it from GC
|
self._source = source # hold a reference to the source to prevent it from GC
|
||||||
@@ -512,7 +518,7 @@ class FIFOLock:
|
|||||||
self._waiters.get()
|
self._waiters.get()
|
||||||
self._condition.notify_all()
|
self._condition.notify_all()
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self) -> None:
|
||||||
self.acquire()
|
self.acquire()
|
||||||
|
|
||||||
def __exit__(
|
def __exit__(
|
||||||
|
|||||||
Reference in New Issue
Block a user