Created
March 30, 2020 08:58
-
-
Save setuc/38cafb857a4ba672773edaae665265c6 to your computer and use it in GitHub Desktop.
Azure Functions replacement __init__ for custom vision
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import json | |
| import azure.functions as func | |
| from .predict import predict_url, log_msg | |
| def main(req: func.HttpRequest) -> func.HttpResponse: | |
| image_url = req.params.get('img') | |
| logging.info('Image URL received: ' + image_url) | |
| results = predict_url(image_url) | |
| headers = { | |
| "Content-type": "application/json", | |
| "Access-Control-Allow-Origin": "*" | |
| } | |
| return func.HttpResponse(json.dumps(results), headers = headers) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your requirements file will look like this