FLImaging 6.6.27.1
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
40 DeclareGetClassType();
41 SupportToDuplicateObjectWithoutCreateNewObject(CComputationalGraphAugmentationMaskOperationForSegmentation, *this);
42
43 protected:
44 CTensor<T> m_tsrMaskTmpBuffer;
45 CTensor<T> m_tsrMask;
46 CBackendLabel<T> m_backendLabel;
47 public:
48 DeclareGetSignletonObject(CComputationalGraphAugmentationMaskOperationForSegmentation);
49
50
51 private:
52 template <typename T> friend class CInternalAugmentationMaskOperationForSegmentation;
53 };
54
55 #define CCGFAugmentationMaskOPSS(...) (*(new CComputationalGraphAugmentationMaskOperationForSegmentation<float>(__VA_ARGS__)))
56 #define CCGDAugmentationMaskOPSS(...) (*(new CComputationalGraphAugmentationMaskOperationForSegmentation<double>(__VA_ARGS__)))
57
58 #define CCGTAugmentationMaskOPSS(T, ...) (*(new CComputationalGraphAugmentationMaskOperationForSegmentation<T>(__VA_ARGS__)))
59 }
60}
61
62#endif
증강 파라미터 클래스 이미지를 변형하여 학습이미지에 다양성을 증가시켜 overfitting을 방지하고, 일반화된 특성을 학습할 수 있도록 합니다....
Definition AugmentationParameters.h:67
Definition AlgorithmAIBase.h:16