提交
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
using DH.Commons.Enums;
|
||||
using DH.Devices.Devices;
|
||||
using DH.Commons.Base;
|
||||
using DH.Commons.Enums;
|
||||
using DH.UI.Model.Winform;
|
||||
using HalconDotNet;
|
||||
using OpenCvSharp;
|
||||
@ -15,7 +15,7 @@ using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
using XKRS.UI.Model.Winform;
|
||||
using static DH.Commons.Enums.EnumHelper;
|
||||
using ResultState = DH.Commons.Enums.ResultState;
|
||||
using ResultState = DH.Commons.Base.ResultState;
|
||||
|
||||
|
||||
namespace DH.Devices.Vision
|
||||
@ -113,7 +113,7 @@ namespace DH.Devices.Vision
|
||||
// req.Score = IIConfig.Score;
|
||||
req.mImage = originImgSet.Clone();
|
||||
|
||||
req.in_lable_path = detectConfig.in_lable_path;
|
||||
req.in_lable_path = detectConfig.In_lable_path;
|
||||
|
||||
req.confThreshold = detectConfig.ModelconfThreshold;
|
||||
req.iouThreshold = 0.3f;
|
||||
@ -121,16 +121,16 @@ namespace DH.Devices.Vision
|
||||
req.out_node_name = "output0";
|
||||
switch (detectConfig.ModelType)
|
||||
{
|
||||
case MLModelType.ImageClassification:
|
||||
case ModelType.图像分类:
|
||||
break;
|
||||
case MLModelType.ObjectDetection:
|
||||
case ModelType.目标检测:
|
||||
|
||||
break;
|
||||
case MLModelType.SemanticSegmentation:
|
||||
case ModelType.语义分割:
|
||||
break;
|
||||
case MLModelType.InstanceSegmentation:
|
||||
case ModelType.实例分割:
|
||||
break;
|
||||
case MLModelType.ObjectGPUDetection:
|
||||
case ModelType.目标检测GPU:
|
||||
|
||||
break;
|
||||
default:
|
||||
@ -213,53 +213,53 @@ namespace DH.Devices.Vision
|
||||
// .OrderBy(u => u.Key)
|
||||
// .ToList();
|
||||
//当前检测项的 过滤条件
|
||||
var conditionList = detectConfig.DetectionFilterList
|
||||
.Where(u => u.IsEnabled && u.LabelName == d.LabelName)
|
||||
.GroupBy(u => u.ResultState)
|
||||
.OrderBy(u => u.Key)
|
||||
.ToList();
|
||||
//var conditionList = detectConfig.DetectionFilterList
|
||||
// .Where(u => u.IsEnabled && u.LabelName == d.LabelName)
|
||||
// .GroupBy(u => u.ResultState)
|
||||
// .OrderBy(u => u.Key)
|
||||
// .ToList();
|
||||
|
||||
if (conditionList.Count == 0)
|
||||
{
|
||||
//if (conditionList.Count == 0)
|
||||
//{
|
||||
|
||||
d.FinalResult = d.LabelName.ToLower() == "ok"
|
||||
? ResultState.OK
|
||||
: ResultState.DetectNG;
|
||||
}
|
||||
else
|
||||
{
|
||||
d.FinalResult = detectConfig.IsMixModel
|
||||
? ResultState.A_NG
|
||||
: ResultState.OK;
|
||||
// d.FinalResult = d.LabelName.ToLower() == "ok"
|
||||
// ? ResultState.OK
|
||||
// : ResultState.DetectNG;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// d.FinalResult = detectConfig.IsMixModel
|
||||
// ? ResultState.A_NG
|
||||
// : ResultState.OK;
|
||||
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
foreach (IGrouping<ResultState, DetectionFilter> group in conditionList)
|
||||
{
|
||||
//bool b = group.ToList().Any(f =>
|
||||
//{
|
||||
// return f.FilterOperation(d);
|
||||
//});
|
||||
//foreach (IGrouping<ResultState, DetectionFilter> group in conditionList)
|
||||
//{
|
||||
// //bool b = group.ToList().Any(f =>
|
||||
// //{
|
||||
// // return f.FilterOperation(d);
|
||||
// //});
|
||||
|
||||
|
||||
//if (b)
|
||||
//{
|
||||
// d.FinalResult = group.Key;
|
||||
// break;
|
||||
//}
|
||||
// //if (b)
|
||||
// //{
|
||||
// // d.FinalResult = group.Key;
|
||||
// // break;
|
||||
// //}
|
||||
|
||||
if (group.Any(f => f.FilterOperation(d)))
|
||||
{
|
||||
d.FinalResult = group.Key;
|
||||
break;
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// d.FinalResult = d.InferenceResult = ResultState.OK;
|
||||
//}
|
||||
}
|
||||
// if (group.Any(f => f.FilterOperation(d)))
|
||||
// {
|
||||
// d.FinalResult = group.Key;
|
||||
// break;
|
||||
// }
|
||||
// //else
|
||||
// //{
|
||||
// // d.FinalResult = d.InferenceResult = ResultState.OK;
|
||||
// //}
|
||||
//}
|
||||
});
|
||||
#endregion
|
||||
#region 5.统计缺陷过滤结果或预处理直接NG
|
||||
@ -395,18 +395,18 @@ namespace DH.Devices.Vision
|
||||
// 根据算法类型创建不同的实例
|
||||
switch (dc.ModelType)
|
||||
{
|
||||
case MLModelType.ImageClassification:
|
||||
case ModelType.图像分类:
|
||||
break;
|
||||
case MLModelType.ObjectDetection:
|
||||
case ModelType.目标检测:
|
||||
mLEngineSet.StationMLEngine = new SimboObjectDetection();
|
||||
break;
|
||||
case MLModelType.SemanticSegmentation:
|
||||
case ModelType.语义分割:
|
||||
|
||||
break;
|
||||
case MLModelType.InstanceSegmentation:
|
||||
case ModelType.实例分割:
|
||||
mLEngineSet.StationMLEngine = new SimboInstanceSegmentation();
|
||||
break;
|
||||
case MLModelType.ObjectGPUDetection:
|
||||
case ModelType.目标检测GPU:
|
||||
mLEngineSet.StationMLEngine = new SimboDetection();
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user