目录

ONNX Model Inference with Rust

This Rust program demonstrates how to perform inference using an ONNX model for text classification.

Prerequisites

Make sure you have Rust installed on your machine. You can install it by following the instructions on the official Rust website.

Getting Started

  1. Clone the repository:

    git clone https://github.com/AlaneLiang/ONNX-Model-Inference-with-Rust.git
  2. Change into the project directory:

    cd ONNX-Model-Inference-with-Rust
    
  3. Build and run the program:

    cargo run

Usage

You can modify the dict.json file with your own word-to-index mapping and replace the model.onnx file with your trained ONNX model. And you need to change the input vector shape according to your model input size.

Folder Structure

  • src: Contains the Rust source code files.
  • dict.json: JSON file containing the word-to-index mapping.
  • model.onnx: ONNX model file for text classification.

Acknowledgments

License

This project is licensed under the MIT License - see the LICENSE file for details.

关于
1.7 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号