-
Notifications
You must be signed in to change notification settings - Fork 3
/
Keypoint_Extraction_Openpose.bat
79 lines (64 loc) · 2.75 KB
/
Keypoint_Extraction_Openpose.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@echo off
rem ---
rem --- Convert video data to Openpose skeleton data
rem ---
rem --- Change the current directory to the execution destination
cd /d %~dp0
rem --- Input target video file path
echo Please enter the full path of the file of the video to be analyzed.
set INPUT_VIDEO=
set /P INPUT_VIDEO=** Analysis target video file path:
rem echo INPUT_VIDEOF%INPUT_VIDEO%
IF /I "%INPUT_VIDEO%" EQU "" (
ECHO Processing is suspended because the analysis target video file path is not set.
EXIT /B
)
rem --- Frame to start analysis
echo --------------
echo Please enter the frame number for starting analysis. (0 start)
echo If the human body can not trace accurately,
echo such as when the logo is displayed at the beginning, you can skip the beginning frame.
echo If nothing is entered and ENTER is pressed, it will be analyzed from 0F.
set FRAME_FIRST=0
set /P FRAME_FIRST="** Analysis start frame number: "
rem --- Maximum number of people in the Video
echo --------------
echo Please enter the maximum number of people shown in the Video.
echo If you do not enter anything and press ENTER, it will be analysis for one person.
echo If you specify only one person in the Video of which the number of people is the same size, the analysis subject may jump.
set NUMBER_PEOPLE_MAX=1
set /P NUMBER_PEOPLE_MAX="** Maximum number of people shown in the video:"
rem -----------------------------------
rem --- Input video path
FOR %%1 IN (%INPUT_VIDEO%) DO (
rem -- Path generation with parent directory of input video path and file name + _ json
set INPUT_VIDEO_DIR=%%~dp1
set INPUT_VIDEO_FILENAME=%%~n1
)
rem -- Execution date
set DT=%date%
rem -- Execution time
set TM=%time%
rem -- Replace time space with 0
set TM2=%TM: =0%
rem -- Replace execution date for file name
set DTTM=%dt:~0,4%%dt:~5,2%%dt:~8,2%_%TM2:~0,2%%TM2:~3,2%%TM2:~6,2%
echo --------------
rem ------------------------------------------------
rem -- JSON Output directory
set OUTPUT_JSON_DIR=%INPUT_VIDEO_DIR%%INPUT_VIDEO_FILENAME%_%DTTM%\%INPUT_VIDEO_FILENAME%_json
rem echo %OUTPUT_JSON_DIR%
rem -- JSON Output directory generation
mkdir %OUTPUT_JSON_DIR%
echo Analysis result JSON directoryF%OUTPUT_JSON_DIR%
echo --------------
echo Start analyzing with Openpose.
echo If you want to interrupt the analysis, please press the ESC key.
echo --------------
rem -- exe Execution
bin\OpenPose.exe --video %INPUT_VIDEO% --model_pose COCO --write_json %OUTPUT_JSON_DIR% --number_people_max %NUMBER_PEOPLE_MAX% --frame_first %FRAME_FIRST%
echo --------------
echo Done Moazzem!!
echo The analysis with Openpose is over.
echo The full path of the JSON directory specified by 3d-pose-baseline is as follows.
echo %OUTPUT_JSON_DIR%