上QQ阅读APP看书,第一时间看更新
Using the trained model
Once you are happy with the model, you can use it for predictions. The model can be used in one of the two following ways:
- With a REST API
- Export it to a model file
The first choice involves uploading an image. Calling the generated endpoint for your model, along with the image data, will result in a prediction. The result will contain the predicted tags, ordered by their probability.
The second choice allows you to run the prediction offline. This means that you can utilize different frameworks, such as TensorFlow, CoreML, and ONNX, for different platforms. How to use the model with these frameworks is beyond the scope of this book. The downside of using an offline model is that the accuracy may suffer a bit compared to the online version.