|
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | | - "This package provides convenience classes and functions for working with deepstack object detection API" |
| 7 | + "This package provides convenience classes and functions for working with deepstack object detection API. \n", |
| 8 | + "Pull the latest image for noavx:\n", |
| 9 | + "```\n", |
| 10 | + "docker pull deepquestai/deepstack:noavx\n", |
| 11 | + "```\n", |
| 12 | + "\n", |
| 13 | + "Run deepstack with:\n", |
| 14 | + "```\n", |
| 15 | + "docker run -e VISION-DETECTION=True -e VISION-FACE=True -e MODE=High -d \\\n", |
| 16 | + " -v localstorage:/datastore -p 5000:5000 \\\n", |
| 17 | + " -e API-KEY=\"Mysecretkey\" \\\n", |
| 18 | + " --name deepstack deepquestai/deepstack:noavx\n", |
| 19 | + "```\n", |
| 20 | + "\n", |
| 21 | + "Note that by default, the minimum confidence for detected objects is 0.45" |
8 | 22 | ] |
9 | 23 | }, |
10 | 24 | { |
|
22 | 36 | }, |
23 | 37 | { |
24 | 38 | "cell_type": "code", |
25 | | - "execution_count": 6, |
| 39 | + "execution_count": 2, |
26 | 40 | "metadata": {}, |
27 | 41 | "outputs": [], |
28 | 42 | "source": [ |
29 | 43 | "IP_ADDRESS = 'localhost'\n", |
30 | 44 | "PORT = '5000'\n", |
31 | 45 | "API_KEY = \"Mysecretkey\"\n", |
32 | | - "# API_KEY = \"BadKey\"\n", |
33 | 46 | "TIMEOUT = 8" |
34 | 47 | ] |
35 | 48 | }, |
36 | 49 | { |
37 | 50 | "cell_type": "code", |
38 | | - "execution_count": 7, |
| 51 | + "execution_count": 3, |
39 | 52 | "metadata": {}, |
40 | 53 | "outputs": [], |
41 | 54 | "source": [ |
|
44 | 57 | }, |
45 | 58 | { |
46 | 59 | "cell_type": "code", |
47 | | - "execution_count": 8, |
| 60 | + "execution_count": 4, |
48 | 61 | "metadata": {}, |
49 | 62 | "outputs": [ |
50 | 63 | { |
|
75 | 88 | }, |
76 | 89 | { |
77 | 90 | "cell_type": "code", |
78 | | - "execution_count": 9, |
| 91 | + "execution_count": 5, |
79 | 92 | "metadata": {}, |
80 | 93 | "outputs": [ |
81 | 94 | { |
|
104 | 117 | }, |
105 | 118 | { |
106 | 119 | "cell_type": "code", |
107 | | - "execution_count": 10, |
| 120 | + "execution_count": 6, |
108 | 121 | "metadata": {}, |
109 | 122 | "outputs": [ |
110 | 123 | { |
|
130 | 143 | " 'x_max': 825}]" |
131 | 144 | ] |
132 | 145 | }, |
133 | | - "execution_count": 10, |
| 146 | + "execution_count": 6, |
134 | 147 | "metadata": {}, |
135 | 148 | "output_type": "execute_result" |
136 | 149 | } |
|
149 | 162 | }, |
150 | 163 | { |
151 | 164 | "cell_type": "code", |
152 | | - "execution_count": 11, |
| 165 | + "execution_count": 7, |
153 | 166 | "metadata": {}, |
154 | 167 | "outputs": [], |
155 | 168 | "source": [ |
|
165 | 178 | }, |
166 | 179 | { |
167 | 180 | "cell_type": "code", |
168 | | - "execution_count": 12, |
| 181 | + "execution_count": 8, |
169 | 182 | "metadata": {}, |
170 | 183 | "outputs": [ |
171 | 184 | { |
172 | 185 | "data": { |
173 | 186 | "text/plain": [ |
174 | | - "{'dog', 'person'}" |
| 187 | + "['person', 'dog']" |
175 | 188 | ] |
176 | 189 | }, |
177 | | - "execution_count": 12, |
| 190 | + "execution_count": 8, |
178 | 191 | "metadata": {}, |
179 | 192 | "output_type": "execute_result" |
180 | 193 | } |
|
187 | 200 | "cell_type": "markdown", |
188 | 201 | "metadata": {}, |
189 | 202 | "source": [ |
190 | | - "Get a summary of the number of occurances of labels, and confidence level" |
| 203 | + "Get a summary of the number of occurances of labels" |
191 | 204 | ] |
192 | 205 | }, |
193 | 206 | { |
194 | 207 | "cell_type": "code", |
195 | | - "execution_count": 13, |
| 208 | + "execution_count": 9, |
196 | 209 | "metadata": {}, |
197 | 210 | "outputs": [ |
198 | 211 | { |
|
201 | 214 | "{'person': 2, 'dog': 1}" |
202 | 215 | ] |
203 | 216 | }, |
204 | | - "execution_count": 13, |
| 217 | + "execution_count": 9, |
| 218 | + "metadata": {}, |
| 219 | + "output_type": "execute_result" |
| 220 | + } |
| 221 | + ], |
| 222 | + "source": [ |
| 223 | + "summary = ds.get_objects_summary(dsobject.predictions)\n", |
| 224 | + "summary" |
| 225 | + ] |
| 226 | + }, |
| 227 | + { |
| 228 | + "cell_type": "code", |
| 229 | + "execution_count": 10, |
| 230 | + "metadata": {}, |
| 231 | + "outputs": [ |
| 232 | + { |
| 233 | + "data": { |
| 234 | + "text/plain": [ |
| 235 | + "['person', 'dog']" |
| 236 | + ] |
| 237 | + }, |
| 238 | + "execution_count": 10, |
205 | 239 | "metadata": {}, |
206 | 240 | "output_type": "execute_result" |
207 | 241 | } |
208 | 242 | ], |
209 | 243 | "source": [ |
210 | | - "ds.get_objects_summary(dsobject.predictions)" |
| 244 | + "list(summary.keys())" |
211 | 245 | ] |
212 | 246 | }, |
213 | 247 | { |
|
219 | 253 | }, |
220 | 254 | { |
221 | 255 | "cell_type": "code", |
222 | | - "execution_count": 14, |
| 256 | + "execution_count": 11, |
223 | 257 | "metadata": {}, |
224 | 258 | "outputs": [ |
225 | 259 | { |
|
228 | 262 | "[0.9998661, 0.9996547]" |
229 | 263 | ] |
230 | 264 | }, |
231 | | - "execution_count": 14, |
| 265 | + "execution_count": 11, |
232 | 266 | "metadata": {}, |
233 | 267 | "output_type": "execute_result" |
234 | 268 | } |
|
247 | 281 | }, |
248 | 282 | { |
249 | 283 | "cell_type": "code", |
250 | | - "execution_count": 15, |
| 284 | + "execution_count": null, |
251 | 285 | "metadata": {}, |
252 | | - "outputs": [ |
253 | | - { |
254 | | - "name": "stdout", |
255 | | - "output_type": "stream", |
256 | | - "text": [ |
257 | | - "1\n" |
258 | | - ] |
259 | | - } |
260 | | - ], |
| 286 | + "outputs": [], |
261 | 287 | "source": [ |
262 | 288 | "CONFIDENCE_THRESHOLD = 0.9997\n", |
263 | 289 | "print(len(ds.get_confidences_above_threshold(confidences, CONFIDENCE_THRESHOLD)))" |
|
0 commit comments