opticedge-types 1.0.62 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/instant.d.ts +17 -24
- package/dist/types/instant.js +3 -3
- package/package.json +1 -1
- package/src/types/instant.ts +63 -110
package/dist/types/instant.d.ts
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
export type SubmissionStatus = 'REJECTED' | 'ACCEPTED';
|
|
2
|
-
export interface RejectedResponse {
|
|
3
|
-
submission_status: 'REJECTED';
|
|
4
|
-
rejection_message: string;
|
|
5
|
-
}
|
|
6
|
-
export interface AcceptedResponse {
|
|
7
|
-
submission_status: 'ACCEPTED';
|
|
8
|
-
validation: ValidationResult;
|
|
9
|
-
overall_grade: number;
|
|
10
|
-
front_subgrades: SubGrades;
|
|
11
|
-
back_subgrades: SubGrades;
|
|
12
|
-
environment_score: number;
|
|
13
|
-
accuracy_score: number;
|
|
14
|
-
grading_rationale: string;
|
|
15
|
-
defect_map: DefectMap;
|
|
16
|
-
}
|
|
17
1
|
type SameCardConfidence = 'high' | 'medium' | 'low';
|
|
18
2
|
type ImageQuality = 'good' | 'borderline' | 'poor';
|
|
19
3
|
interface ValidationResult {
|
|
@@ -28,26 +12,35 @@ export interface SubGrades {
|
|
|
28
12
|
edges: number;
|
|
29
13
|
corners: number;
|
|
30
14
|
}
|
|
31
|
-
|
|
32
|
-
export type DefectType = 'corner_whitening' | 'edge_whitening' | 'surface_scratch' | 'holo_or_foil_scratching' | 'crease' | 'foil_wear' | 'edge_chip' | 'corner_rounding' | 'staining_or_ink_bleed' | 'post_factory_dents' | 'scuffing';
|
|
33
|
-
export interface BoundingBox {
|
|
15
|
+
interface BBox {
|
|
34
16
|
x: number;
|
|
35
17
|
y: number;
|
|
36
18
|
width: number;
|
|
37
19
|
height: number;
|
|
38
20
|
}
|
|
39
|
-
|
|
21
|
+
type DefectType = 'corner_whitening' | 'edge_whitening' | 'surface_scratch' | 'holo_or_foil_scratching' | 'crease' | 'foil_wear' | 'edge_chip' | 'corner_rounding' | 'staining_or_ink_bleed' | 'post_factory_dents' | 'scuffing';
|
|
22
|
+
type DefectSeverity = 'minimal' | 'moderate' | 'major';
|
|
23
|
+
type DefectLocationZone = 'front_top_left_corner' | 'front_top_right_corner' | 'front_bottom_left_corner' | 'front_bottom_right_corner' | 'front_top_edge_left' | 'front_top_edge_center' | 'front_top_edge_right' | 'front_bottom_edge_left' | 'front_bottom_edge_center' | 'front_bottom_edge_right' | 'front_left_edge_upper' | 'front_left_edge_center' | 'front_left_edge_lower' | 'front_right_edge_upper' | 'front_right_edge_center' | 'front_right_edge_lower' | 'front_inner_top_left' | 'front_inner_top_center' | 'front_inner_top_right' | 'front_inner_middle_left' | 'front_inner_middle_center' | 'front_inner_middle_right' | 'front_inner_bottom_left' | 'front_inner_bottom_center' | 'front_inner_bottom_right' | 'back_top_left_corner' | 'back_top_right_corner' | 'back_bottom_left_corner' | 'back_bottom_right_corner' | 'back_top_edge_left' | 'back_top_edge_center' | 'back_top_edge_right' | 'back_bottom_edge_left' | 'back_bottom_edge_center' | 'back_bottom_edge_right' | 'back_left_edge_upper' | 'back_left_edge_center' | 'back_left_edge_lower' | 'back_right_edge_upper' | 'back_right_edge_center' | 'back_right_edge_lower' | 'back_inner_top_left' | 'back_inner_top_center' | 'back_inner_top_right' | 'back_inner_middle_left' | 'back_inner_middle_center' | 'back_inner_middle_right' | 'back_inner_bottom_left' | 'back_inner_bottom_center' | 'back_inner_bottom_right';
|
|
24
|
+
interface Defect {
|
|
40
25
|
defect_type: DefectType;
|
|
41
26
|
severity: DefectSeverity;
|
|
42
27
|
confidence: number;
|
|
43
|
-
location_zone:
|
|
44
|
-
bbox_norm:
|
|
28
|
+
location_zone: DefectLocationZone;
|
|
29
|
+
bbox_norm: BBox;
|
|
45
30
|
notes: string;
|
|
46
31
|
}
|
|
47
32
|
export interface DefectMap {
|
|
48
33
|
front: Defect[];
|
|
49
34
|
back: Defect[];
|
|
50
35
|
}
|
|
51
|
-
export
|
|
52
|
-
|
|
36
|
+
export interface PromptGradingResult {
|
|
37
|
+
validation: ValidationResult;
|
|
38
|
+
overall_grade: number;
|
|
39
|
+
front_subgrades: SubGrades;
|
|
40
|
+
back_subgrades: SubGrades;
|
|
41
|
+
environment_score: number;
|
|
42
|
+
accuracy_score: number;
|
|
43
|
+
grading_rationale: string;
|
|
44
|
+
defect_map: DefectMap;
|
|
45
|
+
}
|
|
53
46
|
export {};
|
package/dist/types/instant.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
// --------------------
|
|
3
|
+
// Validation
|
|
4
|
+
// --------------------
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
CHANGED
package/src/types/instant.ts
CHANGED
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
/* --------------------------------------------- */
|
|
2
|
-
/* Submission Status */
|
|
3
|
-
/* --------------------------------------------- */
|
|
4
|
-
|
|
5
|
-
export type SubmissionStatus = 'REJECTED' | 'ACCEPTED'
|
|
6
|
-
|
|
7
|
-
/* --------------------------------------------- */
|
|
8
|
-
/* REJECTED RESPONSE */
|
|
9
|
-
/* --------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
export interface RejectedResponse {
|
|
12
|
-
submission_status: 'REJECTED'
|
|
13
|
-
rejection_message: string // single sentence, <200 chars
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* --------------------------------------------- */
|
|
17
|
-
/* ACCEPTED RESPONSE */
|
|
18
|
-
/* --------------------------------------------- */
|
|
19
|
-
|
|
20
|
-
export interface AcceptedResponse {
|
|
21
|
-
submission_status: 'ACCEPTED'
|
|
22
|
-
|
|
23
|
-
validation: ValidationResult
|
|
24
|
-
|
|
25
|
-
overall_grade: number // 1.0–10.0
|
|
26
|
-
|
|
27
|
-
front_subgrades: SubGrades
|
|
28
|
-
back_subgrades: SubGrades
|
|
29
|
-
|
|
30
|
-
environment_score: number // 0–100
|
|
31
|
-
accuracy_score: number // 0–100
|
|
32
|
-
|
|
33
|
-
grading_rationale: string
|
|
34
|
-
|
|
35
|
-
defect_map: DefectMap
|
|
36
|
-
}
|
|
37
|
-
|
|
38
1
|
// --------------------
|
|
39
2
|
// Validation
|
|
40
3
|
// --------------------
|
|
@@ -53,24 +16,29 @@ interface ValidationResult {
|
|
|
53
16
|
damage_override_triggered: boolean
|
|
54
17
|
}
|
|
55
18
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
19
|
+
// --------------------
|
|
20
|
+
// Subgrades
|
|
21
|
+
// --------------------
|
|
59
22
|
|
|
60
23
|
export interface SubGrades {
|
|
61
|
-
centering: number
|
|
24
|
+
centering: number
|
|
62
25
|
surface: number
|
|
63
26
|
edges: number
|
|
64
27
|
corners: number
|
|
65
28
|
}
|
|
66
29
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
30
|
+
// --------------------
|
|
31
|
+
// Defect Models
|
|
32
|
+
// --------------------
|
|
70
33
|
|
|
71
|
-
|
|
34
|
+
interface BBox {
|
|
35
|
+
x: number
|
|
36
|
+
y: number
|
|
37
|
+
width: number
|
|
38
|
+
height: number
|
|
39
|
+
}
|
|
72
40
|
|
|
73
|
-
|
|
41
|
+
type DefectType =
|
|
74
42
|
| 'corner_whitening'
|
|
75
43
|
| 'edge_whitening'
|
|
76
44
|
| 'surface_scratch'
|
|
@@ -83,96 +51,53 @@ export type DefectType =
|
|
|
83
51
|
| 'post_factory_dents'
|
|
84
52
|
| 'scuffing'
|
|
85
53
|
|
|
86
|
-
|
|
87
|
-
x: number // 0.0–1.0
|
|
88
|
-
y: number // 0.0–1.0
|
|
89
|
-
width: number // ≥0.01
|
|
90
|
-
height: number // ≥0.01
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface Defect {
|
|
94
|
-
defect_type: DefectType
|
|
95
|
-
severity: DefectSeverity
|
|
96
|
-
confidence: number // 0–1 recommended
|
|
97
|
-
location_zone: LocationZone
|
|
98
|
-
bbox_norm: BoundingBox
|
|
99
|
-
notes: string
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export interface DefectMap {
|
|
103
|
-
front: Defect[]
|
|
104
|
-
back: Defect[]
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* --------------------------------------------- */
|
|
108
|
-
/* LOCATION ZONES */
|
|
109
|
-
/* --------------------------------------------- */
|
|
54
|
+
type DefectSeverity = 'minimal' | 'moderate' | 'major'
|
|
110
55
|
|
|
111
|
-
|
|
112
|
-
// FRONT
|
|
56
|
+
type DefectLocationZone =
|
|
57
|
+
// ---- FRONT ----
|
|
113
58
|
| 'front_top_left_corner'
|
|
114
59
|
| 'front_top_right_corner'
|
|
115
60
|
| 'front_bottom_left_corner'
|
|
116
61
|
| 'front_bottom_right_corner'
|
|
117
|
-
|
|
118
|
-
// BACK — Corners
|
|
119
|
-
| 'back_top_left_corner'
|
|
120
|
-
| 'back_top_right_corner'
|
|
121
|
-
| 'back_bottom_left_corner'
|
|
122
|
-
| 'back_bottom_right_corner'
|
|
123
|
-
|
|
124
|
-
// FRONT — Top Edge
|
|
125
62
|
| 'front_top_edge_left'
|
|
126
63
|
| 'front_top_edge_center'
|
|
127
64
|
| 'front_top_edge_right'
|
|
128
|
-
|
|
129
|
-
// FRONT — Bottom Edge
|
|
130
65
|
| 'front_bottom_edge_left'
|
|
131
66
|
| 'front_bottom_edge_center'
|
|
132
67
|
| 'front_bottom_edge_right'
|
|
133
|
-
|
|
134
|
-
// FRONT — Left Edge
|
|
135
68
|
| 'front_left_edge_upper'
|
|
136
69
|
| 'front_left_edge_center'
|
|
137
70
|
| 'front_left_edge_lower'
|
|
138
|
-
|
|
139
|
-
// FRONT — Right Edge
|
|
140
71
|
| 'front_right_edge_upper'
|
|
141
72
|
| 'front_right_edge_center'
|
|
142
73
|
| 'front_right_edge_lower'
|
|
74
|
+
| 'front_inner_top_left'
|
|
75
|
+
| 'front_inner_top_center'
|
|
76
|
+
| 'front_inner_top_right'
|
|
77
|
+
| 'front_inner_middle_left'
|
|
78
|
+
| 'front_inner_middle_center'
|
|
79
|
+
| 'front_inner_middle_right'
|
|
80
|
+
| 'front_inner_bottom_left'
|
|
81
|
+
| 'front_inner_bottom_center'
|
|
82
|
+
| 'front_inner_bottom_right'
|
|
143
83
|
|
|
144
|
-
// BACK
|
|
84
|
+
// ---- BACK ----
|
|
85
|
+
| 'back_top_left_corner'
|
|
86
|
+
| 'back_top_right_corner'
|
|
87
|
+
| 'back_bottom_left_corner'
|
|
88
|
+
| 'back_bottom_right_corner'
|
|
145
89
|
| 'back_top_edge_left'
|
|
146
90
|
| 'back_top_edge_center'
|
|
147
91
|
| 'back_top_edge_right'
|
|
148
|
-
|
|
149
|
-
// BACK — Bottom Edge
|
|
150
92
|
| 'back_bottom_edge_left'
|
|
151
93
|
| 'back_bottom_edge_center'
|
|
152
94
|
| 'back_bottom_edge_right'
|
|
153
|
-
|
|
154
|
-
// BACK — Left Edge
|
|
155
95
|
| 'back_left_edge_upper'
|
|
156
96
|
| 'back_left_edge_center'
|
|
157
97
|
| 'back_left_edge_lower'
|
|
158
|
-
|
|
159
|
-
// BACK — Right Edge
|
|
160
98
|
| 'back_right_edge_upper'
|
|
161
99
|
| 'back_right_edge_center'
|
|
162
100
|
| 'back_right_edge_lower'
|
|
163
|
-
|
|
164
|
-
// FRONT — Interior
|
|
165
|
-
| 'front_inner_top_left'
|
|
166
|
-
| 'front_inner_top_center'
|
|
167
|
-
| 'front_inner_top_right'
|
|
168
|
-
| 'front_inner_middle_left'
|
|
169
|
-
| 'front_inner_middle_center'
|
|
170
|
-
| 'front_inner_middle_right'
|
|
171
|
-
| 'front_inner_bottom_left'
|
|
172
|
-
| 'front_inner_bottom_center'
|
|
173
|
-
| 'front_inner_bottom_right'
|
|
174
|
-
|
|
175
|
-
// BACK — Interior
|
|
176
101
|
| 'back_inner_top_left'
|
|
177
102
|
| 'back_inner_top_center'
|
|
178
103
|
| 'back_inner_top_right'
|
|
@@ -183,8 +108,36 @@ export type LocationZone =
|
|
|
183
108
|
| 'back_inner_bottom_center'
|
|
184
109
|
| 'back_inner_bottom_right'
|
|
185
110
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
111
|
+
interface Defect {
|
|
112
|
+
defect_type: DefectType
|
|
113
|
+
severity: DefectSeverity
|
|
114
|
+
confidence: number
|
|
115
|
+
location_zone: DefectLocationZone
|
|
116
|
+
bbox_norm: BBox
|
|
117
|
+
notes: string
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface DefectMap {
|
|
121
|
+
front: Defect[]
|
|
122
|
+
back: Defect[]
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// --------------------
|
|
126
|
+
// Main Prompt Result
|
|
127
|
+
// --------------------
|
|
189
128
|
|
|
190
|
-
export
|
|
129
|
+
export interface PromptGradingResult {
|
|
130
|
+
validation: ValidationResult
|
|
131
|
+
|
|
132
|
+
overall_grade: number
|
|
133
|
+
|
|
134
|
+
front_subgrades: SubGrades
|
|
135
|
+
back_subgrades: SubGrades
|
|
136
|
+
|
|
137
|
+
environment_score: number
|
|
138
|
+
accuracy_score: number
|
|
139
|
+
|
|
140
|
+
grading_rationale: string
|
|
141
|
+
|
|
142
|
+
defect_map: DefectMap
|
|
143
|
+
}
|