Your model is a collection of files that other programs can load to run predictions.
These files store both the structure of your model and the weights that are a result of training.
You can use the model files locally in your app or in most major cloud platforms to create an API.
Lobe also hosts your model as a local API to help kickstart your app development.
We are continually expanding the ways you can use your model. Current recommendations:
Local Python app or hosted on Azure, Google Cloud, or AWS
Export your model as a TensorFlow 1.15 SavedModel.
TensorFlow’s SavedModel is the standard format used in Python applications running TensorFlow 1.x, and can be deployed
in TensorFlow web services to run inference on the cloud as an API.
Apple iOS
Export your model as Core ML to develop iOS, iPad, and Mac apps.
Android or Raspberry Pi
Export your model as TensorFlow Lite to be used for mobile and IoT applications.
ONNX
Export your model as ONNX for cross-compatible applications, including edge devices.
Web Applications
Export your model as TensorFlow.js for browser-based web or server-side Node applications.
Local API
Lobe will host a local API to call your model via a REST endpoint. Use this option to mock a service that runs predictions
while developing your app.
To run the local API:
Capture an input image as a base64 string.
Make sure the base64 string doesn't include the 'data:image/jpeg;base64,' prefix that sometimes is added.
Do a POST request to the locally hosted API for your project with the details from the export sheet. Here is an example of what to request:
POST http://localhost:38100/predict/project-uuid-from-export-window
When you export a model, the exported folder contains example code to use your model:
example/ directory: Lobe provides an example with a readme on how to load and run your model in the chosen export format.
signature.json file: the signature contains information about your model that your app will generally have to provide when
loading the model. This includes details about the exposed inputs and outputs, their data types and shapes, and the
labels corresponding to predicted confidence outputs. See the example/ directory for code on how to load and use the signature.