FLImaging 6.5.16.1
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 "Tensor.h"
8
9namespace FLImaging
10{
11 namespace AI
12 {
13
14 template<typename T>
15 class CInternalAugmentationBase;
16
17 template<typename T>
18 class CInternalAugmentationForClassifier;
19
20 template<typename T>
21 class CInternalAugmentationMaskOperationForSegmentation;
22
23 template<typename T>
24 class CInternalAugmentationForInstanceSegmentation;
25
26 template<typename T>
27 class CInternalAugmentationForObjectDetection;
28
29 template<typename T>
30 class CInternalAugmentationForAnomalyDetection;
31
32 template<typename T>
33 class CInternalAugmentationForAnomalyDetectionTrain;
34
35 template<typename T>
36 class CInternalAugmentationForSuperResolution;
37
38 template<typename T>
39 class CInternalAugmentationForStringBasedOCR;
40
41 template<typename T>
42 class CInternalAugmentationForGAN;
43
44 template <typename T>
45 class FL_EXPORT CComputationalGraphAugmentationBase : public CComputationalGraph<T>
46 {
47 private:
48
49 protected:
50 CComputationalGraphAugmentationBase();
51 CComputationalGraphAugmentationBase(const CComputationalGraphAugmentationBase<T>& cg);
52
53 public:
54
55 CComputationalGraphAugmentationBase(const CComputationalBase<T>& cbOperand, const CAugmentationParameters& apParams);
56 CComputationalGraphAugmentationBase(const CComputationalBase<T>& cbOperand, const CAugmentationParameters* pApParams);
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
68 virtual CTensor<T>& Forward() override;
69 virtual CTensor<T>* Backward() override;
70 virtual CComputationalBase<T>* Clone() const override = 0;
71
72 virtual const CResult GetBinaryData(Base::CFLData& fldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
73 virtual const CResult GetBinaryData(Base::CFLData* pFldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
74
75 virtual const CResult SetBinaryData(const Base::CFLData& fldBinary, int64_t* pI64Offset = nullptr);
76 virtual const CResult SetBinaryData(const Base::CFLData* pFldBinary, int64_t* pI64Offset = nullptr);
77
78 virtual const std::vector<int64_t>& GetEstimatedShape(bool bRecursive = true) const override;
79 virtual int64_t GetRequiredDedicatedMemory(bool bTraining = false, bool bRecursively = true, int64_t i64BatchSize = 1) const override;
80 virtual int64_t GetRequiredTemporaryMemory(bool bTraining = false, bool bRecursively = true, int64_t i64BatchSize = 1, int64_t i64MemoryIndex = 0) const override;
81 virtual const CResult PrintNodeParamInfo() const override;
82
83
84 DeclareGetClassType();
85 SupportToDuplicateAbstractObject(CComputationalGraphAugmentationBase);
86 protected:
87 virtual void Throw(const CResult& res, const wchar_t* pWcsExtraMessage = nullptr) const override;
88 protected:
89 CTensor<T> m_tsrTmpBuffer;
90 CTensor<T> m_tsrNullPixelMask;
91 CAugmentationParameters m_apAugmentaionParams;
92
93 CInternalAugmentationBase<T>* m_pInternal;
94 public:
95
96 private:
97 template <typename T> friend class CInternalAugmentationBase;
98 template <typename T> friend class CInternalAugmentationForClassifier;
99 template <typename T> friend class CInternalAugmentationMaskOperationForSegmentation;
100 template <typename T> friend class CInternalAugmentationForInstanceSegmentation;
101 template <typename T> friend class CInternalAugmentationForObjectDetection;
102 template <typename T> friend class CInternalAugmentationForSegmentation;
103 template <typename T> friend class CInternalAugmentationForAnomalyDetection;
104 template <typename T> friend class CInternalAugmentationForAnomalyDetectionTrain;
105 template <typename T> friend class CInternalAugmentationForSuperResolution;
106 template <typename T> friend class CInternalAugmentationForStringBasedOCR;
107 template <typename T> friend class CInternalAugmentationForGAN;
108
109 };
110 }
111}
112
113#endif
@ Assign
Set the value of CGUIPropertyItemView3DFigure to the specified figure.