in pytorch (& yolov5) i was able to train two models (one detects cars, the other detects bikes).
I am loading two different models (last.pt files) with the following commands:
model_c = torch.hub.load('ultralytics/yolov5', 'custom', path='/last.pt', force_reload=True) model_b = torch.hub.load('ultralytics/yolov5', 'custom', path='/last.pt', force_reload=True)
I use an image for the model to detect cars or bikes in:
img = os.path.join('data', 'images', 'traffic.jpg')
The results command can show the model detection for cars:
results = model_c(img) results.print()
results = model_b(img) results.print()
How can the results of cars and bikes detections be shown in the same image at the same time?
Is there a way to combine two model pt.files into one?
Thank you very much in advance.