Auto Labeler DL
1 개요
Auto Labeler DL은 데이터셋 생성 과정을 혁신적으로 단순화하기 위한 자동 라벨링 알고리즘입니다. 이를 통해 반복적이고 시간이 많이 소요되는 작업을 줄이고 생산성을 극대화할 수 있습니다.
Semantic Segmentation DL과 Instance Segmentation DL 그리고 Object Detection DL의 라벨링을 지원합니다.
Source
Result
Fig. AutoLabelerDL 동작 수행 결과
2 API
ClearModel()
Execute()
Load(String)
Load(CInstanceSegmentationDL)
Load(CSemanticSegmentationDL)
오토라벨러에서 사용할 모델을 로드합니다.
String
모델 파일 경로입니다. 지원 모델 포맷 : .flss, .flis
CInstanceSegmentationDL
모델 파일 경로입니다. 지원 모델 포맷 : .flss, .flis
CSemanticSegmentationDL
모델 파일 경로입니다. 지원 모델 포맷 : .flss, .flis
SetSourceImage(CFLImage)
EnableBatchProcessing(bool)
EnableOverwriting(bool)
Overwrting 여부를 설정합니다. false 시 기존 피겨가 있는 이미지는 수행되지 않고 true시에는 항상 수행되고 기존 피겨는 삭제됩니다.
SetLabelOptions(ELabelOptions)
라벨 옵션을 설정합니다.
ELabelOptions
Figure 옵션입니다. 기본 값 : ELabelOptions_ClassNum_ClassName_RegionType_Contour
SetMinimumScore(float)
SetMinimumArea(float)
3 예제 코드:
Semnatic Segmentation Model File Path로 수행
C++
C#
Python
CResult res;
CFLImage fliSourceImage;
bool bOverwrite = true ;
bool bBatchProcessing = true ;
CAutoLabelerDL::ELabelOptions eLabelOption = CAutoLabelerDL::ELabelOptions_RegionType_Contour;
float f32MinimumArea = 500.00f ;
float f32MaximumArea = 500000.00f ;
float f32MinimumConfidenceScore = 0.5f ;
CFLString<wchar_t > flsModelFilePath = L"../../ExampleImages/SemanticSegmentation/SemanticSegmentation.flss" ;
if (IsFail (res = fliSourceImage.Load (L"../../ExampleImages/SemanticSegmentation/Validation.flif" )))
break ;
CAutoLabelerDL autoLabelerDL;
autoLabelerDL.Load (flsModelFilePath);
autoLabelerDL.SetSourceImage (fliSourceImage);
autoLabelerDL.EnableOverwriting (bOverwrite);
autoLabelerDL.EnableBatchProcessing (bBatchProcessing);
autoLabelerDL.SetLabelOptions (eLabelOption);
autoLabelerDL.SetMinimumScore (f32MinimumConfidenceScore);
autoLabelerDL.SetMinimumArea (f32MinimumArea);
autoLabelerDL.SetMaximumArea (f32MaximumArea);
autoLabelerDL.Execute ();
if (IsFail (res = autoLabelerDL.Execute ()))
break ;
if (IsFail (res = fliSourceImage.Save (L"../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )))
break ;
CResult res = new CResult();
CFLImage fliSourceImage = new CFLImage();
bool bOverwrite = true ;
bool bBatchProcessing = true ;
CAutoLabelerDL.ELabelOptions eLabelOption = CAutoLabelerDL.ELabelOptions.RegionType_Contour;
float f32MinimumArea = 500.00f ;
float f32MaximumArea = 500000.00f ;
float f32MinimumConfidenceScore = 0.5f ;
String flsModelFilePath = "../../ExampleImages/SemanticSegmentation/SemanticSegmentation.flss" ;
if ((res = fliSourceImage.Load("../../ExampleImages/SemanticSegmentation/Validation.flif" )).IsFail())
break ;
CAutoLabelerDL autoLabelerDL = new CAutoLabelerDL();
autoLabelerDL.Load(flsModelFilePath);
autoLabelerDL.SetSourceImage(ref fliSourceImage);
autoLabelerDL.EnableOverwriting(bOverwrite);
autoLabelerDL.EnableBatchProcessing(bBatchProcessing);
autoLabelerDL.SetLabelOptions(eLabelOption);
autoLabelerDL.SetMinimumScore(f32MinimumConfidenceScore);
autoLabelerDL.SetMinimumArea(f32MinimumArea);
autoLabelerDL.SetMaximumArea(f32MaximumArea);
if ((res = autoLabelerDL.Execute()).IsFail())
break ;
if ((res = fliSourceImage.Save("../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )).IsFail())
break ;
fliSourceImage = CFLImage()
bOverwrite = True
bBatchProcessing = True
eLabelOption = CAutoLabelerDL.ELabelOptions.RegionType_Contour
f32MinimumArea = 500.00
f32MaximumArea = 500000.00
f32MinimumConfidenceScore = 0.5
flsModelFilePath = "../../ExampleImages/SemanticSegmentation/SemanticSegmentation.flss"
fliSourceImage.Load("../../ExampleImages/SemanticSegmentation/Validation.flif" )
autoLabelerDL = CAutoLabelerDL()
autoLabelerDL.Load(flsModelFilePath)
autoLabelerDL.SetSourceImage(fliSourceImage)
autoLabelerDL.EnableOverwriting(bOverwrite)
autoLabelerDL.EnableBatchProcessing(bBatchProcessing)
autoLabelerDL.SetLabelOptions(eLabelOption)
autoLabelerDL.SetMinimumScore(f32MinimumConfidenceScore)
autoLabelerDL.SetMinimumArea(f32MinimumArea)
autoLabelerDL.SetMaximumArea(f32MaximumArea)
autoLabelerDL.Execute()
fliSourceImage.Save("../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )
Semantic Segmentation DL로 수행
C++
C#
Python
CResult res;
CFLString<wchar_t > flsModelFilePath = L"../../ExampleImages/SemanticSegmentation/SemanticSegmentation.flss" ;
CFLImage fliSourceImage;
CSemanticSegmentationDL semanticSegmentationDL;
bool bOverwrite = true ;
bool bBatchProcessing = false ;
CAutoLabelerDL::ELabelOptions eLabelOption = CAutoLabelerDL::ELabelOptions_RegionType_Contour;
float f32MinimumArea = 500.00f ;
float f32MaximumArea = 500000.00f ;
float f32MinimumConfidenceScore = 0.5f ;
if (IsFail (res = semanticSegmentationDL.Load (flsModelFilePath)))
break ;
if (IsFail (res = fliSourceImage.Load (L"../../ExampleImages/SemanticSegmentation/Validation.flif" )))
break ;
CAutoLabelerDL autoLabelerDL;
autoLabelerDL.Load (&semanticSegmentationDL);
autoLabelerDL.SetSourceImage (fliSourceImage);
autoLabelerDL.EnableOverwriting (bOverwrite);
autoLabelerDL.EnableBatchProcessing (bBatchProcessing);
autoLabelerDL.SetLabelOptions (eLabelOption);
autoLabelerDL.SetMinimumScore (f32MinimumConfidenceScore);
autoLabelerDL.SetMinimumArea (f32MinimumArea);
autoLabelerDL.SetMaximumArea (f32MaximumArea);
autoLabelerDL.Execute ();
if (IsFail (res = autoLabelerDL.Execute ()))
break ;
if (IsFail (res = fliSourceImage.Save (L"../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )))
break ;
CResult res = new CResult();
String flsModelFilePath = "../../ExampleImages/SemanticSegmentation/SemanticSegmentation.flss" ;
CFLImage fliSourceImage = new CFLImage();
CSemanticSegmentationDL semanticSegmentationDL = new CSemanticSegmentationDL();
bool bOverwrite = true ;
bool bBatchProcessing = false ;
CAutoLabelerDL.ELabelOptions eLabelOption = CAutoLabelerDL.ELabelOptions.RegionType_Contour;
float f32MinimumArea = 500.00f ;
float f32MaximumArea = 500000.00f ;
float f32MinimumConfidenceScore = 0.5f ;
if ((res = semanticSegmentationDL.Load(flsModelFilePath)).IsFail())
break ;
if ((res = fliSourceImage.Load("../../ExampleImages/SemanticSegmentation/Validation.flif" )).IsFail())
break ;
CAutoLabelerDL autoLabelerDL = new CAutoLabelerDL();
autoLabelerDL.Load(ref semanticSegmentationDL);
autoLabelerDL.SetSourceImage(ref fliSourceImage);
autoLabelerDL.EnableOverwriting(bOverwrite);
autoLabelerDL.EnableBatchProcessing(bBatchProcessing);
autoLabelerDL.SetLabelOptions(eLabelOption);
autoLabelerDL.SetMinimumScore(f32MinimumConfidenceScore);
autoLabelerDL.SetMinimumArea(f32MinimumArea);
autoLabelerDL.SetMaximumArea(f32MaximumArea);
autoLabelerDL.Execute();
if ((res = autoLabelerDL.Execute()).IsFail())
break ;
if ((res = fliSourceImage.Save("../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )).IsFail())
break ;
flsModelFilePath = "../../ExampleImages/SemanticSegmentation/SemanticSegmentation.flss"
fliSourceImage = CFLImage()
semanticSegmentationDL = CSemanticSegmentationDL()
bOverwrite = True
bBatchProcessing = False
eLabelOption = CAutoLabelerDL.ELabelOptions.RegionType_Contour
f32MinimumArea = 500.00
f32MaximumArea = 500000.00
f32MinimumConfidenceScore = 0.5
res = semanticSegmentationDL.Load(flsModelFilePath)
res = fliSourceImage.Load("../../ExampleImages/SemanticSegmentation/Validation.flif" )
autoLabelerDL = CAutoLabelerDL()
autoLabelerDL.Load(semanticSegmentationDL)
autoLabelerDL.SetSourceImage(fliSourceImage)
autoLabelerDL.EnableOverwriting(bOverwrite)
autoLabelerDL.EnableBatchProcessing(bBatchProcessing)
autoLabelerDL.SetLabelOptions(eLabelOption)
autoLabelerDL.SetMinimumScore(f32MinimumConfidenceScore)
autoLabelerDL.SetMinimumArea(f32MinimumArea)
autoLabelerDL.SetMaximumArea(f32MaximumArea)
autoLabelerDL.Execute()
autoLabelerDL.Execute()
fliSourceImage.Save("../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )
Instance Segmentation DL로 수행
C++
C#
Python
CResult res;
CFLString<wchar_t > flsModelFilePath = L"../../ExampleImages/SemanticSegmentation/InstanceSegmentation.flis" ;
CFLImage fliSourceImage;
CInstanceSegmentationDL instanceSegmentationDL;
bool bOverwrite = true ;
bool bBatchProcessing = false ;
CAutoLabelerDL::ELabelOptions eLabelOption = CAutoLabelerDL::ELabelOptions_RegionType_Contour;
float f32MinimumArea = 500.00f ;
float f32MaximumArea = 500000.00f ;
float f32MinimumConfidenceScore = 0.5f ;
if (IsFail (res = instanceSegmentationDL.Load (flsModelFilePath)))
break ;
if (IsFail (res = fliSourceImage.Load (L"../../ExampleImages/SemanticSegmentation/Validation.flif" )))
break ;
CAutoLabelerDL autoLabelerDL;
autoLabelerDL.Load (&instanceSegmentationDL);
autoLabelerDL.SetSourceImage (fliSourceImage);
autoLabelerDL.EnableOverwriting (bOverwrite);
autoLabelerDL.EnableBatchProcessing (bBatchProcessing);
autoLabelerDL.SetLabelOptions (eLabelOption);
autoLabelerDL.SetMinimumScore (f32MinimumConfidenceScore);
autoLabelerDL.SetMinimumArea (f32MinimumArea);
autoLabelerDL.SetMaximumArea (f32MaximumArea);
autoLabelerDL.Execute ();
if (IsFail (res = autoLabelerDL.Execute ()))
break ;
if (IsFail (res = fliSourceImage.Save (L"../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )))
break ;
CResult res = new CResult();
String flsModelFilePath = "../../ExampleImages/SemanticSegmentation/InstanceSegmentation.flis" ;
CFLImage fliSourceImage = new CFLImage();
CInstanceSegmentationDL instanceSegmentationDL = new CInstanceSegmentationDL();
bool bOverwrite = true ;
bool bBatchProcessing = false ;
CAutoLabelerDL.ELabelOptions eLabelOption = CAutoLabelerDL.ELabelOptions.RegionType_Contour;
float f32MinimumArea = 500.00f ;
float f32MaximumArea = 500000.00f ;
float f32MinimumConfidenceScore = 0.5f ;
if ((res = instanceSegmentationDL.Load(flsModelFilePath)).IsFail())
break ;
if ((res = fliSourceImage.Load("../../ExampleImages/SemanticSegmentation/Validation.flif" )).IsFail())
break ;
CAutoLabelerDL autoLabelerDL = new CAutoLabelerDL();
autoLabelerDL.Load(ref instanceSegmentationDL);
autoLabelerDL.SetSourceImage(ref fliSourceImage);
autoLabelerDL.EnableOverwriting(bOverwrite);
autoLabelerDL.EnableBatchProcessing(bBatchProcessing);
autoLabelerDL.SetLabelOptions(eLabelOption);
autoLabelerDL.SetMinimumScore(f32MinimumConfidenceScore);
autoLabelerDL.SetMinimumArea(f32MinimumArea);
autoLabelerDL.SetMaximumArea(f32MaximumArea);
autoLabelerDL.Execute();
if ((res = autoLabelerDL.Execute()).IsFail())
break ;
if ((res = fliSourceImage.Save("../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )).IsFail())
break ;
flsModelFilePath = "../../ExampleImages/SemanticSegmentation/InstanceSegmentation.flis"
fliSourceImage = CFLImage()
instanceSegmentationDL = CInstanceSegmentationDL()
bOverwrite = True
bBatchProcessing = False
eLabelOption = CAutoLabelerDL.ELabelOptions.RegionType_Contour
f32MinimumArea = 500.00
f32MaximumArea = 500000.00
f32MinimumConfidenceScore = 0.5
instanceSegmentationDL.Load(flsModelFilePath)
fliSourceImage.Load("../../ExampleImages/SemanticSegmentation/Validation.flif" )
autoLabelerDL = CAutoLabelerDL()
autoLabelerDL.Load(instanceSegmentationDL)
autoLabelerDL.SetSourceImage(fliSourceImage)
autoLabelerDL.EnableOverwriting(bOverwrite)
autoLabelerDL.EnableBatchProcessing(bBatchProcessing)
autoLabelerDL.SetLabelOptions(eLabelOption)
autoLabelerDL.SetMinimumScore(f32MinimumConfidenceScore)
autoLabelerDL.SetMinimumArea(f32MinimumArea)
autoLabelerDL.SetMaximumArea(f32MaximumArea)
autoLabelerDL.Execute()
fliSourceImage.Save("../../ExampleImages/SemanticSegmentation/AutoLabelResult.flif" )