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

Does ExecuteScriptText/B help with this? I don't know ExecuteScriptText very well...