Labs that explain complex ML/AI ideas simply with code.
Using Azure custom vision and cognitive service, we are training a model to detect boxes, once a box is detected it will notify the user along with an image showing where the box is.
- Install all the required modules from requirements.txt
pip install -r requirements.txt
- Add all the following required variables in a .env file
CONNECTION_STRING = Storage connection string from Azure storage
SOURCE = 'usb' or path to any .mp4 file
TIME_DELAY = Specifies frame capture interval in seconds
MANUAL_MODE = Set 0 for auto and 1 for manual mode
PREDICTION_KEY = Azure cognitive service key
TRAINING_KEY = Azure cognitive service key here as well
PROJECT_ID = Custom vision project id
TWILIO_ACCOUNT_SID = Account SID from twilio
TWILIO_AUTH_TOKEN = Auth Toekn from twilio
TWILIO_PHONE_NUMBER = Twilio phone number
ACCOUNT_NAME = Azure account name
BLOB_ACCOUNT_KEY = Storage account key
ENDPOINT_CUSTOM_VISION = Azure custom vision endpoint
SERPAPI_API_KEY = Serpapi API key for scraping tool.
- The source can be direct video stream from a camera(USB), or from a .mp4 file.
- Time delay sets the time threshold to capture frames from the video.
- You can choose from two modes, manual(1) or auto(0).
- Finally,
py edge_to_blob.py
If you wish to train the model with your own data you can use the provided scraper which uses a third party service Serpapi
to download HD images from the inrernet. Refer this readme to know how to set up and run the provided scraper. serpapi readme link here
You can also train the Model using Azure custom vision and cognitive service. Follow these steps to train the ML model.
Follow this how to guide here: