FLImaging 6.12.9.2
ComputationalGraphAugmentationBase.h
1#pragma once
2
3#if _MSC_VER >= 1900 && defined(_M_X64)
4
5#include "ComputationalGraph.h"
6#include "AugmentationParameters.h"
7#include "ObjectAugmentationParameters.h"
8#include "Tensor.h"
9
10namespace FLImaging
11{
12 namespace AI
13 {
14
15 template<typename T>
16 class CInternalAugmentationBase;
17
18 template<typename T>
19 class CInternalAugmentationForClassifier;
20
21 template<typename T>
22 class CInternalAugmentationMaskOperationForSegmentation;
23
24 template<typename T>
25 class CInternalAugmentationForInstanceSegmentation;
26
27 template<typename T>
28 class CInternalAugmentationForObjectDetection;
29
30 template<typename T>
31 class CInternalAugmentationForAnomalyDetection;
32
33 template<typename T>
34 class CInternalAugmentationForAnomalyDetectionTrain;
35
36 template<typename T>
37 class CInternalAugmentationForSuperResolution;
38
39 template<typename T>
40 class CInternalAugmentationForStringBasedOCR;
41
42 template<typename T>
43 class CInternalAugmentationForGAN;
44
45 template <typename T>
46 class FL_EXPORT CComputationalGraphAugmentationBase : public CComputationalGraph<T>
47 {
48 private:
49
50 protected:
51 CComputationalGraphAugmentationBase();
52 CComputationalGraphAugmentationBase(const CComputationalGraphAugmentationBase<T>& cg);
53
54 public:
55
56 CComputationalGraphAugmentationBase(const CComputationalBase<T>& cbOperand, const CAugmentationParameters& apParams);
57 virtual ~CComputationalGraphAugmentationBase();
58
59 const CComputationalGraphAugmentationBase<T>& operator=(const CComputationalGraphAugmentationBase<T>& iab);
60
61 virtual const CResult Assign(const CComputationalGraphAugmentationBase<T>& cgAug);
62 virtual const CResult Assign(const CComputationalGraphAugmentationBase<T>* pCgAug);
63
64 virtual const CResult SetAugmentationParameters(const CAugmentationParameters& apParams);
65 virtual const CResult SetAugmentationParameters(const CAugmentationParameters* pApParams);
66 virtual const CAugmentationParameters* GetAugmentationParameters() const;
67 virtual const CResult SetObjectAugmentationParameters(const CObjectAugmentationParameters& apParams);
68 virtual const CResult SetObjectAugmentationParameters(const CObjectAugmentationParameters* pApParams);
69 virtual const CObjectAugmentationParameters* GetObjectAugmentationParameters() const;
70
71 virtual CTensor<T>& Forward() override;
72 virtual CTensor<T>* Backward() override;
73 virtual CComputationalBase<T>* Clone() const override = 0;
74
75 virtual const CResult GetBinaryData(Base::CFLData& fldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
76 virtual const CResult GetBinaryData(Base::CFLData* pFldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
77
78 virtual const CResult SetBinaryData(const Base::CFLData& fldBinary, int64_t* pI64Offset = nullptr);
79 virtual const CResult SetBinaryData(const Base::CFLData* pFldBinary, int64_t* pI64Offset = nullptr);
80
81 virtual const std::vector<int64_t>& GetEstimatedShape(bool bRecursive = true) const override;
82 virtual int64_t GetRequiredDedicatedMemory(bool bTraining = false, bool bRecursively = true, int64_t i64BatchSize = 1) const override;
83 virtual int64_t GetRequiredTemporaryMemory(bool bTraining = false, bool bRecursively = true, int64_t i64BatchSize = 1, int64_t i64MemoryIndex = 0) const override;
84 virtual const CResult PrintNodeParamInfo() const override;
85
86 virtual const CResult MakeOperandImage(const Base::CFLImage* pFliSource, Base::CFLImage* pFliResult, const std::vector<int64_t>& vtInputSize, const int64_t i64TilingMode);
87
88 DeclareGetClassType();
89 SupportToDuplicateAbstractObject(CComputationalGraphAugmentationBase);
90 protected:
91 virtual void Throw(const CResult& res, const wchar_t* pWcsExtraMessage = nullptr) const override;
92 protected:
93 CTensor<T> m_tsrObjectBuffer;
94 CTensor<T> m_tsrTmpBuffer;
95 CTensor<T> m_tsrNullPixelMask;
96 CAugmentationParameters m_apAugmentationParams;
97
98 CInternalAugmentationBase<T>* m_pInternal;
99 public:
100
101 private:
102 template <typename T> friend class CInternalAugmentationBase;
103 template <typename T> friend class CInternalAugmentationForClassifier;
104 template <typename T> friend class CInternalAugmentationMaskOperationForSegmentation;
105 template <typename T> friend class CInternalAugmentationForInstanceSegmentation;
106 template <typename T> friend class CInternalAugmentationForObjectDetection;
107 template <typename T> friend class CInternalAugmentationForSegmentation;
108 template <typename T> friend class CInternalAugmentationForAnomalyDetection;
109 template <typename T> friend class CInternalAugmentationForAnomalyDetectionTrain;
110 template <typename T> friend class CInternalAugmentationForSuperResolution;
111 template <typename T> friend class CInternalAugmentationForStringBasedOCR;
112 template <typename T> friend class CInternalAugmentationForGAN;
113
114 };
115 }
116}
117
118#endif
Definition AlgorithmAIBase.h:18
@ Assign
CGUIPropertyItemView3DFigure 의 값을 해당 도형으로 설정하는 함수
Definition DefinitionsGUIView3D.h:2930