@camstack/types 1.2.359 → 1.2.360

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.
@@ -1070,6 +1070,15 @@ export declare const RetrainBoxReviewSchema: z.ZodObject<{
1070
1070
  score: z.ZodOptional<z.ZodNumber>;
1071
1071
  modelId: z.ZodOptional<z.ZodString>;
1072
1072
  }, z.core.$strip>>;
1073
+ macroClass: z.ZodOptional<z.ZodEnum<{
1074
+ animal: "animal";
1075
+ face: "face";
1076
+ package: "package";
1077
+ person: "person";
1078
+ plate: "plate";
1079
+ vehicle: "vehicle";
1080
+ }>>;
1081
+ label: z.ZodOptional<z.ZodString>;
1073
1082
  iou: z.ZodOptional<z.ZodNumber>;
1074
1083
  }, z.core.$strip>;
1075
1084
  export type RetrainBoxReview = z.infer<typeof RetrainBoxReviewSchema>;
@@ -1112,6 +1121,15 @@ export declare const RetrainFrameReviewSchema: z.ZodObject<{
1112
1121
  score: z.ZodOptional<z.ZodNumber>;
1113
1122
  modelId: z.ZodOptional<z.ZodString>;
1114
1123
  }, z.core.$strip>>;
1124
+ macroClass: z.ZodOptional<z.ZodEnum<{
1125
+ animal: "animal";
1126
+ face: "face";
1127
+ package: "package";
1128
+ person: "person";
1129
+ plate: "plate";
1130
+ vehicle: "vehicle";
1131
+ }>>;
1132
+ label: z.ZodOptional<z.ZodString>;
1115
1133
  iou: z.ZodOptional<z.ZodNumber>;
1116
1134
  }, z.core.$strip>>>;
1117
1135
  summary: z.ZodObject<{
@@ -1471,6 +1489,15 @@ export declare const RetrainFrameSchema: z.ZodObject<{
1471
1489
  score: z.ZodOptional<z.ZodNumber>;
1472
1490
  modelId: z.ZodOptional<z.ZodString>;
1473
1491
  }, z.core.$strip>>;
1492
+ macroClass: z.ZodOptional<z.ZodEnum<{
1493
+ animal: "animal";
1494
+ face: "face";
1495
+ package: "package";
1496
+ person: "person";
1497
+ plate: "plate";
1498
+ vehicle: "vehicle";
1499
+ }>>;
1500
+ label: z.ZodOptional<z.ZodString>;
1474
1501
  iou: z.ZodOptional<z.ZodNumber>;
1475
1502
  }, z.core.$strip>>>;
1476
1503
  summary: z.ZodObject<{
@@ -1628,6 +1655,15 @@ export declare const RetrainFrameSelectionSchema: z.ZodObject<{
1628
1655
  score: z.ZodOptional<z.ZodNumber>;
1629
1656
  modelId: z.ZodOptional<z.ZodString>;
1630
1657
  }, z.core.$strip>>;
1658
+ macroClass: z.ZodOptional<z.ZodEnum<{
1659
+ animal: "animal";
1660
+ face: "face";
1661
+ package: "package";
1662
+ person: "person";
1663
+ plate: "plate";
1664
+ vehicle: "vehicle";
1665
+ }>>;
1666
+ label: z.ZodOptional<z.ZodString>;
1631
1667
  iou: z.ZodOptional<z.ZodNumber>;
1632
1668
  }, z.core.$strip>>>;
1633
1669
  summary: z.ZodObject<{
@@ -1812,6 +1848,15 @@ export declare const RetrainFrameListSchema: z.ZodObject<{
1812
1848
  score: z.ZodOptional<z.ZodNumber>;
1813
1849
  modelId: z.ZodOptional<z.ZodString>;
1814
1850
  }, z.core.$strip>>;
1851
+ macroClass: z.ZodOptional<z.ZodEnum<{
1852
+ animal: "animal";
1853
+ face: "face";
1854
+ package: "package";
1855
+ person: "person";
1856
+ plate: "plate";
1857
+ vehicle: "vehicle";
1858
+ }>>;
1859
+ label: z.ZodOptional<z.ZodString>;
1815
1860
  iou: z.ZodOptional<z.ZodNumber>;
1816
1861
  }, z.core.$strip>>>;
