- 标注:AI 预标注直写 labels_json(去候选确认两阶段);重叠去重(minIoU);全量标注按钮 - 训练:脚本迁移入 server/training/(Go 化 prepare_yolo/analyze_rfdetr,保留 train_server.py);tflite 产物自检并入训练流程(check_tflite) - 数据目录/权重不进 git;.gitignore 迁移至仓库根
65 lines
1.5 KiB
Dart
65 lines
1.5 KiB
Dart
class DetectionResult {
|
|
final String label;
|
|
final double score;
|
|
final double left;
|
|
final double top;
|
|
final double right;
|
|
final double bottom;
|
|
|
|
/// 轨迹已确认(多帧稳定/高分/活动确认),false = 候选,渲染为虚线
|
|
final bool confirmed;
|
|
|
|
/// 产出该框的模型(数据集 id 与名称;内置资产模型为 -1/空)
|
|
final int modelId;
|
|
final String modelName;
|
|
|
|
const DetectionResult({
|
|
required this.label,
|
|
required this.score,
|
|
required this.left,
|
|
required this.top,
|
|
required this.right,
|
|
required this.bottom,
|
|
this.confirmed = true,
|
|
this.modelId = -1,
|
|
this.modelName = '',
|
|
});
|
|
|
|
double get width => right - left;
|
|
double get height => bottom - top;
|
|
double get centerX => (left + right) / 2;
|
|
double get centerY => (top + bottom) / 2;
|
|
|
|
DetectionResult copyWith({
|
|
double? score,
|
|
double? left,
|
|
double? top,
|
|
double? right,
|
|
double? bottom,
|
|
bool? confirmed,
|
|
}) =>
|
|
DetectionResult(
|
|
label: label,
|
|
score: score ?? this.score,
|
|
left: left ?? this.left,
|
|
top: top ?? this.top,
|
|
right: right ?? this.right,
|
|
bottom: bottom ?? this.bottom,
|
|
confirmed: confirmed ?? this.confirmed,
|
|
modelId: modelId,
|
|
modelName: modelName,
|
|
);
|
|
}
|
|
|
|
class MotionRegion {
|
|
final double left;
|
|
final double top;
|
|
final double right;
|
|
final double bottom;
|
|
|
|
const MotionRegion(this.left, this.top, this.right, this.bottom);
|
|
|
|
double get centerX => (left + right) / 2;
|
|
double get centerY => (top + bottom) / 2;
|
|
}
|