Parallel Processing with Python Script
Hi,
Struggling away with an IP and Python integration. I have the basics working
1. Preprocess a folder of images
2. Use Python and Segment Anything library (from Meta) to define regions of interest on the image and generate a mask image for further use by IP.
Using ExecuteScriptText on a shell script running a python script
4. Return to IP and Quantify the regions of interest
The first step is fast ~1 minute for 50 images
Step 2 is long taking ~ 15 minutes
Step 3 takes ~8 minutes
The python script runs through a bunch of images and saves an output file for each one. The first ones become available long before the rest are done and I was wondering if there was a way to run the python script without making IP busy. Currently, IP waits until the full script is done before returning control. Is it possible to avoid this behavior such that IP can start working on the quantifications on the first processes images?
Andy
Break the script into representative parts?
March 12, 2024 at 02:08 pm - Permalink
Does ExecuteScriptText/B help with this? I don't know ExecuteScriptText very well...
March 12, 2024 at 03:47 pm - Permalink
In reply to Does ExecuteScriptText/B… by johnweeks
Hi,
I am using /B albeit on the Mac it is ignored.
Andy
March 12, 2024 at 04:23 pm - Permalink
Spawn a second instance of Igor to handle the processing?
March 13, 2024 at 06:15 am - Permalink
I have no experience doing this, but https://stackoverflow.com/questions/5772873/python-spawn-off-a-child-su… might give you some ideas.
March 13, 2024 at 01:20 pm - Permalink