Multiple models inference at the same time

Hi, I have 4 YOLOV8 models, they have each been trained for a specific task, and I would like to know if there is a way to make predictions with all of the models at the same time.
Each one has to predict something on a picture, but I would like to avoid waiting for the first model prediction before making the second prediction, etc.
So is there a way to “fuse” these models together to speed up the process, and not have to wait for the previous model inference before calling the next model ?

Hi @arlaine, this will depend on the hardware you’re using.

You’ll see a significant amount of resource use with running all 4 models concurrently, and a very low FPS unless you have a very good GPU.

You can try merging the datasets together and training a combined model, if these models are essentially working in tandem.

Another option, if you don’t want to merge the datasets, would be to run the image or video frame through one model, and then chain it through the following models after the previous one processes it.

For complete guidelines on optimal “fusing,” if you’re not satisfied with above, I’d suggest posting in the Ultralytics forum: