The approach to batch processing depends on the structure of the anybody model. A commonly used strategy is a single anyscript main file. The main file is then loaded with different define statements to set the trial name, subject id or other parameters. This strategy for batch processing is outlined on the anyscript.org wiki page.
Another strategy is to have a separate main file for each trial. These individual main-files hold all trial-specific data and include a base model that is common to all trials and subjects. The approach makes it much easier to work with mocap models that have many subject or hundreds of trials.
The following shows how to batch process models where each trials is its own main file.
This (zip) illustrates the concept of a single model with many main files. The model is based on the Arm2D demo from the AnyBody tutorials. The main files are located in subfolders (model1
-model9
).
In [1]:
!dir /d "Tutorial_files/BatchProcess"
In [2]:
!dir /s /b "main.any"
Each of main files main.any
has it own set of parameters, and they all include the same common fiile Demo.Arm2D.any
.
In [3]:
from anypytools import AnyPyProcess
folderlist = ["Tutorial_files/BatchProcess"]
app = AnyPyProcess(num_processes = 3)
macrolist = [
'load "main.any"',
'operation Main.Study.InverseDynamics',
'run'
]
app.start_macro(macrolist, folderlist, search_subdirs= "model[1-9].*main.any" );
In [ ]: