Spaces:
Runtime error
Runtime error
update app.py
Browse files- .pre-commit-config.yaml +36 -0
- app.py +10 -0
- style.css +13 -0
.pre-commit-config.yaml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
exclude: ^mmdet_configs/configs/
|
2 |
+
repos:
|
3 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
4 |
+
rev: v4.2.0
|
5 |
+
hooks:
|
6 |
+
- id: check-executables-have-shebangs
|
7 |
+
- id: check-json
|
8 |
+
- id: check-merge-conflict
|
9 |
+
- id: check-shebang-scripts-are-executable
|
10 |
+
- id: check-toml
|
11 |
+
- id: check-yaml
|
12 |
+
- id: double-quote-string-fixer
|
13 |
+
- id: end-of-file-fixer
|
14 |
+
- id: mixed-line-ending
|
15 |
+
args: ['--fix=lf']
|
16 |
+
- id: requirements-txt-fixer
|
17 |
+
- id: trailing-whitespace
|
18 |
+
- repo: https://github.com/myint/docformatter
|
19 |
+
rev: v1.4
|
20 |
+
hooks:
|
21 |
+
- id: docformatter
|
22 |
+
args: ['--in-place']
|
23 |
+
- repo: https://github.com/pycqa/isort
|
24 |
+
rev: 5.12.0
|
25 |
+
hooks:
|
26 |
+
- id: isort
|
27 |
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
28 |
+
rev: v0.991
|
29 |
+
hooks:
|
30 |
+
- id: mypy
|
31 |
+
args: ['--ignore-missing-imports']
|
32 |
+
- repo: https://github.com/google/yapf
|
33 |
+
rev: v0.32.0
|
34 |
+
hooks:
|
35 |
+
- id: yapf
|
36 |
+
args: ['--parallel', '--in-place']
|
app.py
CHANGED
@@ -7,6 +7,16 @@ import pathlib
|
|
7 |
import subprocess
|
8 |
import tarfile
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
import cv2
|
11 |
import gradio as gr
|
12 |
import numpy as np
|
|
|
7 |
import subprocess
|
8 |
import tarfile
|
9 |
|
10 |
+
if os.getenv('SYSTEM') == 'spaces':
|
11 |
+
import mim
|
12 |
+
|
13 |
+
mim.uninstall('mmcv-full', confirm_yes=True)
|
14 |
+
mim.install('mmcv-full==1.5.2', is_yes=True)
|
15 |
+
|
16 |
+
subprocess.call('pip uninstall -y opencv-python'.split())
|
17 |
+
subprocess.call('pip uninstall -y opencv-python-headless'.split())
|
18 |
+
subprocess.call('pip install opencv-python-headless==4.5.5.64'.split())
|
19 |
+
|
20 |
import cv2
|
21 |
import gradio as gr
|
22 |
import numpy as np
|
style.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
h1 {
|
2 |
+
text-align: center;
|
3 |
+
}
|
4 |
+
img#overview {
|
5 |
+
display: block;
|
6 |
+
margin: auto;
|
7 |
+
max-width: 1000px;
|
8 |
+
max-height: 600px;
|
9 |
+
}
|
10 |
+
img#visitor-badge {
|
11 |
+
display: block;
|
12 |
+
margin: auto;
|
13 |
+
}
|