robertknight / rten-ndarray-demo

Simple demo showing how to integrate image-rs, ndarray and rten for image classification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rten-ndarray-demo

This is an example showing how to integrate a few popular packages in order to perform simple ML inference using RTen.

  • image-rs is used to read images from JPEG or PNG sources
  • ndarray is used to prepare the input and post-process the output. You can use RTen's own tensor types for this purpose, but many users may be more familiar with ndarray.
  • serde_json is used to read label data

Usage

Clone this repository, then run:

$ cargo run -r -- mobilenet.rten cat.jpg
    Finished release [optimized] target(s) in 0.30s
     Running `target/release/rten-mobilenet mobilenet.rten cat.jpg`
Top class: tabby cat (score: 16.08712)

Credits

About

Simple demo showing how to integrate image-rs, ndarray and rten for image classification


Languages

Language:Rust 100.0%