Spaces:
Runtime error
Runtime error
Update gradio_app.py
Browse files- gradio_app.py +2 -1
gradio_app.py
CHANGED
|
@@ -6,6 +6,7 @@ import base64
|
|
| 6 |
import shutil
|
| 7 |
from typing import Optional, Tuple
|
| 8 |
|
|
|
|
| 9 |
import gradio as gr
|
| 10 |
import torch
|
| 11 |
import cv2
|
|
@@ -188,7 +189,7 @@ SD15_PATH, _, _ = _download_models()
|
|
| 188 |
with open("imgs/background.png", "rb") as f:
|
| 189 |
_b64_bg = base64.b64encode(f.read()).decode()
|
| 190 |
|
| 191 |
-
|
| 192 |
def inference(id_image, hair_image):
|
| 193 |
# Require GPU (HairMapper currently uses CUDA explicitly)
|
| 194 |
if not torch.cuda.is_available():
|
|
|
|
| 6 |
import shutil
|
| 7 |
from typing import Optional, Tuple
|
| 8 |
|
| 9 |
+
import space
|
| 10 |
import gradio as gr
|
| 11 |
import torch
|
| 12 |
import cv2
|
|
|
|
| 189 |
with open("imgs/background.png", "rb") as f:
|
| 190 |
_b64_bg = base64.b64encode(f.read()).decode()
|
| 191 |
|
| 192 |
+
@spaces.GPU
|
| 193 |
def inference(id_image, hair_image):
|
| 194 |
# Require GPU (HairMapper currently uses CUDA explicitly)
|
| 195 |
if not torch.cuda.is_available():
|