{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Batch processing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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](http://wiki.anyscript.org/index.php/Running_several_files_as_batch).\n", "\n", "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. \n", "\n", "The following shows how to batch process models where each trials is its own main file. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Model with many main files" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This ([zip](Tutorial_files/BatchProcessExample.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`). " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Volume in drive C has no label.\n", " Volume Serial Number is CE8A-96EC\n", "\n", " Directory of C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\n", "\n", "[.] [model1] [model5] [model9]\n", "[..] [model2] [model6] [Output]\n", "batchprocess.py [model3] [model7] RunExample.bat\n", "Demo.Arm2D.any [model4] [model8] \n", " 3 File(s) 10.870 bytes\n", " 12 Dir(s) 83.615.764.480 bytes free\n" ] } ], "source": [ "!dir /d \"Tutorial_files/BatchProcess\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model1\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model2\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model3\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model4\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model5\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model6\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model7\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model8\\main.any\n", "C:\\Users\\mel\\Documents\\AnyBodySource\\AnyPyTools\\docs\\Tutorial\\Tutorial_files\\BatchProcess\\model9\\main.any\n" ] } ], "source": [ "!dir /s /b \"main.any\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Each of main files `main.any` has it own set of parameters, and they all include the same common fiile `Demo.Arm2D.any`. " ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0f2c2eb9595046978fcb835589f7c5e1", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/9 [00:00