To run that Python command for all MP4 videos in a folder on Linux, you can create a shell script or use a simple loop within your terminal. Here’s how you can do it:
This is the easiest method to execute the command on all MP4 videos in a directory:
for video in ~/monolith/act_03/*.mp4; do
python demo/inferencer_demo.py "$video" --pose3d human3d --vis-out-dir ~/monolith/act_03/results/ --radius 7 --thickness 5
-
Copy the above script into a text file and save it as run_inferencer.sh.
-
Make the script executable by running:
chmod +x run_inferencer.sh
-
Run the script:
This will loop through all the .mp4 files in the ~/monolith/act_03/ directory and run the python demo/inferencer_demo.py command for each of them, saving the results to the specified output directory.