From 14405b50f05bfbf763c55f0997d0b19e50098996 Mon Sep 17 00:00:00 2001 From: themattinthehatt Date: Wed, 18 Dec 2024 13:53:26 -0500 Subject: [PATCH 1/2] add motion energy scripts to litpose --- deploy/serverpc/litpose/run_motion.py | 14 ++++++++++++++ deploy/serverpc/litpose/run_motion.sh | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 deploy/serverpc/litpose/run_motion.py create mode 100755 deploy/serverpc/litpose/run_motion.sh diff --git a/deploy/serverpc/litpose/run_motion.py b/deploy/serverpc/litpose/run_motion.py new file mode 100644 index 00000000..b6c2d31c --- /dev/null +++ b/deploy/serverpc/litpose/run_motion.py @@ -0,0 +1,14 @@ +import argparse +from pathlib import Path +from iblvideo.motion_energy import motion_energy + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Run motion energy for mp4 file and dlc outputs') + parser.add_argument('file_mp4', help='mp4 file to compute motion energy from') + parser.add_argument('dlc_result', help='dlc pqt file to compute motion energy from') + args = parser.parse_args() + + file_mp4 = Path(args.file_mp4) + dlc_result = Path(args.dlc_result) + + me_result, me_roi = motion_energy(file_mp4, dlc_result) diff --git a/deploy/serverpc/litpose/run_motion.sh b/deploy/serverpc/litpose/run_motion.sh new file mode 100755 index 00000000..100a3fd6 --- /dev/null +++ b/deploy/serverpc/litpose/run_motion.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +source $1 +python `dirname "$0"`/run_motion.py $2 $3 \ No newline at end of file From fcdfdb2ede05d3c10817088673455dfeb3b28fcb Mon Sep 17 00:00:00 2001 From: themattinthehatt Date: Wed, 18 Dec 2024 13:54:55 -0500 Subject: [PATCH 2/2] dlc->pose --- deploy/serverpc/litpose/run_motion.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deploy/serverpc/litpose/run_motion.py b/deploy/serverpc/litpose/run_motion.py index b6c2d31c..0a384131 100644 --- a/deploy/serverpc/litpose/run_motion.py +++ b/deploy/serverpc/litpose/run_motion.py @@ -1,14 +1,17 @@ import argparse from pathlib import Path + from iblvideo.motion_energy import motion_energy + if __name__ == "__main__": - parser = argparse.ArgumentParser(description='Run motion energy for mp4 file and dlc outputs') + + parser = argparse.ArgumentParser(description='Run motion energy for mp4 file and pose outputs') parser.add_argument('file_mp4', help='mp4 file to compute motion energy from') - parser.add_argument('dlc_result', help='dlc pqt file to compute motion energy from') + parser.add_argument('pose_result', help='pose pqt file to compute motion energy from') args = parser.parse_args() file_mp4 = Path(args.file_mp4) - dlc_result = Path(args.dlc_result) + pose_result = Path(args.pose_result) - me_result, me_roi = motion_energy(file_mp4, dlc_result) + me_result, me_roi = motion_energy(file_mp4, pose_result)