AVIS / frontend /src /lib /constants.js
X2-0's picture
HF Clean Deploy
1c0c94d
Raw
History Blame Contribute Delete
2.15 kB
// Central interpretability copy β€” the difference between "raw" and "readable".
export const TYPE = {
HELMET_NON_COMPLIANCE: { label: 'No Helmet', icon: 'πŸͺ–' },
TRIPLE_RIDING: { label: 'Triple Riding', icon: 'πŸ‘₯' },
SEATBELT_NON_COMPLIANCE: { label: 'No Seatbelt', icon: 'πŸ”’' },
STOP_LINE_VIOLATION: { label: 'Stop-line Crossing', icon: 'πŸ›‘' },
RED_LIGHT_VIOLATION: { label: 'Red-light Violation', icon: '🚦' },
ILLEGAL_PARKING: { label: 'Illegal Parking', icon: 'πŸ…ΏοΈ' },
WRONG_SIDE_DRIVING: { label: 'Wrong-side Driving', icon: '↔️' },
}
export const ROUTE = {
auto_confirmed: {
label: 'Confirmed', variant: 'ok', note: 'auto',
action: 'Auto-confirmed e-challan',
},
vlm_confirmed: {
label: 'Confirmed', variant: 'ok', note: 'AI-verified',
action: 'Confirmed after AI verification',
},
human_review: {
label: 'Needs review', variant: 'warn', note: '',
action: 'Routed to a human reviewer',
},
abstain: {
label: 'No determination', variant: 'mute', note: '',
action: 'Abstained β€” evidence insufficient',
},
}
// What each evidence-sufficiency tier means, in plain English.
export const TIER_INFO = {
A: 'Appearance β€” provable from the photo alone (e.g. helmet, triple riding). May auto-confirm.',
B: 'Hard appearance β€” e.g. seatbelt; unreliable from a traffic cam, so always verified before issuing.',
C: 'Spatial β€” needs per-camera calibration (stop-line, red-light, parking). Never auto-confirmed.',
D: 'Temporal β€” needs video to prove (wrong-side driving). A single frame abstains by design.',
}
export const SUFFICIENCY_INFO = {
sufficient: 'The evidence is strong enough to stand on its own.',
candidate: 'A credible candidate that still needs confirmation.',
insufficient: 'Not enough evidence in this photo to decide β€” the system abstained.',
}
export const typeInfo = (t) => TYPE[t] || { label: t, icon: '⚠️' }
export const routeInfo = (r) => ROUTE[r] || { label: r, variant: 'mute', note: '', action: r }
// Chart palette
export const PALETTE = ['#2563eb', '#16a34a', '#d97706', '#64748b', '#9333ea', '#dc2626', '#0891b2']