I have a model and dataloader with 1 image.
The main function is updating the image by looping then predicting the image.
import time # load model and weight model = ... if __name__ == "__main__": while(True): # load image start_time = time.time() dataloader = process_image_to_dataloader trainer.predict(model=model, dataloaders=[dataloader], return_predictions=True) print("--- %s seconds ---" % (time.time() - start_time))
As my experiment, the execution time is around 12s for 1 image prediction.
Another experiment that predicts 10 images, the execution time is also around 12s.
→ That means the number of images is not counting for execution time. (dataloader is not take long time ~0s)
Is there any efficient way to predict 1 image in loop that minimizes the execution time?