3#if _MSC_VER >= 1900 && defined(_M_X64)
5#include "TensorImages.h"
15 class FL_EXPORT CTensorImagesWithMaskLabels :
public CTensorImages<T>
18 CTensorImagesWithMaskLabels();
20 CTensorImagesWithMaskLabels(
const CTensorImagesWithMaskLabels<T>& tsr,
bool bDeepCopy =
true);
22 virtual ~CTensorImagesWithMaskLabels();
24 static const CResult GetClassNumFromImages(
const Base::CFLImage* pFli,
bool bMaskImage, Base::CFLArray<int32_t>& flaClassNum);
26 virtual const CResult Create(
const std::vector<int64_t>& vctShape,
bool bOrderByDesc =
true,
bool bCudaAllocation =
true)
override;
27 virtual const CResult Create(
const Base::CFLImage* pFli,
bool bNormalize =
true, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex =
nullptr,
bool* pBAbort =
nullptr)
override;
28 virtual const CResult Create(
const Base::CFLImage& fli,
const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod,
bool bROIExtraction,
bool bNormalize,
const Base::CMultiVar<T>& mvBlankColor, ImageProcessing::EInterpolationMethod eInterpolationMethod, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex,
bool* pBAbort)
override;
29 virtual const CResult Create(
const Base::CFLImage* pFli,
const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod,
bool bROIExtraction,
bool bNormalize,
const Base::CMultiVar<T>& mvBlankColor, ImageProcessing::EInterpolationMethod eInterpolationMethod, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex,
bool* pBAbort)
override;
30 virtual const CResult Create(
const Base::CFLImage& fli,
const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises,
bool bROIExtraction =
false,
bool bNormalize =
true,
const Base::CMultiVar<T>& mvBlankColor = 0., ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex =
nullptr, std::atomic<int32_t>* pI32CurrentPreparingMaskIndex =
nullptr,
bool* pBAbort =
nullptr);
31 virtual const CResult Create(
const Base::CFLImage* pFli,
const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises,
bool bROIExtraction =
false,
bool bNormalize =
true,
const Base::CMultiVar<T>& mvBlankColor = 0., ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex =
nullptr, std::atomic<int32_t>* pI32CurrentPreparingMaskIndex =
nullptr,
bool* pBAbort =
nullptr);
33 virtual const CResult Create(
const wchar_t* pWcFilePath,
const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises,
bool bROIExtraction =
false,
bool bNormalize =
true,
const Base::CMultiVar<T>& mvBlankColor = 0.,
bool bRecursive =
false, ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear)
override;
35 virtual const CResult
Assign(
const CTensor<T>* pTsr,
bool bDeepCopy =
true)
override;
36 virtual const CResult
Assign(
const CTensorImages<T>* pTsr,
bool bDeepCopy =
true)
override;
38 virtual const CResult
Assign(
const CTensorImagesWithMaskLabels<T>& tsr,
bool bDeepCopy =
true);
39 virtual const CResult
Assign(
const CTensorImagesWithMaskLabels<T>* pTsr,
bool bDeepCopy =
true);
41 virtual const CResult
Append(
const Base::CFLImage* pFli, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises,
bool bROIExtraction =
false,
bool bNormalize =
true,
const Base::CMultiVar<T>& mvBlankColor = 0., ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex =
nullptr,
bool* pBAbort =
nullptr)
override;
43 virtual const CResult
Append(
const wchar_t* pWcFilePath,
bool bRecursive =
false)
override;
45 virtual const CResult
Clear()
override;
47 virtual const CResult SetMaskLabelImage(
const Base::CFLImage& fliMaskLabelImage);
48 virtual const CResult SetMaskLabelImage(
const Base::CFLImage* pFliMaskLabelImage);
49 virtual const Base::CFLImage* GetMaskLabelImage()
const;
51 virtual const CResult SetBatchParameters(
const CTensorImages<T>& tsr)
override;
52 virtual const CResult SetBatchParameters(
const CTensorImagesWithMaskLabels<T>& tsr);
54 virtual CTensorImagesWithMaskLabels<T>& Evaluate()
override;
55 virtual CComputationalBase<T>* Clone()
const override;
57 virtual const CResult Swap(CComputationalBase<T>& cbSwap)
override;
59 virtual const CResult LoadTensor(
const std::vector<int64_t>& vctBatchIndices)
override;
60 virtual const CResult CopyMaskLabels(CTensorImagesWithMaskLabels<T>* pTsrOrg, std::vector<int64_t>& vctOrders);
62 virtual const Base::CFLImage* GetCurrentMaskLabels()
const;
64 virtual const CResult EnableMaskLabelImage(
bool bEnable);
65 virtual bool IsMaskLabelImageEnabled()
const;
67 virtual const CResult EnableMaskTensor(
bool bEnable);
68 virtual bool IsMaskTensorEnabled()
const;
70 virtual const CResult CreateLabelImage(
const Base::CFLImage* pFliSrc,
const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod,
bool bAppend =
false, std::atomic<int32_t>* pI32CurrentPreparingMaskIndex =
nullptr,
bool* pBAbort =
nullptr, Base::CFLImage* pFliDst =
nullptr);
72 virtual const CResult GetLabelRatio(std::vector<float>& vctLabelRatio);
73 virtual const CResult GetLabelRatioSum(std::vector<float>& vctLabelRatioSum);
74 virtual const CResult GetLabelCount(std::vector<int32_t>& vctLabelCount);
76 virtual const CResult EnableLabelIncludingOutline(
bool bEnable);
77 virtual bool IsLabelIncludingOutlineEnabled()
const;
79 virtual const CResult SetLabelOutlineThickness(
float f32Thickness);
80 virtual float GetLabelOutlineThickness()
const;
82 virtual const CResult SetLabelIncludingContourNum(int32_t i32LabelNum);
83 virtual int32_t GettLabelIncludingContourNum()
const;
85 virtual const CResult SetZeroLabelFigureConvertNum(int32_t i32LabelNum);
86 virtual int32_t GetZeroLabelFigureConvertNum()
const;
88 DeclareGetClassType();
89 SupportToDuplicateObject(CTensorImagesWithMaskLabels, *
this);
92 virtual const CResult DecodeLabels(
const wchar_t* pWcsImagePath, Base::CFLImage* pFli =
nullptr);
93 virtual const CResult MakeDistribution()
override;
94 virtual const CResult InternalCreateLabelImage(
const std::vector<int64_t>& vctBatchIndices,
const Base::CFLImage* pFliSrc,
const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod,
bool bAppend =
false, std::atomic<int32_t>* pI32CurrentPreparingMaskIndex =
nullptr,
bool* pBAbort =
nullptr, Base::CFLImage* pFliDst =
nullptr);
97 Base::CFLImage* m_pFliMaskLabelImage;
98 Base::CFLImage m_fliMaskLabels;
99 Base::CFLImage m_fliCurrentMaskLabels;
100 Base::CFLImage m_fliMaskLabelThreadBuffer;
102 std::vector<float>& m_vctLabelRatio;
103 std::vector<float>& m_vctLabelRatioSum;
104 std::vector<int32_t>& m_vctLabelCount;
106 std::bitset<1024>& m_bsLabels;
109 bool m_bClearMaskLabel;
111 bool m_bLabelIncludingOutline;
112 float m_f32LabelIncludingOutlineThickness;
113 int32_t m_i32LabelIncludingContourNum;
114 int32_t m_i32ZeroFigureLabel;
115 int32_t m_i32ZeroLabelFigureConvertNum;
119 friend class CClassEqualizerBase;
122 friend class CClassEqualizerForTensorImagesWithMaskLabels;
124 static CTensorImagesWithMaskLabels<T>* GetInstance();
126 DeclareGetSignletonObject(CTensorImagesWithMaskLabels);
129 #define CCGFTensorLabelsWithMaskLabels(...) (*(new CTensorImagesWithMaskLabels<float>(__VA_ARGS__)))
130 #define CCGDTensorLabelsWithMaskLabels(...) (*(new CTensorImagesWithMaskLabels<double>(__VA_ARGS__)))
132 typedef CTensorImagesWithMaskLabels<float> CTensorImagesWithMaskLabelsF;
133 typedef CTensorImagesWithMaskLabels<double> CTensorImagesWithMaskLabelsD;
@ Assign
Set the value of CGUIPropertyItemView3DFigure to the specified figure.
@ Clear
Clear all the figure objects.