namespace OrpaonVision.Model.Training; /// /// 训练任务模型。 /// public sealed class TrainingTaskModel { /// /// 任务ID。 /// public Guid Id { get; set; } /// /// 任务名称。 /// public string Name { get; set; } = string.Empty; /// /// 任务描述。 /// public string? Description { get; set; } /// /// 任务类型。 /// public TrainingTaskType TaskType { get; set; } /// /// 任务状态。 /// public TrainingTaskStatus Status { get; set; } /// /// 优先级。 /// public TrainingPriority Priority { get; set; } /// /// 模型类型。 /// public string ModelType { get; set; } = string.Empty; /// /// 基础模型ID。 /// public Guid? BaseModelId { get; set; } /// /// 数据集ID。 /// public Guid DatasetId { get; set; } /// /// 训练参数JSON。 /// public string TrainingParametersJson { get; set; } = string.Empty; /// /// 验证参数JSON。 /// public string ValidationParametersJson { get; set; } = string.Empty; /// /// 计划开始时间(UTC)。 /// public DateTime? PlannedStartAtUtc { get; set; } /// /// 实际开始时间(UTC)。 /// public DateTime? ActualStartAtUtc { get; set; } /// /// 实际结束时间(UTC)。 /// public DateTime? ActualEndAtUtc { get; set; } /// /// 计划训练时长(分钟)。 /// public int PlannedDurationMinutes { get; set; } /// /// 实际训练时长(分钟)。 /// public int ActualDurationMinutes { get; set; } /// /// 当前轮次。 /// public int CurrentEpoch { get; set; } /// /// 总轮次。 /// public int TotalEpochs { get; set; } /// /// 当前损失值。 /// public double CurrentLoss { get; set; } /// /// 最佳损失值。 /// public double BestLoss { get; set; } /// /// 当前mAP。 /// public double CurrentMap { get; set; } /// /// 最佳mAP。 /// public double BestMap { get; set; } /// /// 训练进度(0-100)。 /// public double Progress { get; set; } /// /// 输出模型路径。 /// public string? OutputModelPath { get; set; } /// /// 日志路径。 /// public string? LogPath { get; set; } /// /// 错误消息。 /// public string? ErrorMessage { get; set; } /// /// 创建人ID。 /// public Guid CreatedById { get; set; } /// /// 创建人姓名。 /// public string CreatedByName { get; set; } = string.Empty; /// /// 分配人ID。 /// public Guid? AssignedToId { get; set; } /// /// 分配人姓名。 /// public string? AssignedToName { get; set; } /// /// 创建时间(UTC)。 /// public DateTime CreatedAtUtc { get; set; } /// /// 更新时间(UTC)。 /// public DateTime UpdatedAtUtc { get; set; } /// /// 创建人。 /// public string CreatedBy { get; set; } = string.Empty; /// /// 更新人。 /// public string UpdatedBy { get; set; } = string.Empty; /// /// 备注。 /// public string? Remark { get; set; } } /// /// 训练任务类型枚举。 /// public enum TrainingTaskType { /// /// 目标检测训练。 /// ObjectDetection = 0, /// /// 分类训练。 /// Classification = 1, /// /// 分割训练。 /// Segmentation = 2, /// /// 微调训练。 /// FineTuning = 3, /// /// 增量训练。 /// Incremental = 4 } /// /// 训练任务状态枚举。 /// public enum TrainingTaskStatus { /// /// 草稿。 /// Draft = 0, /// /// 等待中。 /// Pending = 1, /// /// 运行中。 /// Running = 2, /// /// 已暂停。 /// Paused = 3, /// /// 已完成。 /// Completed = 4, /// /// 已失败。 /// Failed = 5, /// /// 已取消。 /// Cancelled = 6 } /// /// 训练优先级枚举。 /// public enum TrainingPriority { /// /// 低。 /// Low = 0, /// /// 中。 /// Medium = 1, /// /// 高。 /// High = 2, /// /// 紧急。 /// Urgent = 3 }