Spaces:
Running
on
Zero
Running
on
Zero
Update preprocess/humanparsing/run_parsing.py
Browse files
preprocess/humanparsing/run_parsing.py
CHANGED
@@ -10,13 +10,6 @@ import torch
|
|
10 |
|
11 |
from huggingface_hub import hf_hub_download
|
12 |
|
13 |
-
hf_hub_download(repo_id="levihsu/OOTDiffusion",
|
14 |
-
filename="checkpoints/humanparsing/parsing_atr.onnx",
|
15 |
-
local_dir=os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing'))
|
16 |
-
hf_hub_download(repo_id="levihsu/OOTDiffusion",
|
17 |
-
filename="checkpoints/humanparsing/parsing_lip.onnx",
|
18 |
-
local_dir=os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing'))
|
19 |
-
|
20 |
class Parsing:
|
21 |
def __init__(self, gpu_id: int):
|
22 |
self.gpu_id = gpu_id
|
@@ -25,6 +18,14 @@ class Parsing:
|
|
25 |
session_options.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_ALL
|
26 |
session_options.execution_mode = ort.ExecutionMode.ORT_SEQUENTIAL
|
27 |
session_options.add_session_config_entry('gpu_id', str(gpu_id))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
self.session = ort.InferenceSession(os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing/parsing_atr.onnx'),
|
29 |
sess_options=session_options, providers=['CPUExecutionProvider'])
|
30 |
self.lip_session = ort.InferenceSession(os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing/parsing_lip.onnx'),
|
|
|
10 |
|
11 |
from huggingface_hub import hf_hub_download
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
class Parsing:
|
14 |
def __init__(self, gpu_id: int):
|
15 |
self.gpu_id = gpu_id
|
|
|
18 |
session_options.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_ALL
|
19 |
session_options.execution_mode = ort.ExecutionMode.ORT_SEQUENTIAL
|
20 |
session_options.add_session_config_entry('gpu_id', str(gpu_id))
|
21 |
+
|
22 |
+
hf_hub_download(repo_id="levihsu/OOTDiffusion",
|
23 |
+
filename="checkpoints/humanparsing/parsing_atr.onnx",
|
24 |
+
local_dir=os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing'))
|
25 |
+
hf_hub_download(repo_id="levihsu/OOTDiffusion",
|
26 |
+
filename="checkpoints/humanparsing/parsing_lip.onnx",
|
27 |
+
local_dir=os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing'))
|
28 |
+
|
29 |
self.session = ort.InferenceSession(os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing/parsing_atr.onnx'),
|
30 |
sess_options=session_options, providers=['CPUExecutionProvider'])
|
31 |
self.lip_session = ort.InferenceSession(os.path.join(Path(__file__).absolute().parents[2].absolute(), 'checkpoints/humanparsing/parsing_lip.onnx'),
|