Skip to content

Instantly share code, notes, and snippets.

@musan6363
Created June 10, 2021 07:07
Show Gist options
  • Save musan6363/9bc62d1d65e5ea0c6252c61decdd079d to your computer and use it in GitHub Desktop.
Save musan6363/9bc62d1d65e5ea0c6252c61decdd079d to your computer and use it in GitHub Desktop.
テスト動画のみをOpenFaceの入力にするシェルスクリプト
#!/bin/bash
ln /dev/null /dev/raw1394
# 開始時刻の記録
start_time=`date +%s`
TZ=-9 date '+%a %b %d %H:%M:%S JST %Y' > /tmp/run_time.txt
# 動画ごとのカウンタ
cnt=0
for file in $(find /tmp/rawvideo -name "test*.mov"); do
# 各処理の開始時刻を記録`
begin=`date +%s` # 処理にかかった時間を計算する用
now=`TZ=-9 date '+%a %b %d %H:%M:%S JST %Y'`
echo "${now}, ${file}" # 処理開始からあまりに時間が立っていればその動画に問題があるかも
title=`basename ${file} .mov` # パスと拡張子を除く
mkdir /tmp/${title}
# メインの処理
build/bin/FaceLandmarkVidMulti -f ${file} -out_dir /tmp/${title} 1>/tmp/${title}/output.txt 2>/tmp/${title}/error.txt
end=`date +%s`
cnt=$((cnt+1))
elp=$((end-begin))
echo "${cnt}, ${elp}, ${title}" >> /tmp/run_time.txt
done
end_time=`date +%s`
run_time=$((end_time - start_time))
TZ=-9 date '+%a %b %d %H:%M:%S JST %Y' >> /tmp/run_time.txt
echo $run_time >> /tmp/run_time.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment