https://github.com/k2-gc/onnxruntime-cpp-example
Simple onnxruntime example using C++ API. Inferring MNIST dataset samples and show results.
https://github.com/k2-gc/onnxruntime-cpp-example
c classification cnn cnn-classification cpp onnx onnxruntime
Last synced: 3 months ago
JSON representation
Simple onnxruntime example using C++ API. Inferring MNIST dataset samples and show results.
- Host: GitHub
- URL: https://github.com/k2-gc/onnxruntime-cpp-example
- Owner: k2-gc
- Created: 2023-12-03T14:55:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-09T06:47:19.000Z (over 1 year ago)
- Last Synced: 2025-01-11T21:29:26.113Z (5 months ago)
- Topics: c, classification, cnn, cnn-classification, cpp, onnx, onnxruntime
- Language: C++
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# onnxruntime-cpp-example
## Introduction
This repository introduces how to run onnx model using onnxruntime C++ API.
Using sample MNIST data, the code shows a simple example and inference results.**NOTICE:** If you are a beginner in Deep Learning for image processing doamin, [my another repository](https://github.com/k2-gc/Simple-CNN-Example) may help you to understand how to train models of image classification with Pytorch.
## Prerequisites
* Docker
* Docker compose## Usage
1. Clone this repository
2. Run commands below and get into docker container
```bash
cd onnxruntime-cpp-example
docker compose up -d
docker exec -it onnxruntime-sample /bin/bash
```
5. In docker container, build sample app and run.
```bash
mkdir build && cd build
wget https://github.com/k2-gc/Simple-CNN-Example/releases/download/v0.1/best.onnx
cmake ..
make -j$(nproc)
./sample_app
```