1817
1862
  summary: z.ZodObject<{
@@ -2000,6 +2045,15 @@ export declare const RetrainCorpusPageFrameSchema: z.ZodObject<{
2000
2045
  score: z.ZodOptional<z.ZodNumber>;
2001
2046
  modelId: z.ZodOptional<z.ZodString>;
2002
2047
  }, z.core.$strip>>;
2048
+ macroClass: z.ZodOptional<z.ZodEnum<{
2049
+ animal: "animal";
2050
+ face: "face";
2051
+ package: "package";
2052
+ person: "person";
2053
+ plate: "plate";
2054
+ vehicle: "vehicle";
2055
+ }>>;
2056
+ label: z.ZodOptional<z.ZodString>;
2003
2057
  iou: z.ZodOptional<z.ZodNumber>;
2004
2058
  }, z.core.$strip>>>;
2005
2059
  summary: z.ZodObject<{
@@ -2156,6 +2210,15 @@ export declare const RetrainCorpusPageSchema: z.ZodObject<{
2156
2210
  score: z.ZodOptional<z.ZodNumber>;
2157
2211
  modelId: z.ZodOptional<z.ZodString>;
2158
2212
  }, z.core.$strip>>;
2213
+ macroClass: z.ZodOptional<z.ZodEnum<{
2214
+ animal: "animal";
2215
+ face: "face";
2216
+ package: "package";
2217
+ person: "person";
2218
+ plate: "plate";
2219
+ vehicle: "vehicle";
2220
+ }>>;
2221
+ label: z.ZodOptional<z.ZodString>;
2159
2222
  iou: z.ZodOptional<z.ZodNumber>;
2160
2223
  }, z.core.$strip>>>;
2161
2224
  summary: z.ZodObject<{
@@ -2540,6 +2603,15 @@ export declare const AddRetrainFrameFromRecordingResultSchema: z.ZodDiscriminate
2540
2603
  score: z.ZodOptional<z.ZodNumber>;
2541
2604
  modelId: z.ZodOptional<z.ZodString>;
2542
2605
  }, z.core.$strip>>;
2606
+ macroClass: z.ZodOptional<z.ZodEnum<{
2607
+ animal: "animal";
2608
+ face: "face";
2609
+ package: "package";
2610
+ person: "person";
2611
+ plate: "plate";
2612
+ vehicle: "vehicle";
2613
+ }>>;
2614
+ label: z.ZodOptional<z.ZodString>;
2543
2615
  iou: z.ZodOptional<z.ZodNumber>;
2544
2616
  }, z.core.$strip>>>;
2545
2617
  summary: z.ZodObject<{
@@ -5452,6 +5524,15 @@ export declare const pipelineAnalyticsCapability: {
5452
5524
  score: z.ZodOptional<z.ZodNumber>;
5453
5525
  modelId: z.ZodOptional<z.ZodString>;
5454
5526
  }, z.core.$strip>>;
5527
+ macroClass: z.ZodOptional<z.ZodEnum<{
5528
+ animal: "animal";
5529
+ face: "face";
5530
+ package: "package";
5531
+ person: "person";
5532
+ plate: "plate";
5533
+ vehicle: "vehicle";
5534
+ }>>;
5535
+ label: z.ZodOptional<z.ZodString>;
5455
5536
  iou: z.ZodOptional<z.ZodNumber>;
5456
5537
  }, z.core.$strip>>>;
