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.

73 lines
2.3 KiB

1 year ago
  1. #pragma once
  2. #include <fsdk/IRefCounted.h>
  3. #include <fsdk/Types/Detection.h>
  4. #include <fsdk/Types/Human.h>
  5. #include <fsdk/Types/HumanLandmarks.h>
  6. #include <fsdk/Types/Image.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(IHumanDetectionBatch);
  13. #endif
  14. /**
  15. * @brief Human detection result batch interface.
  16. * */
  17. struct IHumanDetectionBatch : public IRefCounted {
  18. /**
  19. * @brief Returns size.
  20. * */
  21. virtual size_t getSize() const noexcept = 0;
  22. /**
  23. * @brief Returns size of the results for the target index.
  24. * @param [in] imageIndex index of the image.
  25. * */
  26. virtual size_t getSize(size_t imageIndex) const noexcept = 0;
  27. /**
  28. * @brief Returns detected Human.
  29. * @param [in] image source image.
  30. * @param [in] imageIndex index of the image.
  31. * @param [in] detectionIndex index of the detection.
  32. * @return Detected Human.
  33. * @see Human and Image for details.
  34. * @note image format must be R8G8B8, @see Format.
  35. * @note Result Human could be invalid if no humans were
  36. * detected on the target image or parameters are invalid.
  37. * */
  38. virtual Human getHuman(const Image& image, size_t imageIndex, size_t detectionIndex) const noexcept = 0;
  39. /**
  40. * @brief Returns detection Span.
  41. * @param [in] index index of the detections Span.
  42. * @return Span of detections.
  43. * @see Span and Detection for details.
  44. * @note all spans should be based on user owned continuous collections.
  45. * @note Result Span could be empty in two cases:
  46. * 1. If no humans were detected in the target image.
  47. * 2. If detection request didn't contain the DCT_BOX flag. @see HumanDetectionType.
  48. * */
  49. virtual Span<const Detection> getDetections(size_t index = 0) const noexcept = 0;
  50. /**
  51. * @brief Returns HumanLandmarks17 Span.
  52. * @param [in] index index of the HumanLandmarks17 Span.
  53. * @return Span of HumanLandmarks17.
  54. * @note all spans should be based on user owned continuous collections.
  55. * @see Span and HumanLandmarks17 for details.
  56. * @note Result Span could be empty in two cases:
  57. * 1. If no humans were detected in the target image.
  58. * 2. If detection request didn't contain the DCT_POINTS flag. @see HumanDetectionType.
  59. * */
  60. virtual Span<const HumanLandmarks17> getLandmarks17(size_t index = 0) const noexcept = 0;
  61. };
  62. }