Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
import numpy as np
|
| 2 |
import torch.nn.functional as F
|
| 3 |
from torchvision.transforms.functional import normalize
|
| 4 |
-
from briarmbg import BriaRMBG
|
| 5 |
import gradio as gr
|
| 6 |
import git # pip install gitpython
|
| 7 |
|
| 8 |
-
net=BriaRMBG()
|
| 9 |
-
model_path = "./model.pth"
|
| 10 |
git.Git(".").clone("https://huggingface.co/spaces/briaai/BRIA-RMBG-1.4")
|
|
|
|
| 11 |
|
|
|
|
|
|
|
| 12 |
if torch.cuda.is_available():
|
| 13 |
net.load_state_dict(torch.load(model_path))
|
| 14 |
net=net.cuda()
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import torch.nn.functional as F
|
| 3 |
from torchvision.transforms.functional import normalize
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
import git # pip install gitpython
|
| 6 |
|
|
|
|
|
|
|
| 7 |
git.Git(".").clone("https://huggingface.co/spaces/briaai/BRIA-RMBG-1.4")
|
| 8 |
+
from briarmbg import BriaRMBG
|
| 9 |
|
| 10 |
+
net=BriaRMBG()
|
| 11 |
+
model_path = "./model.pth"
|
| 12 |
if torch.cuda.is_available():
|
| 13 |
net.load_state_dict(torch.load(model_path))
|
| 14 |
net=net.cuda()
|