5457
5538
  summary: z.ZodObject<{
@@ -5666,6 +5747,15 @@ export declare const pipelineAnalyticsCapability: {
5666
5747
  score: z.ZodOptional<z.ZodNumber>;
5667
5748
  modelId: z.ZodOptional<z.ZodString>;
5668
5749
  }, z.core.$strip>>;
5750
+ macroClass: z.ZodOptional<z.ZodEnum<{
5751
+ animal: "animal";
5752
+ face: "face";
5753
+ package: "package";
5754
+ person: "person";
5755
+ plate: "plate";
5756
+ vehicle: "vehicle";
5757
+ }>>;
5758
+ label: z.ZodOptional<z.ZodString>;
5669
5759
  iou: z.ZodOptional<z.ZodNumber>;
5670
5760
  }, z.core.$strip>>>;
5671
5761
  summary: z.ZodObject<{
@@ -5836,6 +5926,15 @@ export declare const pipelineAnalyticsCapability: {
5836
5926
  score: z.ZodOptional<z.ZodNumber>;
5837
5927
  modelId: z.ZodOptional<z.ZodString>;
5838
5928
  }, z.core.$strip>>;
5929
+ macroClass: z.ZodOptional<z.ZodEnum<{
5930
+ animal: "animal";
5931
+ face: "face";
5932
+ package: "package";
5933
+ person: "person";
5934
+ plate: "plate";
5935
+ vehicle: "vehicle";
5936
+ }>>;
5937
+ label: z.ZodOptional<z.ZodString>;
5839
5938
  iou: z.ZodOptional<z.ZodNumber>;
5840
5939
  }, z.core.$strip>>>;
5841
5940
  summary: z.ZodObject<{
@@ -6520,6 +6619,15 @@ export declare const pipelineAnalyticsCapability: {
6520
6619
  score: z.ZodOptional<z.ZodNumber>;
6521
6620
  modelId: z.ZodOptional<z.ZodString>;
6522
6621
  }, z.core.$strip>>;
6622
+ macroClass: z.ZodOptional<z.ZodEnum<{
6623
+ animal: "animal";
6624
+ face: "face";
6625
+ package: "package";
6626
+ person: "person";
6627
+ plate: "plate";
6628
+ vehicle: "vehicle";
6629
+ }>>;
6630
+ label: z.ZodOptional<z.ZodString>;
6523
6631
  iou: z.ZodOptional<z.ZodNumber>;
6524
6632
  }, z.core.$strip>>>;
6525
6633
  summary: z.ZodObject<{
@@ -7033,6 +7141,15 @@ export declare const pipelineAnalyticsCapability: {
7033
7141
  score: z.ZodOptional<z.ZodNumber>;
7034
7142
  modelId: z.ZodOptional<z.ZodString>;
7035
7143
  }, z.core.$strip>>;
7144
+ macroClass: z.ZodOptional<z.ZodEnum<{
7145
+ animal: "animal";
7146
+ face: "face";
7147
+ package: "package";
7148
+ person: "person";
7149
+ plate: "plate";
7150
+ vehicle: "vehicle";
7151
+ }>>;
7152
+ label: z.ZodOptional<z.ZodString>;
7036
7153
  iou: z.ZodOptional<z.ZodNumber>;
7037
7154
  }, z.core.$strip>>>;
7038
7155
  summary: z.ZodObject<{
@@ -7215,6 +7332,15 @@ export declare const pipelineAnalyticsCapability: {
7215
7332
  score: z.ZodOptional<z.ZodNumber>;
7216
7333
  modelId: z.ZodOptional<z.ZodString>;
7217
7334
  }, z.core.$strip>>;
7335
+ macroClass: z.ZodOptional<z.ZodEnum<{
7336
+ animal: "animal";
7337
+ face: "face";
7338
+ package: "package";
7339
+ person: "person";
7340
+ plate: "plate";
7341
+ vehicle: "vehicle";
7342
+ }>>;
7343
+ label: z.ZodOptional<z.ZodString>;
7218
7344
  iou: z.ZodOptional<z.ZodNumber>;
7219
7345
  }, z.core.$strip>>>;
