"### Querying an Azure Custom Vision endpoint from Python\n",
"\n",
"This is the companion notebook to the talk on [Azure Custom Vison for Beginners](https://www.youtube.com/watch?v=OzMRNVolrKE&lc=UgwYIaTgEIkRtacBGI54AaABAg) hosted by [Data Science Dojo](https://datasciencedojo.com/) and delivered by [Usman Shahid](https://www.linkedin.com/in/shahidusmanm/)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import functions as fn\n",
"import nest_asyncio\n",
"nest_asyncio.apply()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#These have already been imported in functions.py. Re-imported them here to show during the webinar.\n",
"\n",
"# Other libraries used\n",
"import os\n",
"\n",
"# for converting the frames into bytes\n",
"import cv2 \n",
"\n",
"# and for processing arrays \n",
"import numpy as np\n",
"\n",
"# for encoding and decoding Custom Vision predictions \n",
"import json\n",
"\n",
"# for converting the Custom Vision predictions to dataframe \n",
"import pandas as pd\n",
"\n",
"# import async packages\n",
"import asyncio\n",
"import aiohttp\n",
"\n",
"# for file name pattern matching \n",
"import fnmatch \n",
"\n",
"# for displaying images from the processes output video \n",
"import matplotlib.pyplot as plt\n",
"\n",
"# importing other required libraries\n",
"import random\n",
"import textwrap\n",
"import datetime \n",
"from PIL import Image\n",
"import time "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#These have already been declared in functions.py. Declared them here to show during the webinar.\n",
"\n",
"# web service end-point for the Custom Vision model \n",
"# we will process video frames (which are images) \n",