Spaces:
Running
Running
gavinyuan
commited on
Commit
·
51779c3
1
Parent(s):
b9be4e6
add: PIPNet make.sh when started
Browse files
app.py
CHANGED
@@ -167,6 +167,17 @@ else:
|
|
167 |
print(f'[demo] model loaded from {pt_path}')
|
168 |
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
def swap_image(
|
171 |
source_image,
|
172 |
target_path,
|
@@ -436,6 +447,8 @@ def swap_video_gr(img1, target_path, use_gpu=True, frames=9999999):
|
|
436 |
|
437 |
if __name__ == "__main__":
|
438 |
use_gpu = torch.cuda.is_available()
|
|
|
|
|
439 |
with gr.Blocks() as demo:
|
440 |
gr.Markdown("SuperSwap")
|
441 |
|
|
|
167 |
print(f'[demo] model loaded from {pt_path}')
|
168 |
|
169 |
|
170 |
+
def make_pipnet():
|
171 |
+
cmds = [
|
172 |
+
"cd ./third_party/PIPNet/FaceBoxesV2/utils/nms/"
|
173 |
+
"chmod +x make.sh"
|
174 |
+
"bash ./make.sh"
|
175 |
+
"cd -"
|
176 |
+
]
|
177 |
+
for cmd in cmds:
|
178 |
+
os.system(cmd)
|
179 |
+
|
180 |
+
|
181 |
def swap_image(
|
182 |
source_image,
|
183 |
target_path,
|
|
|
447 |
|
448 |
if __name__ == "__main__":
|
449 |
use_gpu = torch.cuda.is_available()
|
450 |
+
make_pipnet()
|
451 |
+
|
452 |
with gr.Blocks() as demo:
|
453 |
gr.Markdown("SuperSwap")
|
454 |
|