multiprocessing with Pool in python, and returned variables

30 views Asked by At

I'm using some python scripts to process images. An image is some between 500x500 or 4000x4000 pixels. The scripts do iterations over every pixel, so they're time consuming, so I set up the multiprocessor function. There's something I can't find any documentation on.. so, if I have the script iterate through with Pool.map one pixel at a time height-wise, it appends a dimension to the returned array. I would usually have a returned array height, width, # of color channels, but the mp functions would return a list instead of an array that is height, height, width, # of color channels, 1 extra channel for every iteration. OK.. so the child processes put their data into their own slice of memory space, which is fine.. but what exactly are the details? I can't find it, should I just take the last number on the stack? take an array that is now height, 0:height, 0:width, 0:channel count, and reshape it to the array size I would have gotten as usual? Or is it the 1st one? I can't find this information

0

There are 0 answers