I have two YOLO models. In the processing script, the output of model 1 is given as input to model 2 and model 2 gives final output after further more processing. My input to model 1 is either jpg or png image and final output from model 2 is like [(A, 2), (B, 4), (C, 1)….].
I need solution for multimodel deployment, if any two models dependent on each other
2
Answers
I think we can do this by starting to containerize each YOLO model separately using Docker. Then create a Docker image for Model 1, including the necessary YOLO model files and the processing script. Expose an API endpoint in the container to receive image input and return the output.
later Create a Docker image for Model 2, and Expose an API endpoint for receiving the output of Model 1 as input and returning the final output.
Deploy an orchestrator or server that coordinates the flow between Model 1 and Model
Hope this helps, thanks
To deploy two dependent models using Azure Machine Learning, you can create a single service that hosts both models and handles processing between them.
Below are the steps with sample code snippet for reference:
First, upload your models to the workspace’s default datastore and register them with Azure ML.
score.py
script for handling the inference:This script will load both models, preprocess the input, and perform inference using the two models sequentially.
Once you configure the inference script according to your requirement, you can create an endpoint.
For more details, you can check this documentation and also you can check the complete code sample for multi-model deployment in this notebook.