HDlClassifierTrainResult.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 20.11
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HDLCLASSIFIERTRAINRESULT
  8. #define HCPP_HDLCLASSIFIERTRAINRESULT
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a Deep Neural Network training step result.
  12. class LIntExport HDlClassifierTrainResult : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HDlClassifierTrainResult():HHandle() {}
  17. // Copy constructor
  18. HDlClassifierTrainResult(const HDlClassifierTrainResult& source) : HHandle(source) {}
  19. // Copy constructor
  20. HDlClassifierTrainResult(const HHandle& handle);
  21. // Create HDlClassifierTrainResult from handle, taking ownership
  22. explicit HDlClassifierTrainResult(Hlong handle);
  23. bool operator==(const HHandle& obj) const
  24. {
  25. return HHandleBase::operator==(obj);
  26. }
  27. bool operator!=(const HHandle& obj) const
  28. {
  29. return HHandleBase::operator!=(obj);
  30. }
  31. protected:
  32. // Verify matching semantic type ('dl_classifier_train_result')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // train_dl_classifier_batch: Perform a training step of a deep-learning-based classifier on a batch of images.
  39. explicit HDlClassifierTrainResult(const HImage& BatchImages, const HDlClassifier& DLClassifierHandle, const HTuple& BatchLabels);
  40. /***************************************************************************
  41. * Operators *
  42. ***************************************************************************/
  43. // Clear the handle of a deep-learning-based classifier training result.
  44. static void ClearDlClassifierTrainResult(const HDlClassifierTrainResultArray& DLClassifierTrainResultHandle);
  45. // Clear the handle of a deep-learning-based classifier training result.
  46. void ClearDlClassifierTrainResult() const;
  47. // Return the results for the single training step of a deep-learning-based classifier.
  48. HTuple GetDlClassifierTrainResult(const HTuple& GenParamName) const;
  49. // Return the results for the single training step of a deep-learning-based classifier.
  50. HTuple GetDlClassifierTrainResult(const HString& GenParamName) const;
  51. // Return the results for the single training step of a deep-learning-based classifier.
  52. HTuple GetDlClassifierTrainResult(const char* GenParamName) const;
  53. #ifdef _WIN32
  54. // Return the results for the single training step of a deep-learning-based classifier.
  55. HTuple GetDlClassifierTrainResult(const wchar_t* GenParamName) const;
  56. #endif
  57. // Perform a training step of a deep-learning-based classifier on a batch of images.
  58. void TrainDlClassifierBatch(const HImage& BatchImages, const HDlClassifier& DLClassifierHandle, const HTuple& BatchLabels);
  59. };
  60. // forward declarations and types for internal array implementation
  61. template<class T> class HSmartPtr;
  62. template<class T> class HHandleBaseArrayRef;
  63. typedef HHandleBaseArrayRef<HDlClassifierTrainResult> HDlClassifierTrainResultArrayRef;
  64. typedef HSmartPtr< HDlClassifierTrainResultArrayRef > HDlClassifierTrainResultArrayPtr;
  65. // Represents multiple tool instances
  66. class LIntExport HDlClassifierTrainResultArray : public HHandleBaseArray
  67. {
  68. public:
  69. // Create empty array
  70. HDlClassifierTrainResultArray();
  71. // Create array from native array of tool instances
  72. HDlClassifierTrainResultArray(HDlClassifierTrainResult* classes, Hlong length);
  73. // Copy constructor
  74. HDlClassifierTrainResultArray(const HDlClassifierTrainResultArray &tool_array);
  75. // Destructor
  76. virtual ~HDlClassifierTrainResultArray();
  77. // Assignment operator
  78. HDlClassifierTrainResultArray &operator=(const HDlClassifierTrainResultArray &tool_array);
  79. // Clears array and all tool instances
  80. virtual void Clear();
  81. // Get array of native tool instances
  82. const HDlClassifierTrainResult* Tools() const;
  83. // Get number of tools
  84. virtual Hlong Length() const;
  85. // Create tool array from tuple of handles
  86. virtual void SetFromTuple(const HTuple& handles);
  87. // Get tuple of handles for tool array
  88. virtual HTuple ConvertToTuple() const;
  89. protected:
  90. // Smart pointer to internal data container
  91. HDlClassifierTrainResultArrayPtr *mArrayPtr;
  92. };
  93. }
  94. #endif