7220
7346
  summary: z.ZodObject<{
package/dist/client.js CHANGED
@@ -124,6 +124,7 @@ var RETRAIN_REVIEW_MATCH_IOU = .5;
124
124
  var RETRAIN_REVIEW_ADJUSTED_IOU = .95;
125
125
  /** Two boxes this close on every edge are the same rectangle (an exact match). */
126
126
  var EXACT_EDGE_EPSILON = 1e-6;
127
+ var optLabel = (label) => label !== void 0 ? { label } : {};
127
128
  /** Intersection over union of two normalised rectangles. */
128
129
  function retrainBoxIou(a, b) {
129
130
  const inter = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));
@@ -133,13 +134,13 @@ function retrainBoxIou(a, b) {
133
134
  function sameRect(a, b) {
134
135
  return Math.abs(a.x - b.x) <= EXACT_EDGE_EPSILON && Math.abs(a.y - b.y) <= EXACT_EDGE_EPSILON && Math.abs(a.w - b.w) <= EXACT_EDGE_EPSILON && Math.abs(a.h - b.h) <= EXACT_EDGE_EPSILON;
135
136
  }
136
- function labelOf(value) {
137
+ function labelField(value) {
137
138
  return value?.trim() ?? "";
138
139
  }
139
140
  /** Kept box versus its baseline: class/label first, then geometry. */
140
141
  function compareKept(saved, baseline, adjustedIou) {
141
142
  const iou = retrainBoxIou(saved.bbox, baseline.bbox);
142
- if (saved.macroClass !== baseline.macroClass || labelOf(saved.label) !== labelOf(baseline.label)) return {
143
+ if (saved.macroClass !== baseline.macroClass || labelField(saved.label) !== labelField(baseline.label)) return {
143
144
  status: "reclassified",
144
145
  iou
145
146
  };
@@ -214,6 +215,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
214
215
  savedId: box.id,
215
216
  status: "model-error",
216
217
  approximate: false,
218
+ macroClass: box.macroClass,
219
+ ...optLabel(box.label),
217
220
  ...baseline !== null ? {
218
221
  origin: baseline,
219
222
  iou: retrainBoxIou(box.bbox, baseline.bbox)
@@ -227,6 +230,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
227
230
  savedId: box.id,
228
231
  status: "added",
229
232
  approximate: approximate && baseline === null,
233
+ macroClass: box.macroClass,
234
+ ...optLabel(box.label),
230
235
  ...baseline !== null ? { origin: baseline } : {}
231
236
  });
232
237
  return;
@@ -237,6 +242,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
237
242
  savedId: box.id,
238
243
  status: verdict.status,
239
244
  approximate,
245
+ macroClass: box.macroClass,
246
+ ...optLabel(box.label),
240
247
  origin: baseline,
241
248
  iou: verdict.iou
242
249
  });
@@ -245,6 +252,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
245
252
  ref: entry.ref,
246
253
  status: "removed",
247
254
  approximate: false,
255
+ macroClass: entry.snapshot.macroClass,
256
+ ...optLabel(entry.snapshot.label),
248
257
  origin: entry.snapshot
249
258
  });
250
259
  if (opts.inferRemoved === true) for (const origin of origins) {
@@ -253,6 +262,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
253
262
  ref: origin.ref,
254
263
  status: "removed",
255
264
  approximate: true,
265
+ macroClass: origin.macroClass,
266
+ ...optLabel(origin.label),
256
267
  origin
257
268
  });
258
269
  }
package/dist/client.mjs CHANGED
@@ -123,6 +123,7 @@ var RETRAIN_REVIEW_MATCH_IOU = .5;
123
123
  var RETRAIN_REVIEW_ADJUSTED_IOU = .95;
124
124
  /** Two boxes this close on every edge are the same rectangle (an exact match). */
125
125
  var EXACT_EDGE_EPSILON = 1e-6;
126
+ var optLabel = (label) => label !== void 0 ? { label } : {};
126
127
  /** Intersection over union of two normalised rectangles. */
127
128
  function retrainBoxIou(a, b) {
128
129
  const inter = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));
