|
23 | 23 | }, |
24 | 24 | { |
25 | 25 | "cell_type": "code", |
26 | | - "execution_count": 1, |
| 26 | + "execution_count": null, |
27 | 27 | "id": "authentic-necessity", |
28 | 28 | "metadata": {}, |
29 | 29 | "outputs": [], |
|
38 | 38 | }, |
39 | 39 | { |
40 | 40 | "cell_type": "code", |
41 | | - "execution_count": 2, |
| 41 | + "execution_count": null, |
42 | 42 | "id": "responsible-clinton", |
43 | 43 | "metadata": {}, |
44 | 44 | "outputs": [], |
|
58 | 58 | }, |
59 | 59 | { |
60 | 60 | "cell_type": "code", |
61 | | - "execution_count": 3, |
| 61 | + "execution_count": null, |
62 | 62 | "id": "foreign-theorem", |
63 | 63 | "metadata": {}, |
64 | 64 | "outputs": [], |
|
82 | 82 | }, |
83 | 83 | { |
84 | 84 | "cell_type": "code", |
85 | | - "execution_count": 4, |
| 85 | + "execution_count": null, |
86 | 86 | "id": "satellite-impossible", |
87 | 87 | "metadata": {}, |
88 | 88 | "outputs": [], |
89 | 89 | "source": [ |
90 | 90 | "# Set this to a project that you want to use for the webhook\n", |
91 | | - "PROJECT_ID = \"ckm4xyfncfgja0760vpfdxoro\"\n", |
| 91 | + "PROJECT_ID = \"\"\n", |
92 | 92 | "# Only update this if you have an on-prem deployment\n", |
93 | 93 | "ENDPOINT = \"https://api.labelbox.com/graphql\"" |
94 | 94 | ] |
95 | 95 | }, |
96 | 96 | { |
97 | 97 | "cell_type": "code", |
98 | | - "execution_count": 5, |
| 98 | + "execution_count": null, |
99 | 99 | "id": "clean-ireland", |
100 | 100 | "metadata": {}, |
101 | 101 | "outputs": [], |
|
105 | 105 | }, |
106 | 106 | { |
107 | 107 | "cell_type": "code", |
108 | | - "execution_count": 6, |
| 108 | + "execution_count": null, |
109 | 109 | "id": "bacterial-cheat", |
110 | 110 | "metadata": {}, |
111 | 111 | "outputs": [], |
|
132 | 132 | }, |
133 | 133 | { |
134 | 134 | "cell_type": "code", |
135 | | - "execution_count": 7, |
| 135 | + "execution_count": null, |
136 | 136 | "id": "aboriginal-antibody", |
137 | 137 | "metadata": {}, |
138 | | - "outputs": [ |
139 | | - { |
140 | | - "data": { |
141 | | - "text/plain": [ |
142 | | - "0" |
143 | | - ] |
144 | | - }, |
145 | | - "execution_count": 6, |
146 | | - "metadata": {}, |
147 | | - "output_type": "execute_result" |
148 | | - } |
149 | | - ], |
| 138 | + "outputs": [], |
150 | 139 | "source": [ |
151 | 140 | "if not COLAB:\n", |
152 | 141 | " os.system(f\"ngrok http {WH_PORT} &\")" |
|
162 | 151 | }, |
163 | 152 | { |
164 | 153 | "cell_type": "code", |
165 | | - "execution_count": 8, |
| 154 | + "execution_count": null, |
166 | 155 | "id": "stable-group", |
167 | 156 | "metadata": {}, |
168 | 157 | "outputs": [], |
|
173 | 162 | }, |
174 | 163 | { |
175 | 164 | "cell_type": "code", |
176 | | - "execution_count": 9, |
| 165 | + "execution_count": null, |
177 | 166 | "id": "limiting-variety", |
178 | 167 | "metadata": {}, |
179 | 168 | "outputs": [], |
|
219 | 208 | }, |
220 | 209 | { |
221 | 210 | "cell_type": "code", |
222 | | - "execution_count": 10, |
| 211 | + "execution_count": null, |
223 | 212 | "id": "delayed-convention", |
224 | 213 | "metadata": {}, |
225 | | - "outputs": [ |
226 | | - { |
227 | | - "name": "stderr", |
228 | | - "output_type": "stream", |
229 | | - "text": [ |
230 | | - " * Running on http://0.0.0.0:3001/ (Press CTRL+C to quit)\n", |
231 | | - "127.0.0.1 - - [29/Mar/2021 16:54:32] \"\u001b[37mGET / HTTP/1.1\u001b[0m\" 200 -\n" |
232 | | - ] |
233 | | - }, |
234 | | - { |
235 | | - "name": "stdout", |
236 | | - "output_type": "stream", |
237 | | - "text": [ |
238 | | - "Hello, World!\n" |
239 | | - ] |
240 | | - } |
241 | | - ], |
| 214 | + "outputs": [], |
242 | 215 | "source": [ |
243 | 216 | "print(requests.get(\"http://localhost:3001\").text)" |
244 | 217 | ] |
|
262 | 235 | }, |
263 | 236 | { |
264 | 237 | "cell_type": "code", |
265 | | - "execution_count": 11, |
| 238 | + "execution_count": null, |
266 | 239 | "id": "biblical-scottish", |
267 | 240 | "metadata": {}, |
268 | 241 | "outputs": [], |
|
284 | 257 | }, |
285 | 258 | { |
286 | 259 | "cell_type": "code", |
287 | | - "execution_count": 12, |
| 260 | + "execution_count": null, |
288 | 261 | "id": "raising-preservation", |
289 | 262 | "metadata": {}, |
290 | 263 | "outputs": [], |
|
301 | 274 | }, |
302 | 275 | { |
303 | 276 | "cell_type": "code", |
304 | | - "execution_count": 13, |
| 277 | + "execution_count": null, |
305 | 278 | "id": "approximate-gothic", |
306 | 279 | "metadata": {}, |
307 | | - "outputs": [ |
308 | | - { |
309 | | - "name": "stdout", |
310 | | - "output_type": "stream", |
311 | | - "text": [ |
312 | | - "https://app.labelbox.com/projects/ckm4xyfncfgja0760vpfdxoro\n" |
313 | | - ] |
314 | | - } |
315 | | - ], |
| 280 | + "outputs": [], |
316 | 281 | "source": [ |
317 | 282 | "# Ok so we should be configured assuming everything is setup correctly.\n", |
318 | 283 | "# Go to the following url and make a new label to see if it works\n", |
|
321 | 286 | }, |
322 | 287 | { |
323 | 288 | "cell_type": "code", |
324 | | - "execution_count": 14, |
| 289 | + "execution_count": null, |
325 | 290 | "id": "worst-material", |
326 | 291 | "metadata": {}, |
327 | 292 | "outputs": [], |
|
339 | 304 | }, |
340 | 305 | { |
341 | 306 | "cell_type": "code", |
342 | | - "execution_count": 15, |
| 307 | + "execution_count": null, |
343 | 308 | "id": "stopped-steel", |
344 | 309 | "metadata": {}, |
345 | | - "outputs": [ |
346 | | - { |
347 | | - "name": "stdout", |
348 | | - "output_type": "stream", |
349 | | - "text": [ |
350 | | - "https://eb3e7f8eb089.ngrok.io/webhook-endpoint\n" |
351 | | - ] |
352 | | - }, |
353 | | - { |
354 | | - "name": "stderr", |
355 | | - "output_type": "stream", |
356 | | - "text": [ |
357 | | - "127.0.0.1 - - [17/Mar/2021 09:52:00] \"\u001b[37mPOST /webhook-endpoint HTTP/1.1\u001b[0m\" 200 -\n" |
358 | | - ] |
359 | | - }, |
360 | | - { |
361 | | - "name": "stdout", |
362 | | - "output_type": "stream", |
363 | | - "text": [ |
364 | | - "=========== New Webhook Delivery ============\n", |
365 | | - "Delivery ID: ckmdi74ew57lq063553kuzekq\n", |
366 | | - "Event: LABEL_UPDATED\n", |
367 | | - "Payload: {\n", |
368 | | - " \"id\": \"ckmb8h50t008f3h683tugqsap\",\n", |
369 | | - " \"createdAt\": \"2021-03-15T23:44:18Z\",\n", |
370 | | - " \"updatedAt\": \"2021-03-17T13:51:59Z\",\n", |
371 | | - " \"secondsToLabel\": 79.173,\n", |
372 | | - " \"label\": \"{\\\"objects\\\":[{\\\"featureId\\\":\\\"ckmb8gvd9008b3h68l5tcmrt1\\\",\\\"schemaId\\\":\\\"ckm3se1a5010y0y6rcdc0bvvl\\\",\\\"title\\\":\\\"animal\\\",\\\"value\\\":\\\"animal\\\",\\\"color\\\":\\\"#1CE6FF\\\",\\\"bbox\\\":{\\\"top\\\":325,\\\"left\\\":233,\\\"height\\\":266,\\\"width\\\":413},\\\"instanceURI\\\":\\\"https://api.labelbox.com/masks/feature/ckmb8gvd9008b3h68l5tcmrt1\\\"},{\\\"featureId\\\":\\\"ckmbdp94300013h68y14zluto\\\",\\\"schemaId\\\":\\\"ckmbdol5s1ybk0y96fje86ktu\\\",\\\"title\\\":\\\"human\\\",\\\"value\\\":\\\"human\\\",\\\"color\\\":\\\"#FF34FF\\\",\\\"bbox\\\":{\\\"top\\\":75,\\\"left\\\":527,\\\"height\\\":453,\\\"width\\\":155},\\\"instanceURI\\\":\\\"https://api.labelbox.com/masks/feature/ckmbdp94300013h68y14zluto\\\"},{\\\"featureId\\\":\\\"ckmbdpdda00043h688pqrsoku\\\",\\\"schemaId\\\":\\\"ckmbdol5s1ybk0y96fje86ktu\\\",\\\"title\\\":\\\"human\\\",\\\"value\\\":\\\"human\\\",\\\"color\\\":\\\"#FF34FF\\\",\\\"bbox\\\":{\\\"top\\\":81,\\\"left\\\":666,\\\"height\\\":396,\\\"width\\\":134},\\\"instanceURI\\\":\\\"https://api.labelbox.com/masks/feature/ckmbdpdda00043h688pqrsoku\\\"},{\\\"featureId\\\":\\\"ckmbdpgd200073h68cu3vhjf2\\\",\\\"schemaId\\\":\\\"ckmbdol5s1ybk0y96fje86ktu\\\",\\\"title\\\":\\\"human\\\",\\\"value\\\":\\\"human\\\",\\\"color\\\":\\\"#FF34FF\\\",\\\"bbox\\\":{\\\"top\\\":0,\\\"left\\\":722,\\\"height\\\":535,\\\"width\\\":259},\\\"instanceURI\\\":\\\"https://api.labelbox.com/masks/feature/ckmbdpgd200073h68cu3vhjf2\\\"},{\\\"featureId\\\":\\\"ckmdi72l700043g68i52bq31i\\\",\\\"schemaId\\\":\\\"ckm3se1a5010y0y6rcdc0bvvl\\\",\\\"title\\\":\\\"animal\\\",\\\"value\\\":\\\"animal\\\",\\\"color\\\":\\\"#1CE6FF\\\",\\\"bbox\\\":{\\\"top\\\":94,\\\"left\\\":65,\\\"height\\\":104,\\\"width\\\":67},\\\"instanceURI\\\":\\\"https://api.labelbox.com/masks/feature/ckmdi72l700043g68i52bq31i\\\"}],\\\"classifications\\\":[{\\\"featureId\\\":\\\"ckmb8h0t7008e3h68hhmuf3y4\\\",\\\"schemaId\\\":\\\"ckm3se1a4010w0y6rd579gyl3\\\",\\\"title\\\":\\\"image\\\",\\\"value\\\":\\\"image\\\",\\\"answers\\\":[{\\\"featureId\\\":\\\"ckmb8h0t6008d3h689yq6cnm6\\\",\\\"schemaId\\\":\\\"ckm3se1aw01120y6r7zkcd93v\\\",\\\"title\\\":\\\"contains_human\\\",\\\"value\\\":\\\"contains_human\\\"}]}]}\",\n", |
373 | | - " \"agreement\": null,\n", |
374 | | - " \"benchmarkAgreement\": null,\n", |
375 | | - " \"deleted\": false,\n", |
376 | | - " \"project\": {\n", |
377 | | - " \"id\": \"ckm4xyfncfgja0760vpfdxoro\",\n", |
378 | | - " \"createdAt\": \"2021-03-11T14:03:12Z\",\n", |
379 | | - " \"updatedAt\": \"2021-03-11T18:22:08.523Z\",\n", |
380 | | - " \"name\": \"animal_demo_proj\",\n", |
381 | | - " \"description\": \"\",\n", |
382 | | - " \"deleted\": false\n", |
383 | | - " },\n", |
384 | | - " \"dataRow\": {\n", |
385 | | - " \"id\": \"ckm4y6s5a1s7e0rb6bgf00oqa\",\n", |
386 | | - " \"createdAt\": \"2021-03-11T14:09:41Z\",\n", |
387 | | - " \"updatedAt\": \"2021-03-11T14:09:41Z\",\n", |
388 | | - " \"deletedAt\": null,\n", |
389 | | - " \"externalId\": \"uploaded_images/177.jpg\",\n", |
390 | | - " \"rowData\": \"https://storage.labelbox.com/ckk4q1vgapsau07324awnsjq2%2F7b7f4198-3ea4-68db-9bf7-01dfd0bf3e8c-177.jpg?Expires=1617198719&KeyName=labelbox-assets-key-1&Signature=9mjtUoc61rooqsI8I2unQNU4N-o=\"\n", |
391 | | - " },\n", |
392 | | - " \"dataset\": {\n", |
393 | | - " \"id\": \"ckm4xyfua04cf0z7a3wz58kgj\",\n", |
394 | | - " \"createdAt\": \"2021-03-11T14:03:12Z\",\n", |
395 | | - " \"updatedAt\": \"2021-03-11T14:03:12Z\",\n", |
396 | | - " \"name\": \"animal_demo_ds\",\n", |
397 | | - " \"description\": \"\",\n", |
398 | | - " \"deleted\": false\n", |
399 | | - " },\n", |
400 | | - " \"user\": {\n", |
401 | | - " \"id\": \"ckm570mgm7q880795an0rfzmz\",\n", |
402 | | - " \"email\": \"amanda+1@labelbox.com\"\n", |
403 | | - " }\n", |
404 | | - "}\n" |
405 | | - ] |
406 | | - } |
407 | | - ], |
| 310 | + "outputs": [], |
408 | 311 | "source": [ |
409 | 312 | "# url, topics, and status can all be updated\n", |
410 | 313 | "updated_url = f\"{public_url}/webhook-endpoint\"\n", |
|
425 | 328 | }, |
426 | 329 | { |
427 | 330 | "cell_type": "code", |
428 | | - "execution_count": 16, |
| 331 | + "execution_count": null, |
429 | 332 | "id": "distant-commitment", |
430 | 333 | "metadata": {}, |
431 | 334 | "outputs": [], |
|
0 commit comments