I created my own manager since I will eventually need to pass classes into different processes. I did this using the following code.
class MyManager(BaseManager):
pass
MyManager.register('modeling', modelingClass)
manager = MyManager()
manager.start()
model = manager.modeling()
for counter in count(start=0, step=1): # counts up infinitely starting at 0
# get the latest image from the camera
frame = get_latest_frame()
if frame is None:
break
# run the model
t1 = time.time()
boxes, confidences, classIDs = model.get_bounding_boxes(frame, 1, 1)
print("TIME",(time.time()-t1))
The issue is that this each iteration of the model takes around .12 seconds to run, but if I run the model without multiprocessing and the manager, and just the normal initialization of the class, it runs in around .07 seconds. Any idea how I can speed up the multiprocessing implementation? Thank You.