@@ -132,13 +133,13 @@ function retrainBoxIou(a, b) {
132
133
  function sameRect(a, b) {
133
134
  return Math.abs(a.x - b.x) <= EXACT_EDGE_EPSILON && Math.abs(a.y - b.y) <= EXACT_EDGE_EPSILON && Math.abs(a.w - b.w) <= EXACT_EDGE_EPSILON && Math.abs(a.h - b.h) <= EXACT_EDGE_EPSILON;
134
135
  }
135
- function labelOf(value) {
136
+ function labelField(value) {
136
137
  return value?.trim() ?? "";
137
138
  }
138
139
  /** Kept box versus its baseline: class/label first, then geometry. */
139
140
  function compareKept(saved, baseline, adjustedIou) {
140
141
  const iou = retrainBoxIou(saved.bbox, baseline.bbox);
141
- if (saved.macroClass !== baseline.macroClass || labelOf(saved.label) !== labelOf(baseline.label)) return {
142
+ if (saved.macroClass !== baseline.macroClass || labelField(saved.label) !== labelField(baseline.label)) return {
142
143
  status: "reclassified",
143
144
  iou
144
145
  };
@@ -213,6 +214,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
213
214
  savedId: box.id,
214
215
  status: "model-error",
215
216
  approximate: false,
217
+ macroClass: box.macroClass,
218
+ ...optLabel(box.label),
216
219
  ...baseline !== null ? {
217
220
  origin: baseline,
218
221
  iou: retrainBoxIou(box.bbox, baseline.bbox)
@@ -226,6 +229,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
226
229
  savedId: box.id,
227
230
  status: "added",
228
231
  approximate: approximate && baseline === null,
232
+ macroClass: box.macroClass,
233
+ ...optLabel(box.label),
229
234
  ...baseline !== null ? { origin: baseline } : {}
230
235
  });
231
236
  return;
@@ -236,6 +241,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
236
241
  savedId: box.id,
237
242
  status: verdict.status,
238
243
  approximate,
244
+ macroClass: box.macroClass,
245
+ ...optLabel(box.label),
239
246
  origin: baseline,
240
247
  iou: verdict.iou
241
248
  });
@@ -244,6 +251,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
244
251
  ref: entry.ref,
245
252
  status: "removed",
246
253
  approximate: false,
254
+ macroClass: entry.snapshot.macroClass,
255
+ ...optLabel(entry.snapshot.label),
247
256
  origin: entry.snapshot
248
257
  });
249
258
  if (opts.inferRemoved === true) for (const origin of origins) {
@@ -252,6 +261,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
252
261
  ref: origin.ref,
253
262
  status: "removed",
254
263
  approximate: true,
264
+ macroClass: origin.macroClass,
265
+ ...optLabel(origin.label),
255
266
  origin
256
267
  });
257
268
  }
package/dist/index.js CHANGED
@@ -1949,6 +1949,7 @@ var RETRAIN_REVIEW_MATCH_IOU = .5;
1949
1949
  var RETRAIN_REVIEW_ADJUSTED_IOU = .95;
1950
1950
  /** Two boxes this close on every edge are the same rectangle (an exact match). */
1951
1951
  var EXACT_EDGE_EPSILON = 1e-6;
1952
+ var optLabel = (label) => label !== void 0 ? { label } : {};
1952
1953
  /** Intersection over union of two normalised rectangles. */
1953
1954
  function retrainBoxIou(a, b) {
1954
1955
  const inter = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));
