Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

poseParameters.hpp 5.4 KB

You have to be logged in to leave a comment. Sign In
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
  1. #ifndef OPENPOSE__POSE__POSE_PARAMETERS_HPP
  2. #define OPENPOSE__POSE__POSE_PARAMETERS_HPP
  3. #include <array>
  4. #include <map>
  5. #include <vector>
  6. #include "enumClasses.hpp"
  7. namespace op
  8. {
  9. // Model-Dependent Parameters
  10. // #define when needed in CUDA code
  11. const std::map<unsigned char, std::string> POSE_COCO_BODY_PARTS {
  12. {0, "Nose"},
  13. {1, "Neck"},
  14. {2, "RShoulder"},
  15. {3, "RElbow"},
  16. {4, "RWrist"},
  17. {5, "LShoulder"},
  18. {6, "LElbow"},
  19. {7, "LWrist"},
  20. {8, "RHip"},
  21. {9, "RKnee"},
  22. {10, "RAnkle"},
  23. {11, "LHip"},
  24. {12, "LKnee"},
  25. {13, "LAnkle"},
  26. {14, "REye"},
  27. {15, "LEye"},
  28. {16, "REar"},
  29. {17, "LEar"},
  30. {18, "Background"}
  31. };
  32. const unsigned char POSE_COCO_NUMBER_PARTS = 18; // Equivalent to size of std::map POSE_COCO_BODY_PARTS - 1 (removing background)
  33. const std::vector<unsigned char> POSE_COCO_MAP_IDX {31,32, 39,40, 33,34, 35,36, 41,42, 43,44, 19,20, 21,22, 23,24, 25,26, 27,28, 29,30, 47,48, 49,50, 53,54, 51,52, 55,56, 37,38, 45,46};
  34. const std::vector<unsigned char> POSE_COCO_PAIRS {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0, 0,14, 14,16, 0,15, 15,17, 2,16, 5,17};
  35. #define POSE_COCO_PAIRS_TO_RENDER {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0, 0,14, 14,16, 0,15, 15,17}
  36. const std::map<unsigned char, std::string> POSE_MPI_BODY_PARTS{
  37. {0, "Head"},
  38. {1, "Neck"},
  39. {2, "RShoulder"},
  40. {3, "RElbow"},
  41. {4, "RWrist"},
  42. {5, "LShoulder"},
  43. {6, "LElbow"},
  44. {7, "LWrist"},
  45. {8, "RHip"},
  46. {9, "RKnee"},
  47. {10, "RAnkle"},
  48. {11, "LHip"},
  49. {12, "LKnee"},
  50. {13, "LAnkle"},
  51. {14, "Chest"},
  52. {15, "Background"}
  53. };
  54. const unsigned char POSE_MPI_NUMBER_PARTS = 15; // Equivalent to size of std::map POSE_MPI_NUMBER_PARTS - 1 (removing background)
  55. const std::vector<unsigned char> POSE_MPI_MAP_IDX {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 38, 39, 40, 41, 42, 43, 32, 33, 34, 35, 36, 37};
  56. const std::vector<unsigned char> POSE_MPI_PAIRS {0,1, 1,2, 2,3, 3,4, 1,5, 5,6, 6,7, 1,14, 14,11, 11,12, 12,13, 14,8, 8,9, 9,10};
  57. #define POSE_MPI_PAIRS_TO_RENDER {0,1, 2,3, 3,4, 5,6, 6,7, 11,12, 12,13, 8,9, 9,10}
  58. // Constant Global Parameters
  59. const unsigned char POSE_MAX_PEOPLE = 96;
  60. // Constant Array Parameters
  61. const std::array<float, (int)PoseModel::Size> POSE_CCN_DECREASE_FACTOR{ 8.f, 8.f, 8.f};
  62. const std::array<unsigned int, (int)PoseModel::Size> POSE_MAX_PEAKS{ POSE_MAX_PEOPLE, POSE_MAX_PEOPLE, POSE_MAX_PEOPLE};
  63. const std::array<unsigned char, (int)PoseModel::Size> POSE_NUMBER_BODY_PARTS{ POSE_COCO_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS};
  64. const std::array<std::map<unsigned char, std::string>, 3> POSE_BODY_PART_MAPPING{ POSE_COCO_BODY_PARTS, POSE_MPI_BODY_PARTS, POSE_MPI_BODY_PARTS};
  65. const std::array<std::vector<unsigned char>, 3> POSE_BODY_PART_PAIRS{ POSE_COCO_PAIRS, POSE_MPI_PAIRS, POSE_MPI_PAIRS};
  66. const std::array<std::vector<unsigned char>, 3> POSE_MAP_IDX{ POSE_COCO_MAP_IDX, POSE_MPI_MAP_IDX, POSE_MPI_MAP_IDX};
  67. const std::array<std::string, (int)PoseModel::Size> POSE_PROTOTXT{ "pose/coco/pose_deploy_linevec.prototxt",
  68. "pose/mpi/pose_deploy_linevec.prototxt",
  69. "pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt"};
  70. const std::array<std::string, (int)PoseModel::Size> POSE_TRAINED_MODEL{ "pose/coco/pose_iter_440000.caffemodel",
  71. "pose/mpi/pose_iter_160000.caffemodel",
  72. "pose/mpi/pose_iter_160000.caffemodel"};
  73. // Default Model Parameters
  74. // They might be modified on running time
  75. const std::array<float, (int)PoseModel::Size> POSE_DEFAULT_NMS_THRESHOLD{ 0.05f, 0.6f, 0.3f};
  76. const std::array<unsigned char, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_INTER_MIN_ABOVE_THRESHOLD{ 9, 8, 8};
  77. const std::array<float, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_INTER_THRESHOLD{ 0.05f, 0.01f, 0.01f};
  78. const std::array<unsigned char, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_MIN_SUBSET_CNT{ 3, 3, 3};
  79. const std::array<float, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_MIN_SUBSET_SCORE{ 0.4f, 0.4f, 0.4f};
  80. // Rendering default parameters
  81. const auto POSE_DEFAULT_ALPHA_POSE = 0.6f;
  82. const auto POSE_DEFAULT_ALPHA_HEATMAP = 0.7f;
  83. // Auxiliary functions
  84. unsigned char poseBodyPartMapStringToKey(const PoseModel poseModel, const std::string& string);
  85. unsigned char poseBodyPartMapStringToKey(const PoseModel poseModel, const std::vector<std::string>& strings);
  86. }
  87. #endif // OPENPOSE__POSE__POSE_PARAMETERS_HPP
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...