FLImaging 7.8.25.3
ComputationalGraphAugmentationMaskOperationForSegmentation.h
1#pragma once
2
3#if _MSC_VER >= 1900 && defined(_M_X64)
4
5#include "Tensor.h"
6#include "BackendLabel.h"
7#include "ComputationalGraphAugmentationBase.h"
8
9namespace FLImaging
10{
11 namespace AI
12 {
13
15 template<typename T>
16 class CInternalAugmentationMaskOperationForSegmentation;
17
18 template <typename T>
19 class FL_EXPORT CComputationalGraphAugmentationMaskOperationForSegmentation : public CComputationalGraphAugmentationBase<T>
20 {
21 private:
22 CComputationalGraphAugmentationMaskOperationForSegmentation();
23
24 protected:
25 CComputationalGraphAugmentationMaskOperationForSegmentation(const CComputationalGraphAugmentationMaskOperationForSegmentation<T>& cg);
26
27 public:
28
29 CComputationalGraphAugmentationMaskOperationForSegmentation(const CComputationalBase<T>& cbOperand, const CAugmentationParameters& apParams);
30 CComputationalGraphAugmentationMaskOperationForSegmentation(const CComputationalBase<T>& cbOperand, const CAugmentationParameters* pApParams);
31 virtual ~CComputationalGraphAugmentationMaskOperationForSegmentation();
32
33 virtual CComputationalBase<T>* Clone() const override;
34 virtual const CTensor<T>& GetMaskTensor() const;
35 virtual CTensor<T>& Forward() override;
36
37 virtual int64_t GetRequiredDedicatedMemory(bool bTraining = false, bool bRecursively = true, int64_t i64BatchSize = 1) const override;
38
39 virtual const CResult GetBinaryData(Base::CFLData& fldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
40 virtual const CResult GetBinaryData(Base::CFLData* pFldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
41
42 virtual const CResult SetBinaryData(const Base::CFLData& fldBinary, int64_t* pI64Offset = nullptr) override;
43 virtual const CResult SetBinaryData(const Base::CFLData* pFldBinary, int64_t* pI64Offset = nullptr) override;
44
45 DeclareGetClassType();
46 SupportToDuplicateObjectWithoutCreateNewObject(CComputationalGraphAugmentationMaskOperationForSegmentation, *this);
47
48 protected:
49 CTensor<T> m_tsrMaskTmpBuffer;
50 CTensor<T> m_tsrMask;
51 CBackendLabel<T> m_backendLabel;
52 public:
53 DeclareGetSignletonObject(CComputationalGraphAugmentationMaskOperationForSegmentation);
54
55
56 private:
57 template <typename T> friend class CInternalAugmentationMaskOperationForSegmentation;
58 };
59
60 #define CCGFAugmentationMaskOPSS(...) (*(new CComputationalGraphAugmentationMaskOperationForSegmentation<float>(__VA_ARGS__)))
61 #define CCGDAugmentationMaskOPSS(...) (*(new CComputationalGraphAugmentationMaskOperationForSegmentation<double>(__VA_ARGS__)))
62
63 #define CCGTAugmentationMaskOPSS(T, ...) (*(new CComputationalGraphAugmentationMaskOperationForSegmentation<T>(__VA_ARGS__)))
64 }
65}
66
67#endif
Augmentation Parameter Class By transforming the images, it increases the diversity of training image...
Definition AugmentationParameters.h:69
Definition AlgorithmAIBase.h:18