After training your model with SmartML, you will need to use our Inference Service to visualize your model predictions.
The Inference Service allows users to run SmartML models on images and return visualizations or detections. The current version is available under sixgill/smartml-inference:1.1.0-cuda11.0
.
An example usage, assuming a SmartML output zip file is available as example-model.zip in the working directory:
docker container run --rm --gpus all --network="host" -e SMARTML_MODELS_DIR=/workspace/ \-v $PWD/example-model.zip:/workspace/example-model.zip \-it sixgill/smartml-inference:1.1.0-cuda11.0
More models can be made accessible by mounting them into the specified SMARTML_MODELS_DIR
. They can then be accessed using the name of the corresponding ZIP file, e.g. inference for the model model-x.zip
can be accessed under /model/model-x/inference
.
Endpoint | Request Format | Response Format |
| N/A | An interactive form for performing inference visualization. |
| N/A | A list of all available model JSON objects as returned by /models/<id>. |
| N/A | A JSON object with the following keys:
|
Performs inference on an image with the specified model and returns a list of Sense format detections. | Content-Type: multipart/form-data A single PNG or JPG file upload named image | A JSON object with the following keys:
|
Performs inference on an image with the specified model and returns a visualization of the detections. | Content-Type: multipart/form-data A single PNG or JPG file upload named image | A visualization as a PNG image. |
Loads the specified model into GPU memory. | Empty | "OK” |
Unloads the specified model from GPU memory. | Empty | “OK” |
On failure, all API endpoints will return a JSON object with an “error” key describing the error.
Endpoints requiring the use of GPU memory can fail if GPU memory is full. In this case, to reduce GPU memory usage:
Unused models could be unloaded.
Image sizes used for inference could be reduced.
Other processes using GPU memory on the same machine could be terminated.