Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.22
rev: v0.16.10
hooks:
- id: ruff
args: [--fix]
exclude: \.ipynb$
- id: ruff-format
- repo: https://github.com/PyCQA/isort
rev: 9.0.0b1
rev: 9.0.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
Expand All @@ -28,7 +28,7 @@ repos:
hooks:
- id: pyupgrade
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.3
rev: v2.4.0
hooks:
- id: autoflake
args: ["--remove-all-unused-imports", "--in-place"]
2 changes: 1 addition & 1 deletion data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __getitem__(self, index: int, max_retries: int = 10):
raise RuntimeError(
f"VideoIter:: failed to load a sample after {max_retries} retries"
) from e
index = np.random.choice(range(0, self.__len__()))
index = np.random.choice(range(self.__len__()))
trace_back = sys.exc_info()[2]
if trace_back is not None:
line = str(trace_back.tb_lineno)
Expand Down
2 changes: 1 addition & 1 deletion features_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __getitem__(self, index: int, max_retries: int = 10) -> tuple[Tensor, Tensor
raise RuntimeError(
f"FeaturesLoader:: failed to load a sample after {max_retries} retries"
) from e
index = np.random.choice(range(0, self.__len__()))
index = np.random.choice(range(self.__len__()))
logging.warning(
f"FeaturesLoader:: ERROR!! (Force using another index:\n{index})\n{e}"
)
Expand Down
4 changes: 1 addition & 3 deletions utils/functional_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ def to_tensor(clip):
"""
_is_tensor_video_clip(clip)
if not clip.dtype == torch.uint8:
raise TypeError(
f"clip tensor should have data type uint8. Got {str(clip.dtype)}"
)
raise TypeError(f"clip tensor should have data type uint8. Got {clip.dtype!s}")
return clip.float().permute(3, 0, 1, 2) / 255.0


Expand Down
4 changes: 2 additions & 2 deletions utils/transforms_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from . import functional_video as F

__all__ = [
"RandomResizedCropVideo",
"CenterCropVideo",
"NormalizeVideo",
"ToTensorVideo",
"RandomHorizontalFlipVideo",
"RandomResizedCropVideo",
"ToTensorVideo",
]


Expand Down
Loading