Note: This document is compatible with aid v1.0 and higher only.
Prepare Your Model Locally
Your package is firstly a Python Package. Therefore, it will look like:
You can create the following structure by running the command
aid new . It will promopt you to enter your package information, like below:
Solver is a
class extended from
aid.Solver class. In this class, you need to implement 2 functions:
infer. As their literal meanings, in the
init function, parameters in your package should be initiate, and in the
infer function, a image file path will be passed in the parameter, and the
infer function is supposed to return your result in a dict or list.
For example, a simple solver frame will look like
aid.toml is the entry file where aid will look for your solvers. It uses toml syntax and should looks like the following format:
Make sure this file is located at the root path of your project.
In most occasions, your algorithms (or neural networks etc.) should be uploaded along with some pre-trained models. We encourage you to upload it with our CLI (Not Done yet. #72), but it is also allowed if you want upload it another downloadable services, especially when it is extremely large.
You need to define your pre-trained models in
pretrained.toml file as following using toml syntax:
Make sure this file is located at the root path of your project. AID will automatically download the file when install packages.
Publish to GitHub
We encourage you to upload your package to GitHub repositories, as long as you want it to be open sourced.