Spaces:
Runtime error
Runtime error
edits app + req
Browse files- app.py +13 -10
- requirements.txt +105 -135
app.py
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
|
5 |
-
|
6 |
|
7 |
def yolov7_inference(
|
8 |
-
image: gr.
|
9 |
-
conf_threshold: gr.
|
10 |
):
|
11 |
|
12 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
@@ -16,14 +16,13 @@ def yolov7_inference(
|
|
16 |
results = model([image], size=640)
|
17 |
return results.render()[0]
|
18 |
|
19 |
-
|
20 |
inputs = [
|
21 |
-
gr.
|
22 |
-
gr.
|
23 |
]
|
24 |
|
25 |
outputs = [
|
26 |
-
gr.
|
27 |
|
28 |
]
|
29 |
|
@@ -44,9 +43,13 @@ Email: rrighart@googlemail.com
|
|
44 |
Web: <a href="https://www.rrighart.com">www.rrighart.com</a>
|
45 |
""",
|
46 |
article = "<p style='text-align: center'><a href='https://www.rrighart.com' target='_blank'>Webpage</a></p> <p style='text-align: center'><a href='https://www.kaggle.com/code/rrighart/detection-of-product-defects-using-yolov7' target='_blank'>Kaggle</a></p>",
|
47 |
-
examples=[['example1.JPG'
|
|
|
48 |
css=css,
|
49 |
-
cache_examples=
|
50 |
)
|
51 |
-
|
|
|
|
|
|
|
52 |
|
|
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
|
5 |
+
#############
|
6 |
|
7 |
def yolov7_inference(
|
8 |
+
image: gr.Image = None,
|
9 |
+
conf_threshold: gr.Slider = 0.20,
|
10 |
):
|
11 |
|
12 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
16 |
results = model([image], size=640)
|
17 |
return results.render()[0]
|
18 |
|
|
|
19 |
inputs = [
|
20 |
+
gr.Image(type="filepath", label="Input"),
|
21 |
+
gr.Slider(minimum=0.0, maximum=1.0, value=0.2, step=0.05, label="Confidence Threshold", interactive=True),
|
22 |
]
|
23 |
|
24 |
outputs = [
|
25 |
+
gr.Image(type="filepath"),
|
26 |
|
27 |
]
|
28 |
|
|
|
43 |
Web: <a href="https://www.rrighart.com">www.rrighart.com</a>
|
44 |
""",
|
45 |
article = "<p style='text-align: center'><a href='https://www.rrighart.com' target='_blank'>Webpage</a></p> <p style='text-align: center'><a href='https://www.kaggle.com/code/rrighart/detection-of-product-defects-using-yolov7' target='_blank'>Kaggle</a></p>",
|
46 |
+
examples = [['example1.JPG'], ['example2.JPG'], ['example3.JPG']],
|
47 |
+
#examples = [['example1.JPG', 0.50], ['example2.JPG', 0.50], ['example3.JPG', 0.50]],
|
48 |
css=css,
|
49 |
+
cache_examples=False,
|
50 |
)
|
51 |
+
|
52 |
+
demo_app.queue()
|
53 |
+
|
54 |
+
demo_app.launch(debug=False)
|
55 |
|
requirements.txt
CHANGED
@@ -1,151 +1,121 @@
|
|
1 |
-
absl-py==
|
2 |
-
aiofiles==
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
asttokens==2.2.1
|
9 |
-
astunparse==1.6.3
|
10 |
-
async-timeout==4.0.2
|
11 |
-
attrs==22.1.0
|
12 |
backcall==0.2.0
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
charset-normalizer==2.1.0
|
21 |
-
click==8.1.3
|
22 |
-
commonmark==0.9.1
|
23 |
-
config==0.5.1
|
24 |
-
cryptography==37.0.4
|
25 |
-
cv==1.0.0
|
26 |
-
cycler==0.11.0
|
27 |
decorator==5.1.1
|
28 |
-
|
29 |
-
executing==
|
30 |
-
fastapi==0.
|
31 |
-
ffmpy==0.3.
|
32 |
-
|
33 |
-
fonttools==4.
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
importlib-metadata==4.12.0
|
50 |
-
importlib-resources==5.9.0
|
51 |
-
inference==0.1
|
52 |
-
ipython==8.9.0
|
53 |
-
jedi==0.18.2
|
54 |
Jinja2==3.1.2
|
55 |
-
jsonschema==4.
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
markdown-it-py==2.1.0
|
63 |
-
MarkupSafe==2.1.1
|
64 |
-
matplotlib==3.5.3
|
65 |
matplotlib-inline==0.1.6
|
66 |
-
mdit-py-plugins==0.3.0
|
67 |
mdurl==0.1.2
|
68 |
-
|
69 |
-
|
70 |
-
numpy==1.23.
|
71 |
-
nvidia-cublas-
|
72 |
-
nvidia-cuda-
|
73 |
-
nvidia-cuda-
|
74 |
-
nvidia-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
parso==0.8.3
|
83 |
-
pexpect==4.
|
84 |
pickleshare==0.7.5
|
85 |
-
Pillow==
|
86 |
pkgutil-resolve-name==1.3.10
|
87 |
-
prompt-toolkit==3.0.
|
88 |
-
protobuf==
|
89 |
-
psutil==5.9.
|
90 |
ptyprocess==0.7.0
|
91 |
pure-eval==0.2.2
|
92 |
-
|
93 |
-
pyasn1==0.
|
94 |
-
|
95 |
-
|
96 |
-
pycryptodome==3.15.0
|
97 |
-
pydantic==1.9.1
|
98 |
-
pydeck==0.8.0b1
|
99 |
pydub==0.25.1
|
100 |
-
|
101 |
-
|
102 |
-
PyNaCl==1.5.0
|
103 |
-
pyparsing==3.0.9
|
104 |
-
pyrsistent==0.18.1
|
105 |
python-dateutil==2.8.2
|
106 |
-
python-multipart==0.0.
|
107 |
-
pytz==
|
108 |
-
|
109 |
-
|
110 |
-
requests==2.
|
111 |
requests-oauthlib==1.3.1
|
112 |
-
|
113 |
-
|
114 |
rsa==4.9
|
115 |
-
scipy==1.10.
|
116 |
-
seaborn==0.
|
117 |
-
|
|
|
118 |
six==1.16.0
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
tensorboard==
|
125 |
-
|
126 |
-
tensorboard-plugin-wit==1.8.1
|
127 |
-
tensorflow==2.9.1
|
128 |
-
tensorflow-estimator==2.9.0
|
129 |
-
tensorflow-io-gcs-filesystem==0.26.0
|
130 |
-
termcolor==1.1.0
|
131 |
-
toml==0.10.2
|
132 |
toolz==0.12.0
|
133 |
-
torch==1.
|
134 |
-
torchvision==0.
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
websockets==10.3
|
148 |
-
Werkzeug==2.2.2
|
149 |
-
wrapt==1.14.1
|
150 |
-
yarl==1.8.1
|
151 |
-
zipp==3.8.1
|
|
|
1 |
+
absl-py==2.0.0
|
2 |
+
aiofiles==23.2.1
|
3 |
+
altair==5.2.0
|
4 |
+
annotated-types==0.6.0
|
5 |
+
anyio==3.7.1
|
6 |
+
asttokens==2.4.1
|
7 |
+
attrs==23.1.0
|
|
|
|
|
|
|
|
|
8 |
backcall==0.2.0
|
9 |
+
cachetools==5.3.2
|
10 |
+
certifi==2023.11.17
|
11 |
+
charset-normalizer==3.3.2
|
12 |
+
click==8.1.7
|
13 |
+
colorama==0.4.6
|
14 |
+
contourpy==1.1.1
|
15 |
+
cycler==0.12.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
decorator==5.1.1
|
17 |
+
exceptiongroup==1.2.0
|
18 |
+
executing==2.0.1
|
19 |
+
fastapi==0.104.1
|
20 |
+
ffmpy==0.3.1
|
21 |
+
filelock==3.13.1
|
22 |
+
fonttools==4.46.0
|
23 |
+
fsspec==2023.12.1
|
24 |
+
google-auth==2.25.2
|
25 |
+
google-auth-oauthlib==1.0.0
|
26 |
+
gradio==4.8.0
|
27 |
+
gradio-client==0.7.1
|
28 |
+
grpcio==1.60.0
|
29 |
+
h11==0.14.0
|
30 |
+
httpcore==1.0.2
|
31 |
+
httpx==0.25.2
|
32 |
+
huggingface-hub==0.19.4
|
33 |
+
idna==3.6
|
34 |
+
importlib-metadata==7.0.0
|
35 |
+
importlib-resources==6.1.1
|
36 |
+
ipython==8.12.3
|
37 |
+
jedi==0.19.1
|
|
|
|
|
|
|
|
|
|
|
38 |
Jinja2==3.1.2
|
39 |
+
jsonschema==4.20.0
|
40 |
+
jsonschema-specifications==2023.11.2
|
41 |
+
kiwisolver==1.4.5
|
42 |
+
Markdown==3.5.1
|
43 |
+
markdown-it-py==3.0.0
|
44 |
+
MarkupSafe==2.1.3
|
45 |
+
matplotlib==3.7.4
|
|
|
|
|
|
|
46 |
matplotlib-inline==0.1.6
|
|
|
47 |
mdurl==0.1.2
|
48 |
+
mpmath==1.3.0
|
49 |
+
networkx==3.1
|
50 |
+
numpy==1.23.5
|
51 |
+
nvidia-cublas-cu12==12.1.3.1
|
52 |
+
nvidia-cuda-cupti-cu12==12.1.105
|
53 |
+
nvidia-cuda-nvrtc-cu12==12.1.105
|
54 |
+
nvidia-cuda-runtime-cu12==12.1.105
|
55 |
+
nvidia-cudnn-cu12==8.9.2.26
|
56 |
+
nvidia-cufft-cu12==11.0.2.54
|
57 |
+
nvidia-curand-cu12==10.3.2.106
|
58 |
+
nvidia-cusolver-cu12==11.4.5.107
|
59 |
+
nvidia-cusparse-cu12==12.1.0.106
|
60 |
+
nvidia-nccl-cu12==2.18.1
|
61 |
+
nvidia-nvjitlink-cu12==12.3.101
|
62 |
+
nvidia-nvtx-cu12==12.1.105
|
63 |
+
oauthlib==3.2.2
|
64 |
+
opencv-python==4.8.1.78
|
65 |
+
orjson==3.9.10
|
66 |
+
packaging==23.2
|
67 |
+
pandas==2.0.3
|
68 |
parso==0.8.3
|
69 |
+
pexpect==4.9.0
|
70 |
pickleshare==0.7.5
|
71 |
+
Pillow==10.1.0
|
72 |
pkgutil-resolve-name==1.3.10
|
73 |
+
prompt-toolkit==3.0.41
|
74 |
+
protobuf==4.21.2
|
75 |
+
psutil==5.9.6
|
76 |
ptyprocess==0.7.0
|
77 |
pure-eval==0.2.2
|
78 |
+
pyasn1==0.5.1
|
79 |
+
pyasn1-modules==0.3.0
|
80 |
+
pydantic==2.5.2
|
81 |
+
pydantic-core==2.14.5
|
|
|
|
|
|
|
82 |
pydub==0.25.1
|
83 |
+
pygments==2.17.2
|
84 |
+
pyparsing==3.1.1
|
|
|
|
|
|
|
85 |
python-dateutil==2.8.2
|
86 |
+
python-multipart==0.0.6
|
87 |
+
pytz==2023.3.post1
|
88 |
+
PyYAML==6.0.1
|
89 |
+
referencing==0.32.0
|
90 |
+
requests==2.31.0
|
91 |
requests-oauthlib==1.3.1
|
92 |
+
rich==13.7.0
|
93 |
+
rpds-py==0.13.2
|
94 |
rsa==4.9
|
95 |
+
scipy==1.10.1
|
96 |
+
seaborn==0.13.0
|
97 |
+
semantic-version==2.10.0
|
98 |
+
shellingham==1.5.4
|
99 |
six==1.16.0
|
100 |
+
sniffio==1.3.0
|
101 |
+
stack-data==0.6.3
|
102 |
+
starlette==0.27.0
|
103 |
+
sympy==1.12
|
104 |
+
tensorboard==2.14.0
|
105 |
+
tensorboard-data-server==0.7.2
|
106 |
+
tomlkit==0.12.0
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
toolz==0.12.0
|
108 |
+
torch==2.1.1
|
109 |
+
torchvision==0.16.1
|
110 |
+
tqdm==4.66.1
|
111 |
+
traitlets==5.14.0
|
112 |
+
triton==2.1.0
|
113 |
+
typer==0.9.0
|
114 |
+
typing-extensions==4.8.0
|
115 |
+
tzdata==2023.3
|
116 |
+
urllib3==2.1.0
|
117 |
+
uvicorn==0.24.0.post1
|
118 |
+
wcwidth==0.2.12
|
119 |
+
websockets==11.0.3
|
120 |
+
werkzeug==3.0.1
|
121 |
+
zipp==3.17.0
|
|
|
|
|
|
|
|
|
|