Computer Vision News - April 2018

Important note ! Since the maximum file size you can upload to Lambda is 50MB it’s important to limit the size of libraries to be installed as much as possible. Therefore, we’ll choose to install the opencv-python and not the opencv- contrib-python library, which includes many contrib libraries which are not necessary for us, making it exceed the 50MB limit. 3. Writing your code We’ll open a file named lambda_file.py and choose a very simple code -- the function handler_name which gets two parameters context and event -- this is the signature of the function to be run by AWS Lambda. This is tester code just for demonstration purposes. All it does is make sure the environment is properly set up and running. It starts by loading the Numpy and OpenCV libraries and printing their version number, then it reads an image file and prints out its size. You can see the simple code we wrote here: This is where you will put your proprietary unique code. Save the file in the folder site-packages , which is also where all of the software packages from the work-environment set-up section were installed. In our case they can all be found under ~/PycharmProjects/untitled/venv/lib/python3.6/site-packages 4. Uploading your code to the Lambda service Now that the environment and code are ready to go, we can deploy them onto AWS Lambda. 14 Tool Computer Vision News Computer Vision on Amazon Cloud

RkJQdWJsaXNoZXIy NTc3NzU=