Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,6 +22,23 @@ from huggingface_hub import snapshot_download
|
|
| 22 |
import subprocess
|
| 23 |
import sys
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
@spaces.GPU(duration=120)
|
| 26 |
def download_liveportrait():
|
| 27 |
"""
|
|
|
|
| 22 |
import subprocess
|
| 23 |
import sys
|
| 24 |
|
| 25 |
+
@spaces.GPU(duration=120)
|
| 26 |
+
def install_deformable_detr():
|
| 27 |
+
# ๅ
้ Deformable-DETR ไปๅบ
|
| 28 |
+
if not os.path.exists('Deformable-DETR'):
|
| 29 |
+
subprocess.run(['git', 'clone', 'https://github.com/fundamentalvision/Deformable-DETR.git'])
|
| 30 |
+
|
| 31 |
+
# ๅฎ่ฃ
ไพ่ต
|
| 32 |
+
subprocess.run(['pip', 'install', '-r', 'Deformable-DETR/requirements.txt'])
|
| 33 |
+
|
| 34 |
+
# ็ผ่ฏ CUDA ๆไฝ็ฌฆ
|
| 35 |
+
os.chdir('Deformable-DETR/models/ops')
|
| 36 |
+
subprocess.run(['sh', './make.sh'])
|
| 37 |
+
os.chdir('../../../..')
|
| 38 |
+
|
| 39 |
+
# ๅจๅบ็จๅฏๅจๆถ่ฐ็จๅฎ่ฃ
ๅฝๆฐ
|
| 40 |
+
install_deformable_detr()
|
| 41 |
+
|
| 42 |
@spaces.GPU(duration=120)
|
| 43 |
def download_liveportrait():
|
| 44 |
"""
|