I'm trying to do image classification. I'm using Scala, the Akka actor system, and deeplearning4j. The thing is that I have to detect always on the same spots or crop on the image. I was thinking of creating a new actor for each crop of the image, on each frame. The thing is that, from what I understand, instantiating a new model for each actor creation is not viable, but having an instance of the model, and passing to each actor isn't either. Should I have a pool of instances? I'm a bit stuck with this problem, since it is the first time I'm trying deeplearning4j. Previously, I would use a python REST api, but I think that this solution should perform better.
Thank you in advance.
images.par.map(model.classify)
could already do the job; it would take care of a thread pool all by itself).