Skip to content

Commit

Permalink
fix: vsr vs_inference out of index (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tohrusky authored Oct 9, 2024
1 parent cee4763 commit 48c2135
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions ccrestoration/vs/vsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ def _inference(n: int, f: list[vs.VideoFrame]) -> vs.VideoFrame:

img = []
for i in range(length):
if n + i >= clip.num_frames:
index = n + i
if index >= clip.num_frames:
img.append(frame_to_tensor(clip.get_frame(clip.num_frames - 1), device=device).unsqueeze(0))
img.append(frame_to_tensor(clip.get_frame(n + i), device=device).unsqueeze(0))

else:
img.append(frame_to_tensor(clip.get_frame(n + i), device=device).unsqueeze(0))

img = torch.stack(img, dim=1)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ license = "MIT"
name = "ccrestoration"
readme = "README.md"
repository = "https://github.com/TensoRaws/ccrestoration"
version = "0.0.7"
version = "0.0.8"

# Requirements
[tool.poetry.dependencies]
Expand Down

0 comments on commit 48c2135

Please sign in to comment.