Skip to content

Commit

Permalink
Cool.
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Kreitzer committed Jan 17, 2024
1 parent e5d1545 commit 5d2cd01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video_upscaler/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from PIL import Image
import numpy as np
import av
from RealESRGAN import RealESRGAN
from argparse import ArgumentParser
from pathlib import Path
from tqdm import tqdm
from RealESRGAN import RealESRGAN

def upscale_image(image: Image, device: torch.device, weights: Path, scale: int = 4) -> Image:
"""Upscale a single image."""
Expand All @@ -23,7 +23,7 @@ def upscale_frame(frame: av.VideoFrame, upscaler: RealESRGAN) -> av.VideoFrame:
def get_upscaler(device: torch.device, model_weights_path: Path, scale: int = 4) -> RealESRGAN:
"""Get the upscaler model."""
upscaler = RealESRGAN(device, scale)
upscaler.load_weights(str(model_weights_path), download=True)
upscaler.load_weights(model_weights_path, download=True)
return upscaler

def upscale_video(input_path: Path, upscaler: RealESRGAN, scale: int = 4) -> None:
Expand Down
Binary file modified tests/data/heidi.mp4
Binary file not shown.

0 comments on commit 5d2cd01

Please sign in to comment.