@@ -1958,13 +1959,13 @@ function retrainBoxIou(a, b) {
1958
1959
  function sameRect(a, b) {
1959
1960
  return Math.abs(a.x - b.x) <= EXACT_EDGE_EPSILON && Math.abs(a.y - b.y) <= EXACT_EDGE_EPSILON && Math.abs(a.w - b.w) <= EXACT_EDGE_EPSILON && Math.abs(a.h - b.h) <= EXACT_EDGE_EPSILON;
1960
1961
  }
1961
- function labelOf(value) {
1962
+ function labelField(value) {
1962
1963
  return value?.trim() ?? "";
1963
1964
  }
1964
1965
  /** Kept box versus its baseline: class/label first, then geometry. */
1965
1966
  function compareKept(saved, baseline, adjustedIou) {
1966
1967
  const iou = retrainBoxIou(saved.bbox, baseline.bbox);
1967
- if (saved.macroClass !== baseline.macroClass || labelOf(saved.label) !== labelOf(baseline.label)) return {
1968
+ if (saved.macroClass !== baseline.macroClass || labelField(saved.label) !== labelField(baseline.label)) return {
1968
1969
  status: "reclassified",
1969
1970
  iou
1970
1971
  };
@@ -2039,6 +2040,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2039
2040
  savedId: box.id,
2040
2041
  status: "model-error",
2041
2042
  approximate: false,
2043
+ macroClass: box.macroClass,
2044
+ ...optLabel(box.label),
2042
2045
  ...baseline !== null ? {
2043
2046
  origin: baseline,
2044
2047
  iou: retrainBoxIou(box.bbox, baseline.bbox)
@@ -2052,6 +2055,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2052
2055
  savedId: box.id,
2053
2056
  status: "added",
2054
2057
  approximate: approximate && baseline === null,
2058
+ macroClass: box.macroClass,
2059
+ ...optLabel(box.label),
2055
2060
  ...baseline !== null ? { origin: baseline } : {}
2056
2061
  });
2057
2062
  return;
@@ -2062,6 +2067,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2062
2067
  savedId: box.id,
2063
2068
  status: verdict.status,
2064
2069
  approximate,
2070
+ macroClass: box.macroClass,
2071
+ ...optLabel(box.label),
2065
2072
  origin: baseline,
2066
2073
  iou: verdict.iou
2067
2074
  });
@@ -2070,6 +2077,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2070
2077
  ref: entry.ref,
2071
2078
  status: "removed",
2072
2079
  approximate: false,
2080
+ macroClass: entry.snapshot.macroClass,
2081
+ ...optLabel(entry.snapshot.label),
2073
2082
  origin: entry.snapshot
2074
2083
  });
2075
2084
  if (opts.inferRemoved === true) for (const origin of origins) {
@@ -2078,6 +2087,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2078
2087
  ref: origin.ref,
2079
2088
  status: "removed",
2080
2089
  approximate: true,
2090
+ macroClass: origin.macroClass,
2091
+ ...optLabel(origin.label),
2081
2092
  origin
2082
2093
  });
2083
2094
  }
@@ -25972,6 +25983,9 @@ var RetrainBoxReviewSchema = zod.z.object({
25972
25983
  /** The baseline was re-derived, not snapshotted (a pre-origin row). */
25973
25984
  approximate: zod.z.boolean(),
25974
25985
  origin: RetrainOriginSchema.optional(),
25986
+ /** The class / label the box carries NOW (a removed box: its origin's). Absent on an older hub. */
25987
+ macroClass: RetrainMacroClassSchema.optional(),
25988
+ label: zod.z.string().optional(),
25975
25989
  iou: zod.z.number().optional()
25976
25990
  });
