This is more on the inference side of things, but while I am passing an image through a network and waiting on the GPU, I would like to get a head start on the performing CPU bound tasks on the next image.  Would python’s asyncio be a path to go down?  If so can someone help get me started?  Here is the pseudo code.
Async def process_frame():
	forward()

while frame is not None:
    frame = next_frame() #CPU bound
    data = await process_frame(frame) #GPU bound inference