-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
114 lines (98 loc) · 2.74 KB
/
types.ts
File metadata and controls
114 lines (98 loc) · 2.74 KB
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
111
112
113
114
export interface Location {
latitude: number;
longitude: number;
}
export interface Point {
x: number;
y: number;
}
export interface BoundingBox {
x_min: number;
y_min: number;
x_max: number;
y_max: number;
}
export interface Dimensions {
length_m: number; // in meters
width_m: number; // in meters
depth_m?: number; // Estimated depth for potholes, in meters
}
export interface Defect {
type: 'Pothole' | 'Rutting' | 'Alligator Crack' | 'Roughness' | 'Distress' | 'Longitudinal Crack' | 'Transverse Crack' | 'Block Crack';
boundingBox: BoundingBox;
segmentationPolygon?: Point[]; // Added for Deep Segmentation
centerlinePath?: Point[]; // Added for Crack Path Analysis
dimensions?: Dimensions;
area_sq_m?: number; // in square meters
volume_m3?: number; // Volume in cubic meters
severity?: 'Low' | 'Medium' | 'High';
description: string;
confidence?: number;
location?: Location;
perimeter_m?: number; // For high-fidelity segmentation, in meters
circularity?: number; // For high-fidelity segmentation
instanceId?: number; // For Instance Segmentation
}
export interface GroundTruthDefect {
type: string;
boundingBox: BoundingBox;
}
export interface ClassMetrics {
tp: number;
fp: number;
fn: number;
precision: number;
recall: number;
f1Score: number;
totalGroundTruth: number;
}
export interface ValidationMetrics {
matches: number; // True Positives
misses: number; // False Negatives
falsePositives: number; // False Positives
averageIou: number;
precision: number;
recall: number;
f1Score: number;
perClassMetrics: Record<string, ClassMetrics>;
}
export interface AnalysisResult {
defects: Defect[];
location?: Location;
pothole_count?: number; // For instance segmentation
pothole_density_sq_m?: number; // For instance segmentation
groundTruth?: GroundTruthDefect[];
validationMetrics?: ValidationMetrics;
}
export interface AreaHealthAssessment extends AnalysisResult {
pciScore: number; // Pavement Condition Index (0-100)
summary: string;
potentialCauses: string[];
recommendations: string[];
}
export interface SatelliteAnalysisResult {
location_analyzed: string;
assessmentSummary: string;
slabSettlement_mm_yr: number;
deteriorationIndex: number; // Score out of 10
subsurfaceMoistureRisk: 'Low' | 'Medium' | 'High';
}
export interface VideoDefect extends Defect {
timestamp: number; // in seconds from video start
}
export interface GpxPoint {
lat: number;
lon: number;
time: Date;
}
// FIX: Added ResearchSource and ResearchResult types for the research feature.
export interface ResearchSource {
web?: {
uri: string;
title: string;
};
}
export interface ResearchResult {
answer: string;
sources: ResearchSource[];
}