AIFotoOnlus/src/AIFotoONLUS.Core/ModelConfiguration.cs

64 lines
2.5 KiB
C#
Raw Normal View History

using OpenCvSharp;
namespace AIFotoONLUS.Core
{
/// <summary>
/// Configuration options that control model file locations, input sizes
/// and runtime thresholds used by <see cref="NumberRecognitionEngine"/>.
/// </summary>
public class ModelConfiguration
{
/// <summary>
/// Path to the Darknet configuration (.cfg) file for the detection network.
/// </summary>
public string DetectionCfg { get; set; } = "models/detection.cfg";
/// <summary>
/// Path to the Darknet weights (.weights) file for the detection network.
/// </summary>
public string DetectionWeights { get; set; } = "models/detection.weights";
/// <summary>
/// Path to the Darknet configuration (.cfg) file for the recognition network.
/// </summary>
public string RecognitionCfg { get; set; } = "models/recognition.cfg";
/// <summary>
/// Path to the Darknet weights (.weights) file for the recognition network.
/// </summary>
public string RecognitionWeights { get; set; } = "models/recognition.weights";
/// <summary>
/// Confidence threshold used to filter out low-probability detections.
/// </summary>
public double ConfidenceThreshold { get; set; } = 0.5;
/// <summary>
/// Non-maximum suppression (NMS) IoU threshold used to remove overlapping
/// detection boxes.
/// </summary>
public double NmsThreshold { get; set; } = 0.4;
/// <summary>
/// Input size used when preparing the blob for the detection network.
/// </summary>
public Size DetectionInputSize { get; set; } = new Size(416, 416);
/// <summary>
/// Input size used when preparing the blob for the recognition network.
/// </summary>
public Size RecognitionInputSize { get; set; } = new Size(140, 120);
/// <summary>
/// Labels representing digit classes in the recognition model. The order
/// must match the class ordering used by the trained recognition network.
/// </summary>
public string[] NumberClasses { get; set; } = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
/// <summary>
/// When enabled, recognition crops will be saved to disk under
/// "logs/crops" for diagnostic inspection. Disabled by default.
/// </summary>
public bool EnableCropSaving { get; set; } = false;
}
}