修改日志1

This commit is contained in:
TD
2025-04-15 09:24:39 +08:00
parent 72b67b6a2f
commit b009a7355b
4 changed files with 56 additions and 66 deletions

View File

@ -171,41 +171,10 @@ namespace DH.Devices.Vision
// LogAsync(DateTime.Now, LogLevel.Information, $"{detectConfig.Name} 产品{detectResult.TempPid} RunInference BEGIN");
mlWatch.Start();
//20230802改成多线程推理 RunInferenceFixed
// MLResult result = new MLResult();
var result = mlSet.StationMLEngine.RunInference(req);
// var result = mlSet.StationMLEngine.RunInferenceFixed(req);
mlWatch.Stop();
// LogAsync(DateTime.Now, LogLevel.Information, $"{detectConfig.Name} 产品{detectResult.TempPid} RunInference END");
// var req = new MLRequest();
//req.mImage = inferenceImage;
//req.ResizeWidth = detectConfig.ModelWidth;
//req.ResizeHeight = detectConfig.ModelHeight;
//req.confThreshold = detectConfig.ModelconfThreshold;
//req.iouThreshold = 0.3f;
//req.out_node_name = "output0";
//req.in_lable_path = detectConfig.in_lable_path;
//Stopwatch sw = Stopwatch.StartNew();
//var result = Dectection[detectionId].RunInference(req);
//sw.Stop();
//LogAsync(DateTime.Now, LogLevel.Information, $"{camera.Name} 推理进度1.1,产品{productNumber},耗时{sw.ElapsedMilliseconds}ms");
//this.BeginInvoke(new MethodInvoker(delegate ()
//{
// // pictureBox1.Image?.Dispose(); // 释放旧图像
// // pictureBox1.Image = result.ResultMap;
// richTextBox1.AppendText($"推理成功 {productNumber}, {result.IsSuccess}相机名字{camera.CameraName} 耗时 {mlWatch.ElapsedMilliseconds}ms\n");
//}));
//req.mImage?.Dispose();
@ -269,22 +238,22 @@ namespace DH.Devices.Vision
}
//foreach (IGrouping<ResultState, DetectionFilter> group in conditionList)
//{
// bool b = group.ToList().Any(f =>
// {
// return f.FilterOperation(d);
// });
foreach (IGrouping<ResultState, DetectionLable> 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;
}
//}
}
});
#endregion
#region 5.NG