hysts HF staff commited on
Commit
a066142
1 Parent(s): 9b1e028
Files changed (2) hide show
  1. app.py +16 -0
  2. model.py +0 -13
app.py CHANGED
@@ -2,9 +2,25 @@
2
 
3
  from __future__ import annotations
4
 
 
5
  import pathlib
 
 
6
  import tarfile
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  import gradio as gr
9
 
10
  from model import AppDetModel, AppPoseModel
 
2
 
3
  from __future__ import annotations
4
 
5
+ import os
6
  import pathlib
7
+ import shlex
8
+ import subprocess
9
  import tarfile
10
 
11
+ if os.getenv("SYSTEM") == "spaces":
12
+ subprocess.run(shlex.split("pip install click==7.1.2"))
13
+ subprocess.run(shlex.split("pip install typer==0.9.4"))
14
+
15
+ import mim
16
+
17
+ mim.uninstall("mmcv-full", confirm_yes=True)
18
+ mim.install("mmcv-full==1.5.0", is_yes=True)
19
+
20
+ subprocess.run(shlex.split("pip uninstall -y opencv-python"))
21
+ subprocess.run(shlex.split("pip uninstall -y opencv-python-headless"))
22
+ subprocess.run(shlex.split("pip install opencv-python-headless==4.8.0.74"))
23
+
24
  import gradio as gr
25
 
26
  from model import AppDetModel, AppPoseModel
model.py CHANGED
@@ -1,21 +1,8 @@
1
  from __future__ import annotations
2
 
3
- import os
4
  import pathlib
5
- import shlex
6
- import subprocess
7
  import sys
8
 
9
- if os.getenv("SYSTEM") == "spaces":
10
- import mim
11
-
12
- mim.uninstall("mmcv-full", confirm_yes=True)
13
- mim.install("mmcv-full==1.5.0", is_yes=True)
14
-
15
- subprocess.run(shlex.split("pip uninstall -y opencv-python"))
16
- subprocess.run(shlex.split("pip uninstall -y opencv-python-headless"))
17
- subprocess.run(shlex.split("pip install opencv-python-headless==4.8.0.74"))
18
-
19
  import huggingface_hub
20
  import numpy as np
21
  import torch
 
1
  from __future__ import annotations
2
 
 
3
  import pathlib
 
 
4
  import sys
5
 
 
 
 
 
 
 
 
 
 
 
6
  import huggingface_hub
7
  import numpy as np
8
  import torch