25977
25991
  var RetrainFrameReviewSchema = zod.z.object({
package/dist/index.mjs CHANGED
@@ -1948,6 +1948,7 @@ var RETRAIN_REVIEW_MATCH_IOU = .5;
1948
1948
  var RETRAIN_REVIEW_ADJUSTED_IOU = .95;
1949
1949
  /** Two boxes this close on every edge are the same rectangle (an exact match). */
1950
1950
  var EXACT_EDGE_EPSILON = 1e-6;
1951
+ var optLabel = (label) => label !== void 0 ? { label } : {};
1951
1952
  /** Intersection over union of two normalised rectangles. */
1952
1953
  function retrainBoxIou(a, b) {
1953
1954
  const inter = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));
@@ -1957,13 +1958,13 @@ function retrainBoxIou(a, b) {
1957
1958
  function sameRect(a, b) {
1958
1959
  return Math.abs(a.x - b.x) <= EXACT_EDGE_EPSILON && Math.abs(a.y - b.y) <= EXACT_EDGE_EPSILON && Math.abs(a.w - b.w) <= EXACT_EDGE_EPSILON && Math.abs(a.h - b.h) <= EXACT_EDGE_EPSILON;
1959
1960
  }
1960
- function labelOf(value) {
1961
+ function labelField(value) {
1961
1962
  return value?.trim() ?? "";
1962
1963
  }
1963
1964
  /** Kept box versus its baseline: class/label first, then geometry. */
1964
1965
  function compareKept(saved, baseline, adjustedIou) {
1965
1966
  const iou = retrainBoxIou(saved.bbox, baseline.bbox);
1966
- if (saved.macroClass !== baseline.macroClass || labelOf(saved.label) !== labelOf(baseline.label)) return {
1967
+ if (saved.macroClass !== baseline.macroClass || labelField(saved.label) !== labelField(baseline.label)) return {
1967
1968
  status: "reclassified",
1968
1969
  iou
1969
1970
  };
@@ -2038,6 +2039,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2038
2039
  savedId: box.id,
2039
2040
  status: "model-error",
2040
2041
  approximate: false,
2042
+ macroClass: box.macroClass,
2043
+ ...optLabel(box.label),
2041
2044
  ...baseline !== null ? {
2042
2045
  origin: baseline,
2043
2046
  iou: retrainBoxIou(box.bbox, baseline.bbox)
@@ -2051,6 +2054,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2051
2054
  savedId: box.id,
2052
2055
  status: "added",
2053
2056
  approximate: approximate && baseline === null,
2057
+ macroClass: box.macroClass,
2058
+ ...optLabel(box.label),
2054
2059
  ...baseline !== null ? { origin: baseline } : {}
2055
2060
  });
2056
2061
  return;
@@ -2061,6 +2066,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2061
2066
  savedId: box.id,
2062
2067
  status: verdict.status,
2063
2068
  approximate,
2069
+ macroClass: box.macroClass,
2070
+ ...optLabel(box.label),
2064
2071
  origin: baseline,
2065
2072
  iou: verdict.iou
2066
2073
  });
@@ -2069,6 +2076,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2069
2076
  ref: entry.ref,
2070
2077
  status: "removed",
2071
2078
  approximate: false,
2079
+ macroClass: entry.snapshot.macroClass,
2080
+ ...optLabel(entry.snapshot.label),
2072
2081
  origin: entry.snapshot
2073
2082
  });
2074
2083
  if (opts.inferRemoved === true) for (const origin of origins) {
@@ -2077,6 +2086,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
2077
2086
  ref: origin.ref,
2078
2087
  status: "removed",
2079
2088
  approximate: true,
2089
+ macroClass: origin.macroClass,
2090
+ ...optLabel(origin.label),
2080
2091
  origin
2081
2092
  });
2082
2093
  }
@@ -25971,6 +25982,9 @@ var RetrainBoxReviewSchema = z.object({
25971
25982
  /** The baseline was re-derived, not snapshotted (a pre-origin row). */
25972
25983
  approximate: z.boolean(),
25973
25984
  origin: RetrainOriginSchema.optional(),
25985
+ /** The class / label the box carries NOW (a removed box: its origin's). Absent on an older hub. */
25986
+ macroClass: RetrainMacroClassSchema.optional(),
25987
+ label: z.string().optional(),
25974
25988
  iou: z.number().optional()
25975
25989
  });
25976
25990
  var RetrainFrameReviewSchema = z.object({
@@ -69,6 +69,9 @@ export interface RetrainReviewBox {
69
69
  readonly approximate: boolean;
70
70
  /** The proposal this box was judged against, when there was one. */
71
71
  readonly origin?: RetrainOrigin;
72
+ /** The class / label the box carries now; a `removed` box carries its origin's. */
73
+ readonly macroClass: RetrainOrigin['macroClass'];
74
+ readonly label?: string;
72
75
  /** Overlap with that proposal, when both rectangles exist. */
73
76
  readonly iou?: number;
74
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.359",
3
+ "version": "1.2.360",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",