Repository containing the code for the ONNX 101 tutorial at the PyData Skopje - November 2023 Meetup
- Example for training a simple classifier using PyTorch for digit recognition on the MNIST dataset and exporting the model to ONNX.
- Using the ONNX model with ONNX runtime for inference with a simple Express.js server. ort-web-api
Pre-requisites:
Prepare the environment
poetry shell
poetry installObtain the dataset and train the model
python -m onnx_workshop.mnistInference with ONNX runtime
python -m onnx_workshop.inferencePre-requisites:
Start the server
cd ort-web-api
npm install
node index.jsMake a request
curl --request POST \
--url http://localhost:3000/classify-digit \
--header 'Content-Type: multipart/form-data' \
--form digit=examples/3.png