Skip to content

orionr/models-2

 
 

Repository files navigation

ONNX Models

This is a repository for storing ONNX models.

Models

Usage

Every ONNX backend should support running these models out of the box. After dowloading and extracting the tarball of each model, there should be

  • A protobuf file model.pb which is the serialized ONNX model.
  • Several sets of sample inputs and outputs files (test_data_*.npz), they are numpy serialized archive.

e.g. they can be used like this:

import numpy as np
import onnx
import onnx_backend as backend

# Load the model and sample inputs and outputs
model = onnx.load(model_pb_path)
sample = np.load(npz_path, encoding='bytes')
inputs = list(sample['inputs'])
outputs = list(sample['outputs'])

# Run the model with an onnx backend and verify the results
np.testing.assert_almost_equal(outputs, backend.run_model(model, inputs))

License

MIT License

Releases

No releases published

Packages

No packages published