Skip to content

okajax/onnx-runtime-azure-functions-example

Repository files navigation

ONNX Runtime on Azure Functions Example

ONNX with Severless is so sool 😎

See also my article[Japanese]

1. Requirements

  • Python 3.6
  • pipenv
  • Azure Blob Storage (for ONNX Model, Labels dictonary JSON)

Files

2. Set an environment variable

For local development

$ cp local.setting.example.json local.setting.json

And, set a connect string for your Blob Storage account.

    "Values": {
      "BLOB_CONNECTION_STRING": "<your_connect_string>"
    }

For cloud

Edit settings on Azure.

3. Replace codes for your project

HttpTrigger/init.py

        container_client = blob_service_client.get_container_client('<your_container>') 

Pipfile

deploy = "func azure functionapp publish <your_project> --python"

4. Run 🚀

$ pipenv install  # if you hav trouble, just do it. $ pipenv --three --python=`which python3`
$ pipenv run start

POST a image to endpoint 👍

5. Deploy to cloud ⚡

$ pipenv run deploy

About

ONNX Runtime on Azure Functions ⚡

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages