rrighart commited on
Commit
4cab89e
1 Parent(s): 32b4350

edits app + req

Browse files
Files changed (2) hide show
  1. app.py +13 -10
  2. 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.inputs.Image = None,
9
- conf_threshold: gr.inputs.Slider = 0.50,
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.inputs.Image(shape=(640, 480), type="pil", label="Input Image"),
22
- gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.50, step=0.05, label="Confidence Threshold"),
23
  ]
24
 
25
  outputs = [
26
- gr.outputs.Image(type="filepath").style(height=400, width=400),
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', 0.50], ['example2.JPG', 0.50], ['example3.JPG', 0.50]],
 
48
  css=css,
49
- cache_examples=True,
50
  )
51
- demo_app.launch(debug=False, enable_queue=True)
 
 
 
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==1.2.0
2
- aiofiles==22.1.0
3
- aiohttp==3.8.1
4
- aiosignal==1.2.0
5
- altair==4.2.0
6
- analytics-python==1.4.0
7
- anyio==3.6.1
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
- backoff==1.10.0
14
- backports.zoneinfo==0.2.1
15
- bcrypt==4.0.0
16
- blinker==1.5
17
- cachetools==5.2.0
18
- certifi==2022.6.15
19
- cffi==1.15.1
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
- entrypoints==0.4
29
- executing==1.2.0
30
- fastapi==0.79.0
31
- ffmpy==0.3.0
32
- flatbuffers==1.12
33
- fonttools==4.37.1
34
- frozenlist==1.3.1
35
- fsspec==2022.8.2
36
- gast==0.4.0
37
- gitdb==4.0.9
38
- GitPython==3.1.27
39
- google-auth==2.10.0
40
- google-auth-oauthlib==0.4.6
41
- google-pasta==0.2.0
42
- gradio==3.17.0
43
- grpcio==1.47.0
44
- h11==0.12.0
45
- h5py==3.7.0
46
- httpcore==0.15.0
47
- httpx==0.23.0
48
- idna==3.3
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.14.0
56
- keras==2.9.0
57
- Keras-Preprocessing==1.1.2
58
- kiwisolver==1.4.4
59
- libclang==14.0.6
60
- linkify-it-py==1.0.3
61
- Markdown==3.4.1
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
- monotonic==1.6
69
- multidict==6.0.2
70
- numpy==1.23.1
71
- nvidia-cublas-cu11==11.10.3.66
72
- nvidia-cuda-nvrtc-cu11==11.7.99
73
- nvidia-cuda-runtime-cu11==11.7.99
74
- nvidia-cudnn-cu11==8.5.0.96
75
- oauthlib==3.2.0
76
- opencv-python==4.6.0.66
77
- opt-einsum==3.3.0
78
- orjson==3.8.0
79
- packaging==21.3
80
- pandas==1.4.3
81
- paramiko==2.11.0
 
 
 
 
 
 
82
  parso==0.8.3
83
- pexpect==4.8.0
84
  pickleshare==0.7.5
85
- Pillow==9.2.0
86
  pkgutil-resolve-name==1.3.10
87
- prompt-toolkit==3.0.36
88
- protobuf==3.19.4
89
- psutil==5.9.4
90
  ptyprocess==0.7.0
91
  pure-eval==0.2.2
92
- pyarrow==9.0.0
93
- pyasn1==0.4.8
94
- pyasn1-modules==0.2.8
95
- pycparser==2.21
96
- pycryptodome==3.15.0
97
- pydantic==1.9.1
98
- pydeck==0.8.0b1
99
  pydub==0.25.1
100
- Pygments==2.13.0
101
- Pympler==1.0.1
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.5
107
- pytz==2022.2.1
108
- pytz-deprecation-shim==0.1.0.post0
109
- PyYAML==6.0
110
- requests==2.28.1
111
  requests-oauthlib==1.3.1
112
- rfc3986==1.5.0
113
- rich==12.5.1
114
  rsa==4.9
115
- scipy==1.10.0
116
- seaborn==0.12.2
117
- semver==2.13.0
 
118
  six==1.16.0
119
- smmap==5.0.0
120
- sniffio==1.2.0
121
- stack-data==0.6.2
122
- starlette==0.19.1
123
- streamlit==1.12.2
124
- tensorboard==2.9.1
125
- tensorboard-data-server==0.6.1
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.13.1
134
- torchvision==0.14.1
135
- tornado==6.2
136
- tqdm==4.64.1
137
- traitlets==5.9.0
138
- typing-extensions==4.3.0
139
- tzdata==2022.2
140
- tzlocal==4.2
141
- uc-micro-py==1.0.1
142
- urllib3==1.26.11
143
- uvicorn==0.18.2
144
- validators==0.20.0
145
- watchdog==2.1.9
146
- wcwidth==0.2.6
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