Spaces:
Running
on
Zero
Running
on
Zero
Update infer.py
Browse files
infer.py
CHANGED
@@ -11,7 +11,7 @@ import spaces
|
|
11 |
|
12 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
13 |
|
14 |
-
@spaces.GPU(duration=60
|
15 |
def infer_image(img: Image.Image, size_modifier: int ) -> Image.Image:
|
16 |
if img is None:
|
17 |
raise Exception("Image not uploaded")
|
@@ -28,7 +28,7 @@ def infer_image(img: Image.Image, size_modifier: int ) -> Image.Image:
|
|
28 |
print(f"Image size ({device}): {size_modifier} ... OK")
|
29 |
return result
|
30 |
|
31 |
-
@spaces.GPU(duration=
|
32 |
def infer_video(video_filepath: str, size_modifier: int) -> str:
|
33 |
model = RealESRGAN(device, scale=size_modifier)
|
34 |
model.load_weights(f'weights/RealESRGAN_x{size_modifier}.pth', download=False)
|
|
|
11 |
|
12 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
13 |
|
14 |
+
@spaces.GPU(duration=60)
|
15 |
def infer_image(img: Image.Image, size_modifier: int ) -> Image.Image:
|
16 |
if img is None:
|
17 |
raise Exception("Image not uploaded")
|
|
|
28 |
print(f"Image size ({device}): {size_modifier} ... OK")
|
29 |
return result
|
30 |
|
31 |
+
@spaces.GPU(duration=270)
|
32 |
def infer_video(video_filepath: str, size_modifier: int) -> str:
|
33 |
model = RealESRGAN(device, scale=size_modifier)
|
34 |
model.load_weights(f'weights/RealESRGAN_x{size_modifier}.pth', download=False)
|