File size: 4,060 Bytes
729628a
 
 
 
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
 
729628a
 
 
 
 
 
 
 
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
729628a
 
 
 
 
fb23187
 
 
 
729628a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fb23187
 
 
729628a
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import Typography from '@mui/material/Typography';
import type { QualityMetrics } from '../../types/labeleval';
import { SectionCard, fmtNum } from './shared';
import { Term } from '../help/InfoTip';

interface CheckRow {
  check: string;
  tolerance: string;
  observed: (m: QualityMetrics) => string;
  /** Glossary key explaining the check on hover. */
  term?: string;
}

/**
 * The geometric validation checks with their configured tolerances.
 * The API only exposes aggregate metrics, so the "observed" column surfaces
 * the closest aggregate where one exists.
 */
const CHECKS: CheckRow[] = [
  {
    check: 'Point-in-box ratio',
    tolerance: '≥ 0.60 of box volume occupied by LiDAR returns',
    observed: () => '— (per-annotation, see evidence panels)',
    term: 'point_in_box_ratio',
  },
  {
    check: 'Point density',
    tolerance: '≥ 5 pts/m³ at range-adjusted threshold',
    observed: () => '— (per-annotation, see evidence panels)',
    term: 'point_density',
  },
  {
    check: 'Occupancy',
    tolerance: 'No overlap > 0.30 IoU with another box of same class',
    observed: (m) => `mean 3D IoU ${fmtNum(m.global.mean_iou_3d)}`,
    term: 'iou_3d',
  },
  {
    check: 'Dimensions',
    tolerance: 'Within class prior ± 2.5σ (l, w, h)',
    observed: () => '— (per-annotation, see evidence panels)',
    term: 'dimension_error',
  },
  {
    check: 'Orientation',
    tolerance: '≤ 15° error vs. reference / motion heading',
    observed: (m) => `mean ${fmtNum(m.global.mean_orientation_error_deg, 1)}°`,
    term: 'orientation_error',
  },
  {
    check: 'Centroid',
    tolerance: '≤ 0.5 m position error vs. reference',
    observed: (m) => `mean ${fmtNum(m.global.mean_position_error)} m`,
    term: 'position_error',
  },
  {
    check: 'Ground contact',
    tolerance: 'Box bottom within ± 0.3 m of ground plane',
    observed: () => '— (per-annotation, see evidence panels)',
    term: 'ground_contact',
  },
  {
    check: 'Sensor consistency',
    tolerance: 'LiDAR vs. camera class/extent agreement required',
    observed: (m) => `anomaly rate ${(m.global.anomaly_rate * 100).toFixed(1)}%`,
    term: 'sensor_consistency',
  },
];

export default function StrictQualityValidation({ metrics }: { metrics: QualityMetrics | null }) {
  return (
    <SectionCard
      title="Strict Quality Validation — geometric gates"
      help="GT-free validation: every label is checked against physics and sensor evidence, no reference truth needed. Hover a check name for what it measures. Tolerances come from the active quality policy; per-annotation verdicts appear in each label's evidence panel and drive the geometric_validation gate in Triage."
    >
      <Typography variant="body2" sx={{ color: '#8a949e', mb: 1 }}>
        Every annotation must pass all applicable geometric checks. Failing any single gate flags the label — gates are
        never averaged away.
      </Typography>
      <Table size="small">
        <TableHead>
          <TableRow>
            <TableCell>Check</TableCell>
            <TableCell>Configured tolerance</TableCell>
            <TableCell align="right">Observed aggregate</TableCell>
          </TableRow>
        </TableHead>
        <TableBody>
          {CHECKS.map((c) => (
            <TableRow key={c.check} hover>
              <TableCell sx={{ fontWeight: 600 }}>
                {c.term ? <Term k={c.term}>{c.check}</Term> : c.check}
              </TableCell>
              <TableCell sx={{ color: '#aab4be', fontSize: 12 }}>{c.tolerance}</TableCell>
              <TableCell align="right" sx={{ fontFamily: 'monospace', fontSize: 12 }}>
                {metrics ? c.observed(metrics) : '—'}
              </TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    </SectionCard>
  );
}