Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -14,11 +14,12 @@ from huggingface_hub import hf_hub_download
|
|
14 |
### We use the ckpt of 79999_iter.pth: https://drive.google.com/open?id=154JgKpzCPW82qINcVieuPH3fZ2e0P812
|
15 |
### Thanks for the open source of face-parsing model.
|
16 |
from models.BiSeNet.model import BiSeNet
|
17 |
-
from multiprocessing import Process, Queue
|
18 |
|
19 |
-
zero = torch.Tensor([0]).cuda()
|
20 |
-
print(zero.device) # <-- 'cpu' 🤔
|
21 |
-
device = zero.device # "cuda"
|
|
|
22 |
|
23 |
# Gets the absolute path of the current script
|
24 |
script_directory = os.path.dirname(os.path.realpath(__file__))
|
@@ -38,7 +39,6 @@ pipe = ConsistentIDStableDiffusionPipeline.from_pretrained(
|
|
38 |
### Load other pretrained models
|
39 |
@spaces.GPU
|
40 |
def load_model(queue, bise_net_cp_path):
|
41 |
-
device = torch.device('cuda')
|
42 |
bise_net = BiSeNet(n_classes = 19)
|
43 |
bise_net.to(device)
|
44 |
bise_net.load_state_dict(torch.load(bise_net_cp_path))
|
|
|
14 |
### We use the ckpt of 79999_iter.pth: https://drive.google.com/open?id=154JgKpzCPW82qINcVieuPH3fZ2e0P812
|
15 |
### Thanks for the open source of face-parsing model.
|
16 |
from models.BiSeNet.model import BiSeNet
|
17 |
+
from multiprocessing import Process, Queue, Manager
|
18 |
|
19 |
+
# zero = torch.Tensor([0]).cuda()
|
20 |
+
# print(zero.device) # <-- 'cpu' 🤔
|
21 |
+
# device = zero.device # "cuda"
|
22 |
+
device = "cuda"
|
23 |
|
24 |
# Gets the absolute path of the current script
|
25 |
script_directory = os.path.dirname(os.path.realpath(__file__))
|
|
|
39 |
### Load other pretrained models
|
40 |
@spaces.GPU
|
41 |
def load_model(queue, bise_net_cp_path):
|
|
|
42 |
bise_net = BiSeNet(n_classes = 19)
|
43 |
bise_net.to(device)
|
44 |
bise_net.load_state_dict(torch.load(bise_net_cp_path))
|