Type.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #pragma once
  2. #ifdef ORTTOOLKIT
  3. #define ORTTOOLKIT __declspec(dllexport)
  4. #else
  5. #define ORTTOOLKIT __declspec(dllimport)
  6. #endif
  7. #include <vector>
  8. #include <array>
  9. namespace OrtToolkit {
  10. namespace Type {
  11. //基本数据类型
  12. typedef std::array<float, 2> Base_Type_fPoint;
  13. typedef std::array<int, 2> Base_Type_iPoint;
  14. typedef std::array<float, 4> Base_Type_Box;
  15. typedef float Base_Type_Score;
  16. //高级数据类型
  17. typedef std::vector<Base_Type_Box> Type_Boxs;
  18. typedef std::vector<Base_Type_Score> Type_Scores;
  19. typedef std::vector<Base_Type_Score> Type_fVec;
  20. //为IOU服务的数据类型
  21. ORTTOOLKIT struct Base_Type_Iou {
  22. float x1;
  23. float y1;
  24. float x2;
  25. float y2;
  26. float score;
  27. };
  28. ORTTOOLKIT struct Type_Iou_YOLOV7FACE {
  29. float x1;
  30. float y1;
  31. float x2;
  32. float y2;
  33. float score;
  34. std::array<Base_Type_iPoint, 5> LandmarksPointSet;
  35. std::array<Base_Type_Score, 5> LandmarksScores;
  36. };
  37. //目标检测数据类型基类
  38. ORTTOOLKIT struct ResDetection {
  39. Type_Boxs boxes;
  40. Type_Scores scores;
  41. void clear() {
  42. boxes.clear();
  43. scores.clear();
  44. };
  45. };
  46. //目标检测子类
  47. ORTTOOLKIT struct Res_PP_YOLOE :ResDetection {};
  48. ORTTOOLKIT struct Res_YOLOV7_FACE :ResDetection {
  49. std::vector<std::array<Base_Type_iPoint, 5>> LandmarksPoints;
  50. std::vector<std::array<Base_Type_Score, 5>> LandmarksScores;
  51. void clear() {
  52. boxes.clear();
  53. scores.clear();
  54. LandmarksPoints.clear();
  55. LandmarksScores.clear();
  56. }
  57. };
  58. //人脸特征向量
  59. typedef Type_fVec Res_Arcface;
  60. //Iou跟踪器类型
  61. struct ORTTOOLKIT track {
  62. Base_Type_Box bbox;
  63. Base_Type_Score score;
  64. std::array<Base_Type_iPoint, 5> LandmarksPoint;
  65. std::array<Base_Type_Score, 5> LandmarksScore;
  66. int life;
  67. int id;
  68. int disappear;
  69. };
  70. }
  71. }