Xuanyou commited on
Commit
068485c
ยท
verified ยท
1 Parent(s): 06797d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
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
  """