-
Notifications
You must be signed in to change notification settings - Fork 185
/
OpenPose-Image.bat
110 lines (48 loc) · 1.66 KB
/
OpenPose-Image.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
@echo off
cd /d %~dp0
rem --- access the image
echo Please input the path of image
set INPUT_IMAGE=
set /P INPUT_IMAGE=■the path of IMAGE:
rem echo INPUT_IMAGE:%INPUT_IMAGE%
IF /I "%INPUT_IMAGE%" EQU "" (
ECHO Input error, the analysis terminates.
EXIT /B
)
rem --- Max number of people in the IMAGE
echo --------------
echo Max number of person in the IMAGE
echo Press "enter" to set the default: 1 person
set NUMBER_PEOPLE_MAX=1
set /P NUMBER_PEOPLE_MAX="Max number of people in the IMAGE: "
rem --echo NUMBER_PEOPLE_MAX: %NUMBER_PEOPLE_MAX%
rem -----------------------------------
rem --- IMAGE input
FOR %%1 IN (%INPUT_VIDEO%) DO (
set INPUT_IMAGE_DIR=%%~dp1
set INPUT_IMAGE_FILENAME=%%~n1
)
set DT=%date%
set TM=%time%
set TM2=%TM: =0%
set DTTM=%dt:~0,4%%dt:~5,2%%dt:~8,2%_%TM2:~0,2%%TM2:~3,2%%TM2:~6,2%
echo --------------
rem ------------------------------------------------
rem -- output json files
set OUTPUT_JSON_DIR=%INPUT_IMAGE_DIR%_json
rem echo %OUTPUT_JSON_DIR%
mkdir %OUTPUT_JSON_DIR%
echo JSON files will be outputted: %OUTPUT_JSON_DIR%
rem ------------------------------------------------
set OUTPUT_IMAGE_PATH=%INPUT_IMAGE_DIR%_openpose.png
echo Output PNG files:%OUTPUT_IMAGE_PATH%
echo --------------
echo Openpose started.
echo Press ESC to break the process.
echo --------------
bin\OpenPoseDemo.exe --video %INPUT_IMAGE% --write_json %OUTPUT_JSON_DIR% --write_video %OUTPUT_IMAGE_PATH% --number_people_max %NUMBER_PEOPLE_MAX%
echo --------------
echo Done!
echo Openpose analysis finished.
echo Next step: using 3d-pose-baseline-vmd to process the JSON files.
echo %OUTPUT_JSON_DIR%