You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.0 KiB

1 year ago
  1. #pragma once
  2. #include <fsdk/IRefCounted.h>
  3. #include <fsdk/Types/Detection.h>
  4. #include <fsdk/Types/Face.h>
  5. #include <fsdk/Types/Image.h>
  6. #include <fsdk/Types/Landmarks.h>
  7. #include <fsdk/Types/Ref.h>
  8. #include <fsdk/Types/Span.h>
  9. #include <cstddef>
  10. namespace fsdk {
  11. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  12. DECLARE_SMARTPTR(IFaceDetectionBatch);
  13. #endif
  14. /**
  15. * @brief Face detection result batch interface.
  16. * */
  17. struct IFaceDetectionBatch : public IRefCounted {
  18. /**
  19. * @brief Returns size.
  20. * @return size of the detections.
  21. * */
  22. virtual size_t getSize() const noexcept = 0;
  23. /**
  24. * @brief Returns size of the results for the target index.
  25. * @param [in] imageIndex index of the image.
  26. * @return size of the results for the target index.
  27. * */
  28. virtual size_t getSize(size_t imageIndex) const noexcept = 0;
  29. /**
  30. * @brief Returns detected face.
  31. * @param [in] img source image.
  32. * @param [in] imageIndex index of the image.
  33. * @param [in] detectionIndex index of the detection.
  34. * @return Detected face.
  35. * @see Face and Image for details.
  36. * @note images format must be R8G8B8, @see Format.
  37. * @note Result Face could be invalid if no any faces were
  38. * detected on the target image or parameters are invalid.
  39. * */
  40. virtual Face getFace(const Image& img, size_t imageIndex, size_t detectionIndex) const noexcept = 0;
  41. /**
  42. * @brief Returns detection Span.
  43. * @param [in] index index of the detection.
  44. * @return span of detection coordinates in corresponding source images space.
  45. * @see Span and Detection for details.
  46. * @note all spans should be based on user owned continuous collections.
  47. * @note Result Span could be empty in two cases:
  48. * 1. If no any faces were detected on the target image.
  49. * 2. If detection request didn't contain the DT_BOX flag. @see DetectionType
  50. * */
  51. virtual Span<const Detection> getDetections(size_t index = 0) const noexcept = 0;
  52. /**
  53. * @brief Returns Landmarks5 Span.
  54. * @param [in] index index of the landmarks object.
  55. * @return Span of Landmarks5.
  56. * @see Span and Landmarks5 for details.
  57. * @note all spans should be based on user owned continuous collections.
  58. * @note Result Span could be empty in two cases:
  59. * 1. If no any faces were detected on the target image.
  60. * 2. If detection request didn't contain the DT_LANDMARKS5 flag. @see DetectionType
  61. * */
  62. virtual Span<const Landmarks5> getLandmarks5(size_t index = 0) const noexcept = 0;
  63. /**
  64. * @brief Returns Landmarks68 Span.
  65. * @param [in] index index of the landmarks object.
  66. * @return Span of Landmarks68.
  67. * @see Span and Landmarks68 for details.
  68. * @note all spans should be based on user owned continuous collections.
  69. * @note Result Span could be empty in two cases:
  70. * 1. If no any faces were detected on the target image.
  71. * 2. If detection request didn't contain the DT_LANDMARKS68 flag. @see DetectionType
  72. * */
  73. virtual Span<const Landmarks68> getLandmarks68(size_t index = 0) const noexcept = 0;
  74. };
  75. }