Skip to content

Commit

Permalink
v1.0.2 - Ability to select device via argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Oct 22, 2019
1 parent 1b00746 commit 46998a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="vsgan",
version="1.0.1",
version="1.0.2",
author="PRAGMA",
author_email="[email protected]",
description="VapourSynth GAN Implementation using RRDBNet, based on ESRGAN's implementation",
Expand Down
9 changes: 7 additions & 2 deletions vsgan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@
import torch

# - Torch&Cuda, RRDBNet Arch, and Model
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
DEVICE = None
MODEL = None

# - Start VSGAN operations
def Start(clip, model, scale, old_arch=False):
def Start(clip, model, scale, device='cuda', old_arch=False):
global DEVICE
global MODEL
# Setup a device, use CPU instead if cuda isn't available
if not torch.cuda.is_available():
device = 'cpu'
DEVICE = torch.device(device)
# select the arch to be used based on old_arch parameter
if old_arch:
from . import RRDBNet_arch_old as arch
Expand Down

0 comments on commit 46998a2

Please sign in to comment.