@camstack/addon-training 0.1.36 → 0.1.37
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/_stub.js +387 -372
- package/package.json +1 -1
package/dist/_stub.js
CHANGED
|
@@ -30487,34 +30487,48 @@ function $N({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
30487
30487
|
]
|
|
30488
30488
|
});
|
|
30489
30489
|
}
|
|
30490
|
+
var eP = 26, tP = 6.6;
|
|
30491
|
+
function nP(e) {
|
|
30492
|
+
return eP + e.length * tP;
|
|
30493
|
+
}
|
|
30494
|
+
function rP(e, t, n) {
|
|
30495
|
+
let r = e.top - 18 >= n.top ? "above" : "inside", i = e.left + t - (n.left + n.width);
|
|
30496
|
+
return i <= 0 ? {
|
|
30497
|
+
anchor: "left",
|
|
30498
|
+
row: r
|
|
30499
|
+
} : {
|
|
30500
|
+
anchor: n.left - (e.left + e.width - t) < i ? "right" : "left",
|
|
30501
|
+
row: r
|
|
30502
|
+
};
|
|
30503
|
+
}
|
|
30490
30504
|
//#endregion
|
|
30491
30505
|
//#region src/page/frames/lib/retrain-zoom.ts
|
|
30492
|
-
var
|
|
30506
|
+
var iP = {
|
|
30493
30507
|
x: 0,
|
|
30494
30508
|
y: 0,
|
|
30495
30509
|
w: 1,
|
|
30496
30510
|
h: 1
|
|
30497
|
-
},
|
|
30498
|
-
function
|
|
30511
|
+
}, aP = 1.5;
|
|
30512
|
+
function oP(e, t, n) {
|
|
30499
30513
|
return e < t ? t : e > n ? n : e;
|
|
30500
30514
|
}
|
|
30501
|
-
function
|
|
30515
|
+
function sP(e) {
|
|
30502
30516
|
return 1 / e.w;
|
|
30503
30517
|
}
|
|
30504
|
-
function
|
|
30518
|
+
function cP(e, t, n, r) {
|
|
30505
30519
|
return {
|
|
30506
|
-
x:
|
|
30507
|
-
y:
|
|
30520
|
+
x: oP(r.x + (e - n.left) / n.width * r.w, 0, 1),
|
|
30521
|
+
y: oP(r.y + (t - n.top) / n.height * r.h, 0, 1)
|
|
30508
30522
|
};
|
|
30509
30523
|
}
|
|
30510
|
-
function
|
|
30524
|
+
function lP(e, t, n) {
|
|
30511
30525
|
return {
|
|
30512
30526
|
x: t.left + (e.x - n.x) / n.w * t.width,
|
|
30513
30527
|
y: t.top + (e.y - n.y) / n.h * t.height
|
|
30514
30528
|
};
|
|
30515
30529
|
}
|
|
30516
|
-
function
|
|
30517
|
-
let r =
|
|
30530
|
+
function uP(e, t, n) {
|
|
30531
|
+
let r = lP(e, t, n);
|
|
30518
30532
|
return {
|
|
30519
30533
|
left: r.x,
|
|
30520
30534
|
top: r.y,
|
|
@@ -30522,7 +30536,7 @@ function oP(e, t, n) {
|
|
|
30522
30536
|
height: e.h / n.h * t.height
|
|
30523
30537
|
};
|
|
30524
30538
|
}
|
|
30525
|
-
function
|
|
30539
|
+
function dP(e, t) {
|
|
30526
30540
|
return {
|
|
30527
30541
|
left: e.left - t.x / t.w * e.width,
|
|
30528
30542
|
top: e.top - t.y / t.h * e.height,
|
|
@@ -30530,24 +30544,24 @@ function sP(e, t) {
|
|
|
30530
30544
|
height: e.height / t.h
|
|
30531
30545
|
};
|
|
30532
30546
|
}
|
|
30533
|
-
function
|
|
30534
|
-
let r =
|
|
30547
|
+
function fP(e, t, n) {
|
|
30548
|
+
let r = oP(e.w / n, 1 / 16, 1), i = r / e.w;
|
|
30535
30549
|
return {
|
|
30536
|
-
x:
|
|
30537
|
-
y:
|
|
30550
|
+
x: oP(t.x - (t.x - e.x) * i, 0, 1 - r),
|
|
30551
|
+
y: oP(t.y - (t.y - e.y) * i, 0, 1 - r),
|
|
30538
30552
|
w: r,
|
|
30539
30553
|
h: r
|
|
30540
30554
|
};
|
|
30541
30555
|
}
|
|
30542
|
-
function
|
|
30556
|
+
function pP(e, t, n) {
|
|
30543
30557
|
return {
|
|
30544
|
-
x:
|
|
30545
|
-
y:
|
|
30558
|
+
x: oP(e.x + t, 0, 1 - e.w),
|
|
30559
|
+
y: oP(e.y + n, 0, 1 - e.h),
|
|
30546
30560
|
w: e.w,
|
|
30547
30561
|
h: e.h
|
|
30548
30562
|
};
|
|
30549
30563
|
}
|
|
30550
|
-
function
|
|
30564
|
+
function mP(e) {
|
|
30551
30565
|
return {
|
|
30552
30566
|
x: e.x + e.w / 2,
|
|
30553
30567
|
y: e.y + e.h / 2
|
|
@@ -30555,7 +30569,7 @@ function uP(e) {
|
|
|
30555
30569
|
}
|
|
30556
30570
|
//#endregion
|
|
30557
30571
|
//#region src/page/frames/lib/retrain-shortcuts.ts
|
|
30558
|
-
var
|
|
30572
|
+
var hP = [
|
|
30559
30573
|
"person",
|
|
30560
30574
|
"vehicle",
|
|
30561
30575
|
"animal",
|
|
@@ -30563,12 +30577,12 @@ var dP = [
|
|
|
30563
30577
|
"face",
|
|
30564
30578
|
"plate"
|
|
30565
30579
|
];
|
|
30566
|
-
function
|
|
30580
|
+
function gP(e) {
|
|
30567
30581
|
if (typeof e != "object" || !e || !("tagName" in e)) return !1;
|
|
30568
30582
|
let t = String(e.tagName).toUpperCase();
|
|
30569
30583
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" ? !0 : "isContentEditable" in e && e.isContentEditable === !0;
|
|
30570
30584
|
}
|
|
30571
|
-
function
|
|
30585
|
+
function _P(e) {
|
|
30572
30586
|
let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
|
|
30573
30587
|
if (t && !e.altKey) return n === "s" && !e.shiftKey ? { kind: "save" } : e.typing ? null : n === "z" ? e.shiftKey ? { kind: "redo" } : { kind: "undo" } : n === "y" && !e.shiftKey ? { kind: "redo" } : null;
|
|
30574
30588
|
if (e.typing || t || e.altKey) return null;
|
|
@@ -30589,8 +30603,8 @@ function pP(e) {
|
|
|
30589
30603
|
default: break;
|
|
30590
30604
|
}
|
|
30591
30605
|
let r = Number.parseInt(e.key, 10);
|
|
30592
|
-
if (Number.isInteger(r) && r >= 1 && r <=
|
|
30593
|
-
let e =
|
|
30606
|
+
if (Number.isInteger(r) && r >= 1 && r <= hP.length) {
|
|
30607
|
+
let e = hP[r - 1];
|
|
30594
30608
|
return e === void 0 ? null : {
|
|
30595
30609
|
kind: "set-class",
|
|
30596
30610
|
macroClass: e
|
|
@@ -30598,7 +30612,7 @@ function pP(e) {
|
|
|
30598
30612
|
}
|
|
30599
30613
|
return n === "a" ? e.shiftKey ? { kind: "accept-all" } : { kind: "accept" } : n === "e" && !e.shiftKey ? { kind: "toggle-model-error" } : n === "c" && !e.shiftKey ? { kind: "toggle-complete" } : null;
|
|
30600
30614
|
}
|
|
30601
|
-
var
|
|
30615
|
+
var vP = [
|
|
30602
30616
|
{
|
|
30603
30617
|
keys: "← / →",
|
|
30604
30618
|
does: "Previous / next frame"
|
|
@@ -30667,17 +30681,17 @@ var mP = [
|
|
|
30667
30681
|
//#endregion
|
|
30668
30682
|
//#region src/page/frames/RetrainCanvas.tsx
|
|
30669
30683
|
i();
|
|
30670
|
-
var
|
|
30671
|
-
function
|
|
30684
|
+
var yP = .0015;
|
|
30685
|
+
function bP(e, t) {
|
|
30672
30686
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
30673
30687
|
}
|
|
30674
|
-
function
|
|
30688
|
+
function xP(e, t) {
|
|
30675
30689
|
return {
|
|
30676
30690
|
x: (e.x + t.x) / 2,
|
|
30677
30691
|
y: (e.y + t.y) / 2
|
|
30678
30692
|
};
|
|
30679
30693
|
}
|
|
30680
|
-
function
|
|
30694
|
+
function SP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey: i, viewport: o, onViewportChange: c, panMode: l, onSelect: d, onDraw: f, onGestureStart: p, onGestureBox: m, onGestureEnd: h, review: _ = null, showRemoved: v = !0, hover: b = null, onHover: x }) {
|
|
30681
30695
|
let S = u(null), [C, w] = a({
|
|
30682
30696
|
w: 0,
|
|
30683
30697
|
h: 0
|
|
@@ -30698,7 +30712,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30698
30712
|
let j = rN(C.w, C.h, t, n);
|
|
30699
30713
|
y(() => {
|
|
30700
30714
|
let e = (e) => {
|
|
30701
|
-
e.key !== " " ||
|
|
30715
|
+
e.key !== " " || gP(e.target) || (e.preventDefault(), O(!0));
|
|
30702
30716
|
}, t = (e) => {
|
|
30703
30717
|
e.key === " " && O(!1);
|
|
30704
30718
|
};
|
|
@@ -30723,7 +30737,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30723
30737
|
if (n === null) return;
|
|
30724
30738
|
t.preventDefault();
|
|
30725
30739
|
let a = e.getBoundingClientRect();
|
|
30726
|
-
i(
|
|
30740
|
+
i(fP(r, cP(t.clientX - a.left, t.clientY - a.top, n, r), Math.exp(-t.deltaY * yP)));
|
|
30727
30741
|
};
|
|
30728
30742
|
return e.addEventListener("wheel", t, { passive: !1 }), () => {
|
|
30729
30743
|
e.removeEventListener("wheel", t);
|
|
@@ -30735,7 +30749,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30735
30749
|
x: e.clientX - (t?.left ?? 0),
|
|
30736
30750
|
y: e.clientY - (t?.top ?? 0)
|
|
30737
30751
|
};
|
|
30738
|
-
}, []), P = s((e) => j === null ? null :
|
|
30752
|
+
}, []), P = s((e) => j === null ? null : cP(e.x, e.y, j, o), [j, o]), F = s(() => {
|
|
30739
30753
|
let e = A.current;
|
|
30740
30754
|
(e.mode === "move" || e.mode === "resize") && h(), e.mode === "draw" && E(null), A.current = { mode: "none" };
|
|
30741
30755
|
}, [h]), I = (e) => {
|
|
@@ -30745,11 +30759,11 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30745
30759
|
F();
|
|
30746
30760
|
let [e, t] = [...k.current.values()];
|
|
30747
30761
|
if (e === void 0 || t === void 0) return;
|
|
30748
|
-
let n =
|
|
30762
|
+
let n = xP(e, t);
|
|
30749
30763
|
A.current = {
|
|
30750
30764
|
mode: "pinch",
|
|
30751
|
-
startDistance: Math.max(1,
|
|
30752
|
-
anchor:
|
|
30765
|
+
startDistance: Math.max(1, bP(e, t)),
|
|
30766
|
+
anchor: cP(n.x, n.y, j, o),
|
|
30753
30767
|
from: o
|
|
30754
30768
|
};
|
|
30755
30769
|
return;
|
|
@@ -30764,7 +30778,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30764
30778
|
return;
|
|
30765
30779
|
}
|
|
30766
30780
|
if (e.button !== 0) return;
|
|
30767
|
-
let n =
|
|
30781
|
+
let n = cP(t.x, t.y, j, o), a = {
|
|
30768
30782
|
x: 12 / j.width * o.w,
|
|
30769
30783
|
y: 12 / j.height * o.h
|
|
30770
30784
|
}, s = r.find((e) => e.key === i);
|
|
@@ -30798,7 +30812,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30798
30812
|
if (j === null) return;
|
|
30799
30813
|
if (!k.current.has(e.pointerId)) {
|
|
30800
30814
|
if (e.pointerType === "touch" || x === void 0) return;
|
|
30801
|
-
let t = N(e), n = mN(r,
|
|
30815
|
+
let t = N(e), n = mN(r, cP(t.x, t.y, j, o));
|
|
30802
30816
|
gN(n, b) || x(n);
|
|
30803
30817
|
return;
|
|
30804
30818
|
}
|
|
@@ -30809,27 +30823,27 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30809
30823
|
case "pinch": {
|
|
30810
30824
|
let [e, t] = [...k.current.values()];
|
|
30811
30825
|
if (e === void 0 || t === void 0) return;
|
|
30812
|
-
let r =
|
|
30813
|
-
c(
|
|
30826
|
+
let r = fP(n.from, n.anchor, bP(e, t) / n.startDistance), i = xP(e, t), a = cP(i.x, i.y, j, r);
|
|
30827
|
+
c(pP(r, n.anchor.x - a.x, n.anchor.y - a.y));
|
|
30814
30828
|
return;
|
|
30815
30829
|
}
|
|
30816
30830
|
case "pan": {
|
|
30817
30831
|
let e = (t.x - n.startPx.x) / j.width * n.from.w, r = (t.y - n.startPx.y) / j.height * n.from.h;
|
|
30818
|
-
c(
|
|
30832
|
+
c(pP(n.from, -e, -r));
|
|
30819
30833
|
return;
|
|
30820
30834
|
}
|
|
30821
30835
|
case "move": {
|
|
30822
|
-
let e =
|
|
30836
|
+
let e = cP(t.x, t.y, j, o);
|
|
30823
30837
|
m(n.key, lN(n.from, e.x - n.start.x, e.y - n.start.y));
|
|
30824
30838
|
return;
|
|
30825
30839
|
}
|
|
30826
30840
|
case "resize": {
|
|
30827
|
-
let e =
|
|
30841
|
+
let e = cP(t.x, t.y, j, o);
|
|
30828
30842
|
m(n.key, dN(n.from, n.handle, e));
|
|
30829
30843
|
return;
|
|
30830
30844
|
}
|
|
30831
30845
|
case "draw": {
|
|
30832
|
-
let e =
|
|
30846
|
+
let e = cP(t.x, t.y, j, o);
|
|
30833
30847
|
E(iN(n.start, e));
|
|
30834
30848
|
return;
|
|
30835
30849
|
}
|
|
@@ -30855,7 +30869,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30855
30869
|
let e = document.activeElement;
|
|
30856
30870
|
(e === null || e === document.body || S.current?.contains(e)) === !0 && L.current.get(i)?.focus({ preventScroll: !0 });
|
|
30857
30871
|
}, [i]);
|
|
30858
|
-
let R = j === null ? null :
|
|
30872
|
+
let R = j === null ? null : dP(j, o);
|
|
30859
30873
|
return /* @__PURE__ */ U("div", {
|
|
30860
30874
|
ref: S,
|
|
30861
30875
|
"data-testid": "retrain-canvas",
|
|
@@ -30876,19 +30890,20 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30876
30890
|
className: "absolute max-w-none pointer-events-none",
|
|
30877
30891
|
style: R
|
|
30878
30892
|
}),
|
|
30879
|
-
j !== null && v && (_?.removed ?? []).map((e) => /* @__PURE__ */ H(
|
|
30893
|
+
j !== null && v && (_?.removed ?? []).map((e) => /* @__PURE__ */ H(CP, {
|
|
30880
30894
|
ghost: e,
|
|
30881
|
-
rect:
|
|
30895
|
+
rect: uP(e.bbox, j, o),
|
|
30896
|
+
bounds: j,
|
|
30882
30897
|
dimmed: b !== null
|
|
30883
30898
|
}, `removed-${e.ref}`)),
|
|
30884
30899
|
j !== null && r.map((e) => {
|
|
30885
|
-
let t =
|
|
30900
|
+
let t = uP(e.bbox, j, o), n = _?.byKey.get(e.key), r = n?.kind ?? xN(e), a = AN(r), s = e.key === i, c = hN(e.key, b), l = a.strokeWidth + (s || c === "hovered" ? 1.5 : 0), u = e.label ?? e.macroClass, f = rP(t, nP(`${u}${e.kind === "model_error" ? " ✕" : ""}${e.flag !== void 0 && e.flag.verdict !== "confirmed" ? " !" : ""}`), j);
|
|
30886
30901
|
return /* @__PURE__ */ U("div", { children: [c === "hovered" && n?.originBbox !== void 0 && /* @__PURE__ */ H("div", {
|
|
30887
30902
|
"data-testid": `retrain-origin-${e.key}`,
|
|
30888
30903
|
"aria-hidden": "true",
|
|
30889
30904
|
className: "absolute pointer-events-none",
|
|
30890
30905
|
style: {
|
|
30891
|
-
...
|
|
30906
|
+
...uP(n.originBbox, j, o),
|
|
30892
30907
|
border: `1px dashed ${a.stroke}`,
|
|
30893
30908
|
opacity: .55
|
|
30894
30909
|
}
|
|
@@ -30919,7 +30934,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30919
30934
|
opacity: c === "dimmed" ? .35 : 1
|
|
30920
30935
|
},
|
|
30921
30936
|
children: /* @__PURE__ */ U("span", {
|
|
30922
|
-
className: `absolute
|
|
30937
|
+
className: `absolute flex items-center gap-1 whitespace-nowrap rounded px-1 text-[11px] font-medium leading-4 ${f.anchor === "right" ? "right-0" : "left-0"} ${f.row === "inside" ? "top-0" : "-top-5"}`,
|
|
30923
30938
|
style: {
|
|
30924
30939
|
background: a.labelBackground,
|
|
30925
30940
|
color: a.labelColor,
|
|
@@ -30938,7 +30953,7 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30938
30953
|
})] }, e.key);
|
|
30939
30954
|
}),
|
|
30940
30955
|
j !== null && ne !== void 0 && cN.map((e) => {
|
|
30941
|
-
let t =
|
|
30956
|
+
let t = lP(fN(ne.bbox, e), j, o);
|
|
30942
30957
|
return /* @__PURE__ */ H("div", {
|
|
30943
30958
|
"data-testid": `retrain-handle-${e}`,
|
|
30944
30959
|
className: "absolute h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-primary pointer-events-none",
|
|
@@ -30950,13 +30965,13 @@ function vP({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30950
30965
|
}),
|
|
30951
30966
|
T !== null && j !== null && /* @__PURE__ */ H("div", {
|
|
30952
30967
|
className: "absolute border border-dashed border-primary pointer-events-none",
|
|
30953
|
-
style:
|
|
30968
|
+
style: uP(T, j, o)
|
|
30954
30969
|
})
|
|
30955
30970
|
]
|
|
30956
30971
|
});
|
|
30957
30972
|
}
|
|
30958
|
-
function
|
|
30959
|
-
let
|
|
30973
|
+
function CP({ ghost: e, rect: t, bounds: n, dimmed: r }) {
|
|
30974
|
+
let i = AN("removed"), a = rP(t, nP(e.label), n);
|
|
30960
30975
|
return /* @__PURE__ */ H("div", {
|
|
30961
30976
|
"data-testid": `retrain-ghost-${e.ref}`,
|
|
30962
30977
|
"aria-hidden": "true",
|
|
@@ -30966,14 +30981,14 @@ function yP({ ghost: e, rect: t, dimmed: n }) {
|
|
|
30966
30981
|
top: t.top,
|
|
30967
30982
|
width: t.width,
|
|
30968
30983
|
height: t.height,
|
|
30969
|
-
border: `${String(
|
|
30970
|
-
opacity:
|
|
30984
|
+
border: `${String(i.strokeWidth)}px ${i.strokeStyle} ${i.stroke}`,
|
|
30985
|
+
opacity: r ? jN : .85
|
|
30971
30986
|
},
|
|
30972
30987
|
children: /* @__PURE__ */ H("span", {
|
|
30973
|
-
className: `absolute
|
|
30988
|
+
className: `absolute whitespace-nowrap rounded px-1 text-[11px] font-medium leading-4 line-through ${a.anchor === "right" ? "right-0" : "left-0"} ${a.row === "inside" ? "top-0" : "-top-5"}`,
|
|
30974
30989
|
style: {
|
|
30975
|
-
background:
|
|
30976
|
-
color:
|
|
30990
|
+
background: i.labelBackground,
|
|
30991
|
+
color: i.labelColor
|
|
30977
30992
|
},
|
|
30978
30993
|
children: e.label
|
|
30979
30994
|
})
|
|
@@ -30982,19 +30997,19 @@ function yP({ ghost: e, rect: t, dimmed: n }) {
|
|
|
30982
30997
|
//#endregion
|
|
30983
30998
|
//#region src/page/frames/RetrainCanvasToolbar.tsx
|
|
30984
30999
|
i();
|
|
30985
|
-
function
|
|
30986
|
-
let [e, t] = a(
|
|
31000
|
+
function wP() {
|
|
31001
|
+
let [e, t] = a(iP), [n, r] = a(!1);
|
|
30987
31002
|
return {
|
|
30988
31003
|
viewport: e,
|
|
30989
31004
|
setViewport: t,
|
|
30990
31005
|
zoomIn: s(() => {
|
|
30991
|
-
t((e) =>
|
|
31006
|
+
t((e) => fP(e, mP(e), aP));
|
|
30992
31007
|
}, []),
|
|
30993
31008
|
zoomOut: s(() => {
|
|
30994
|
-
t((e) =>
|
|
31009
|
+
t((e) => fP(e, mP(e), 1 / aP));
|
|
30995
31010
|
}, []),
|
|
30996
31011
|
fit: s(() => {
|
|
30997
|
-
t(
|
|
31012
|
+
t(iP);
|
|
30998
31013
|
}, []),
|
|
30999
31014
|
panMode: n,
|
|
31000
31015
|
togglePan: s(() => {
|
|
@@ -31002,8 +31017,8 @@ function bP() {
|
|
|
31002
31017
|
}, [])
|
|
31003
31018
|
};
|
|
31004
31019
|
}
|
|
31005
|
-
function
|
|
31006
|
-
let o =
|
|
31020
|
+
function TP({ frameNav: e, view: t, canUndo: n, canRedo: r, onUndo: i, onRedo: a }) {
|
|
31021
|
+
let o = sP(t.viewport);
|
|
31007
31022
|
return /* @__PURE__ */ U("div", {
|
|
31008
31023
|
className: "flex shrink-0 flex-wrap items-center gap-1 px-2 py-1 border-b border-border bg-surface",
|
|
31009
31024
|
children: [
|
|
@@ -31096,7 +31111,7 @@ function xP({ frameNav: e, view: t, canUndo: n, canRedo: r, onUndo: i, onRedo: a
|
|
|
31096
31111
|
children: "Keyboard and gestures"
|
|
31097
31112
|
}), /* @__PURE__ */ H("table", {
|
|
31098
31113
|
className: "w-full text-[11px]",
|
|
31099
|
-
children: /* @__PURE__ */ H("tbody", { children:
|
|
31114
|
+
children: /* @__PURE__ */ H("tbody", { children: vP.map((e) => /* @__PURE__ */ U("tr", {
|
|
31100
31115
|
className: "align-top",
|
|
31101
31116
|
children: [/* @__PURE__ */ H("td", {
|
|
31102
31117
|
className: "py-0.5 pr-2 font-mono whitespace-nowrap text-foreground",
|
|
@@ -31113,15 +31128,15 @@ function xP({ frameNav: e, view: t, canUndo: n, canRedo: r, onUndo: i, onRedo: a
|
|
|
31113
31128
|
}
|
|
31114
31129
|
//#endregion
|
|
31115
31130
|
//#region src/page/frames/RetrainEditorSummary.tsx
|
|
31116
|
-
function
|
|
31131
|
+
function EP(e, t, n) {
|
|
31117
31132
|
return n || t === null ? e.counts : {
|
|
31118
31133
|
...e.counts,
|
|
31119
31134
|
...t,
|
|
31120
31135
|
draft: e.counts.draft
|
|
31121
31136
|
};
|
|
31122
31137
|
}
|
|
31123
|
-
function
|
|
31124
|
-
let o =
|
|
31138
|
+
function DP({ review: e, savedCounts: t, savedApproximate: n, dirty: r, showRemoved: i, onShowRemovedChange: a }) {
|
|
31139
|
+
let o = EP(e, t, r), s = r ? e.approximate : n;
|
|
31125
31140
|
return /* @__PURE__ */ U("div", {
|
|
31126
31141
|
"data-testid": "retrain-review-summary",
|
|
31127
31142
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
@@ -31163,7 +31178,7 @@ function CP({ review: e, savedCounts: t, savedApproximate: n, dirty: r, showRemo
|
|
|
31163
31178
|
//#endregion
|
|
31164
31179
|
//#region src/page/frames/use-assist-detector.ts
|
|
31165
31180
|
i();
|
|
31166
|
-
function
|
|
31181
|
+
function OP(e) {
|
|
31167
31182
|
let t = Cc({ deviceIds: e === null ? [] : [e] }, {
|
|
31168
31183
|
enabled: e !== null,
|
|
31169
31184
|
staleTime: 3e4
|
|
@@ -31192,7 +31207,7 @@ function wP(e) {
|
|
|
31192
31207
|
schema: i.data
|
|
31193
31208
|
};
|
|
31194
31209
|
}
|
|
31195
|
-
function
|
|
31210
|
+
function kP(e) {
|
|
31196
31211
|
return {
|
|
31197
31212
|
past: [],
|
|
31198
31213
|
present: e,
|
|
@@ -31200,25 +31215,25 @@ function TP(e) {
|
|
|
31200
31215
|
gestureBase: null
|
|
31201
31216
|
};
|
|
31202
31217
|
}
|
|
31203
|
-
function
|
|
31218
|
+
function AP(e, t) {
|
|
31204
31219
|
let n = [...e, t];
|
|
31205
31220
|
return n.length > 100 ? n.slice(n.length - 100) : n;
|
|
31206
31221
|
}
|
|
31207
|
-
function
|
|
31222
|
+
function jP(e, t) {
|
|
31208
31223
|
return t === e.present ? e : {
|
|
31209
|
-
past:
|
|
31224
|
+
past: AP(e.past, e.present),
|
|
31210
31225
|
present: t,
|
|
31211
31226
|
future: [],
|
|
31212
31227
|
gestureBase: null
|
|
31213
31228
|
};
|
|
31214
31229
|
}
|
|
31215
|
-
function
|
|
31230
|
+
function MP(e, t) {
|
|
31216
31231
|
return {
|
|
31217
31232
|
...e,
|
|
31218
31233
|
present: t
|
|
31219
31234
|
};
|
|
31220
31235
|
}
|
|
31221
|
-
function
|
|
31236
|
+
function NP(e) {
|
|
31222
31237
|
let t = e.past[e.past.length - 1];
|
|
31223
31238
|
return t === void 0 ? e : {
|
|
31224
31239
|
past: e.past.slice(0, -1),
|
|
@@ -31227,68 +31242,68 @@ function kP(e) {
|
|
|
31227
31242
|
gestureBase: null
|
|
31228
31243
|
};
|
|
31229
31244
|
}
|
|
31230
|
-
function
|
|
31245
|
+
function PP(e) {
|
|
31231
31246
|
let [t, ...n] = e.future;
|
|
31232
31247
|
return t === void 0 ? e : {
|
|
31233
|
-
past:
|
|
31248
|
+
past: AP(e.past, e.present),
|
|
31234
31249
|
present: t,
|
|
31235
31250
|
future: n,
|
|
31236
31251
|
gestureBase: null
|
|
31237
31252
|
};
|
|
31238
31253
|
}
|
|
31239
|
-
function
|
|
31254
|
+
function FP(e) {
|
|
31240
31255
|
return {
|
|
31241
31256
|
...e,
|
|
31242
31257
|
gestureBase: e.present
|
|
31243
31258
|
};
|
|
31244
31259
|
}
|
|
31245
|
-
function
|
|
31260
|
+
function IP(e, t) {
|
|
31246
31261
|
return {
|
|
31247
31262
|
...e,
|
|
31248
31263
|
present: t
|
|
31249
31264
|
};
|
|
31250
31265
|
}
|
|
31251
|
-
function
|
|
31266
|
+
function LP(e) {
|
|
31252
31267
|
let t = e.gestureBase;
|
|
31253
31268
|
return t === null ? e : t === e.present ? {
|
|
31254
31269
|
...e,
|
|
31255
31270
|
gestureBase: null
|
|
31256
31271
|
} : {
|
|
31257
|
-
past:
|
|
31272
|
+
past: AP(e.past, t),
|
|
31258
31273
|
present: e.present,
|
|
31259
31274
|
future: [],
|
|
31260
31275
|
gestureBase: null
|
|
31261
31276
|
};
|
|
31262
31277
|
}
|
|
31263
|
-
function
|
|
31278
|
+
function RP(e) {
|
|
31264
31279
|
return e.past.length > 0;
|
|
31265
31280
|
}
|
|
31266
|
-
function
|
|
31281
|
+
function zP(e) {
|
|
31267
31282
|
return e.future.length > 0;
|
|
31268
31283
|
}
|
|
31269
31284
|
//#endregion
|
|
31270
31285
|
//#region src/page/frames/use-retrain-editor-history.ts
|
|
31271
31286
|
i();
|
|
31272
|
-
function
|
|
31287
|
+
function BP(e, t) {
|
|
31273
31288
|
return typeof e == "function" ? e(t) : e;
|
|
31274
31289
|
}
|
|
31275
|
-
function
|
|
31276
|
-
let [t, n] = a(() =>
|
|
31277
|
-
n((t) =>
|
|
31290
|
+
function VP(e) {
|
|
31291
|
+
let [t, n] = a(() => kP(e())), r = s((e) => {
|
|
31292
|
+
n((t) => jP(t, BP(e, t.present)));
|
|
31278
31293
|
}, []), i = s((e) => {
|
|
31279
|
-
n(
|
|
31294
|
+
n(kP(e));
|
|
31280
31295
|
}, []), o = s((e) => {
|
|
31281
|
-
n((t) =>
|
|
31296
|
+
n((t) => MP(t, BP(e, t.present)));
|
|
31282
31297
|
}, []), c = s(() => {
|
|
31283
|
-
n((e) =>
|
|
31298
|
+
n((e) => FP(e));
|
|
31284
31299
|
}, []), l = s((e) => {
|
|
31285
|
-
n((t) =>
|
|
31300
|
+
n((t) => IP(t, BP(e, t.present)));
|
|
31286
31301
|
}, []), u = s(() => {
|
|
31287
|
-
n((e) =>
|
|
31302
|
+
n((e) => LP(e));
|
|
31288
31303
|
}, []), d = s(() => {
|
|
31289
|
-
n((e) =>
|
|
31304
|
+
n((e) => NP(e));
|
|
31290
31305
|
}, []), f = s(() => {
|
|
31291
|
-
n((e) =>
|
|
31306
|
+
n((e) => PP(e));
|
|
31292
31307
|
}, []);
|
|
31293
31308
|
return {
|
|
31294
31309
|
editor: t.present,
|
|
@@ -31300,20 +31315,20 @@ function LP(e) {
|
|
|
31300
31315
|
endGesture: u,
|
|
31301
31316
|
undo: d,
|
|
31302
31317
|
redo: f,
|
|
31303
|
-
canUndo:
|
|
31304
|
-
canRedo:
|
|
31318
|
+
canUndo: RP(t),
|
|
31319
|
+
canRedo: zP(t)
|
|
31305
31320
|
};
|
|
31306
31321
|
}
|
|
31307
31322
|
//#endregion
|
|
31308
31323
|
//#region src/page/frames/use-retrain-shortcuts.ts
|
|
31309
31324
|
i();
|
|
31310
|
-
function
|
|
31325
|
+
function HP(e, t) {
|
|
31311
31326
|
let n = e.boxes.length;
|
|
31312
31327
|
if (n === 0) return null;
|
|
31313
31328
|
let r = e.boxes.findIndex((t) => t.key === e.selectedKey), i = r < 0 ? t === 1 ? 0 : n - 1 : (r + t + n) % n;
|
|
31314
31329
|
return e.boxes[i]?.key ?? null;
|
|
31315
31330
|
}
|
|
31316
|
-
function
|
|
31331
|
+
function UP(e, t) {
|
|
31317
31332
|
let { history: n } = t, r = n.editor.selectedKey;
|
|
31318
31333
|
switch (e.kind) {
|
|
31319
31334
|
case "next-frame": return t.onNextFrame();
|
|
@@ -31328,7 +31343,7 @@ function zP(e, t) {
|
|
|
31328
31343
|
case "accept-all": return n.setEditor((e) => WM(e)), !0;
|
|
31329
31344
|
case "select-next":
|
|
31330
31345
|
case "select-prev": {
|
|
31331
|
-
let t =
|
|
31346
|
+
let t = HP(n.editor, e.kind === "select-next" ? 1 : -1);
|
|
31332
31347
|
return t === null ? !1 : (n.selectOnly((e) => qM(e, t)), !0);
|
|
31333
31348
|
}
|
|
31334
31349
|
case "deselect": return r === null ? !1 : (n.selectOnly((e) => qM(e, null)), !0);
|
|
@@ -31343,25 +31358,25 @@ function zP(e, t) {
|
|
|
31343
31358
|
default: return !1;
|
|
31344
31359
|
}
|
|
31345
31360
|
}
|
|
31346
|
-
function
|
|
31361
|
+
function WP(e, t) {
|
|
31347
31362
|
let n = t?.current?.closest("dialog") ?? null, r = e.target, i = r instanceof Element ? r.closest("dialog") : null;
|
|
31348
31363
|
return i === null || i === n;
|
|
31349
31364
|
}
|
|
31350
|
-
function
|
|
31365
|
+
function GP(e, t, n) {
|
|
31351
31366
|
let r = u(t);
|
|
31352
31367
|
r.current = t, y(() => {
|
|
31353
31368
|
if (!e) return;
|
|
31354
31369
|
let t = (e) => {
|
|
31355
|
-
if (e.defaultPrevented || e.isComposing || !
|
|
31356
|
-
let t =
|
|
31370
|
+
if (e.defaultPrevented || e.isComposing || !WP(e, n)) return;
|
|
31371
|
+
let t = _P({
|
|
31357
31372
|
key: e.key,
|
|
31358
31373
|
ctrlKey: e.ctrlKey,
|
|
31359
31374
|
metaKey: e.metaKey,
|
|
31360
31375
|
shiftKey: e.shiftKey,
|
|
31361
31376
|
altKey: e.altKey,
|
|
31362
|
-
typing:
|
|
31377
|
+
typing: gP(e.target)
|
|
31363
31378
|
});
|
|
31364
|
-
t !== null &&
|
|
31379
|
+
t !== null && UP(t, r.current) && e.preventDefault();
|
|
31365
31380
|
};
|
|
31366
31381
|
return window.addEventListener("keydown", t), () => {
|
|
31367
31382
|
window.removeEventListener("keydown", t);
|
|
@@ -31371,14 +31386,14 @@ function VP(e, t, n) {
|
|
|
31371
31386
|
//#endregion
|
|
31372
31387
|
//#region src/page/frames/use-unsaved-guard.ts
|
|
31373
31388
|
i();
|
|
31374
|
-
var
|
|
31389
|
+
var KP = {
|
|
31375
31390
|
title: "Discard unsaved changes?",
|
|
31376
31391
|
message: "This frame has edits that are not saved. Leaving it now loses them.",
|
|
31377
31392
|
confirmLabel: "Discard changes",
|
|
31378
31393
|
cancelLabel: "Keep editing",
|
|
31379
31394
|
variant: "danger"
|
|
31380
31395
|
};
|
|
31381
|
-
function
|
|
31396
|
+
function qP(e) {
|
|
31382
31397
|
let t = Xl();
|
|
31383
31398
|
return y(() => {
|
|
31384
31399
|
if (!e) return;
|
|
@@ -31388,12 +31403,12 @@ function UP(e) {
|
|
|
31388
31403
|
return window.addEventListener("beforeunload", t), () => {
|
|
31389
31404
|
window.removeEventListener("beforeunload", t);
|
|
31390
31405
|
};
|
|
31391
|
-
}, [e]), s((n) => nN(e, () => t(
|
|
31406
|
+
}, [e]), s((n) => nN(e, () => t(KP), n), [e, t]);
|
|
31392
31407
|
}
|
|
31393
31408
|
//#endregion
|
|
31394
31409
|
//#region src/page/frames/RetrainWorkbench.tsx
|
|
31395
31410
|
i();
|
|
31396
|
-
var
|
|
31411
|
+
var JP = "person", YP = {
|
|
31397
31412
|
pending: "Reading which detector this camera runs…",
|
|
31398
31413
|
"placement-unreadable": "The detection stage of this camera could not be read, so the model it runs is unknown — not absent.",
|
|
31399
31414
|
"detection-off": "This camera runs no object detector, so there is no proposal to mirror.",
|
|
@@ -31402,11 +31417,11 @@ var WP = "person", GP = {
|
|
|
31402
31417
|
"step-unknown": "That node carries no object-detection step in its catalog.",
|
|
31403
31418
|
"no-model": "No object-detection model on that accelerator can be resolved for this camera."
|
|
31404
31419
|
};
|
|
31405
|
-
function
|
|
31406
|
-
let f = u(null), p = e.find((e) => e.frameId === t), h = p?.deviceId ?? null, g =
|
|
31420
|
+
function XP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep: i, onFramesChanged: o, onSaved: c, onDirtyChange: l, setNotice: d }) {
|
|
31421
|
+
let f = u(null), p = e.find((e) => e.frameId === t), h = p?.deviceId ?? null, g = VP(() => RM([], [])), { editor: _, setEditor: v, resetEditor: b, selectOnly: x } = g, S = wP(), [C, w] = a(null), [T, E] = a(!0), [D, O] = a(!1), [k, A] = a(!1), [j, M] = a(null), N = lc({ frameIds: [t] }), P = m(() => e.map((e) => e.frameId), [e]), F = lc({ frameIds: P }, {
|
|
31407
31422
|
enabled: P.length > 0,
|
|
31408
31423
|
staleTime: 6e4
|
|
31409
|
-
}), I = m(() => CN(F.data ?? []), [F.data]), ee = AM(p?.imageUrl === void 0 ? void 0 : ie(p.imageUrl)), te = cc(), ne = uc(), re = fc(), { detector: L, schema: R } =
|
|
31424
|
+
}), I = m(() => CN(F.data ?? []), [F.data]), ee = AM(p?.imageUrl === void 0 ? void 0 : ie(p.imageUrl)), te = cc(), ne = uc(), re = fc(), { detector: L, schema: R } = OP(h), ae = u({
|
|
31410
31425
|
stored: N.data,
|
|
31411
31426
|
copy: p
|
|
31412
31427
|
});
|
|
@@ -31436,7 +31451,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31436
31451
|
y(() => {
|
|
31437
31452
|
w((e) => _N(e, _.boxes.map((e) => e.key)));
|
|
31438
31453
|
}, [_.boxes]);
|
|
31439
|
-
let he =
|
|
31454
|
+
let he = qP(se), ge = s(async (e) => {
|
|
31440
31455
|
p !== void 0 && (await re.mutateAsync({
|
|
31441
31456
|
...DM(p),
|
|
31442
31457
|
complete: e
|
|
@@ -31448,7 +31463,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31448
31463
|
]), _e = s(async (e) => {
|
|
31449
31464
|
if (p === void 0) return;
|
|
31450
31465
|
if (d(null), L.kind !== "resolved") {
|
|
31451
|
-
d(
|
|
31466
|
+
d(YP[L.gap]);
|
|
31452
31467
|
return;
|
|
31453
31468
|
}
|
|
31454
31469
|
let t = await te.mutateAsync({
|
|
@@ -31484,7 +31499,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31484
31499
|
v,
|
|
31485
31500
|
d
|
|
31486
31501
|
]), ve = s((e) => {
|
|
31487
|
-
v((t) => BM(t, e,
|
|
31502
|
+
v((t) => BM(t, e, JP));
|
|
31488
31503
|
}, [v]), [ye, be] = a(!1), xe = s(async () => {
|
|
31489
31504
|
if (p === void 0) return;
|
|
31490
31505
|
let e = XM(_);
|
|
@@ -31518,7 +31533,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31518
31533
|
}, [N, c]), Ce = ee.src, we = RN(_.boxes) && p !== void 0, Te = XM(_), z = (e) => r(e) ? (he(() => {
|
|
31519
31534
|
i(e);
|
|
31520
31535
|
}), !0) : !1;
|
|
31521
|
-
|
|
31536
|
+
GP(!ye, {
|
|
31522
31537
|
history: g,
|
|
31523
31538
|
onNextFrame: () => z(1),
|
|
31524
31539
|
onPrevFrame: () => z(-1),
|
|
@@ -31582,7 +31597,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31582
31597
|
}),
|
|
31583
31598
|
/* @__PURE__ */ H("p", {
|
|
31584
31599
|
className: "shrink-0 border-b border-border px-3 py-1 text-[11px] text-foreground-subtle",
|
|
31585
|
-
children: L.kind === "resolved" ? `Proposals come from ${L.modelId} at ${L.minScore.toFixed(2)}, on ${L.nodeId} — what this camera really runs.` :
|
|
31600
|
+
children: L.kind === "resolved" ? `Proposals come from ${L.modelId} at ${L.minScore.toFixed(2)}, on ${L.nodeId} — what this camera really runs.` : YP[L.gap]
|
|
31586
31601
|
}),
|
|
31587
31602
|
p !== void 0 && /* @__PURE__ */ U("div", {
|
|
31588
31603
|
className: "shrink-0 border-b border-border",
|
|
@@ -31649,7 +31664,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31649
31664
|
className: `flex min-h-0 flex-1 flex-col gap-2 p-2 sm:p-3 ${ye ? "pointer-events-none opacity-70" : ""}`,
|
|
31650
31665
|
"aria-busy": ye,
|
|
31651
31666
|
children: [
|
|
31652
|
-
/* @__PURE__ */ H(
|
|
31667
|
+
/* @__PURE__ */ H(DP, {
|
|
31653
31668
|
review: me,
|
|
31654
31669
|
savedCounts: p?.review?.summary.counts ?? null,
|
|
31655
31670
|
savedApproximate: p?.review?.summary.approximate ?? !1,
|
|
@@ -31680,7 +31695,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31680
31695
|
children: [/* @__PURE__ */ U("div", {
|
|
31681
31696
|
className: "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-md border border-border",
|
|
31682
31697
|
children: [
|
|
31683
|
-
/* @__PURE__ */ H(
|
|
31698
|
+
/* @__PURE__ */ H(TP, {
|
|
31684
31699
|
frameNav: {
|
|
31685
31700
|
label: n,
|
|
31686
31701
|
canPrev: r(-1),
|
|
@@ -31697,7 +31712,7 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31697
31712
|
Ce === null || p === void 0 ? /* @__PURE__ */ H("div", {
|
|
31698
31713
|
className: "flex flex-1 items-center justify-center gap-2 p-6 text-xs text-foreground-subtle",
|
|
31699
31714
|
children: ee.failed ? "Could not load the frame." : /* @__PURE__ */ U(W, { children: [/* @__PURE__ */ H(vr, { className: "h-3.5 w-3.5 animate-spin" }), "Loading the frame…"] })
|
|
31700
|
-
}) : /* @__PURE__ */ H(
|
|
31715
|
+
}) : /* @__PURE__ */ H(SP, {
|
|
31701
31716
|
imageSrc: Ce,
|
|
31702
31717
|
imageWidth: p.width,
|
|
31703
31718
|
imageHeight: p.height,
|
|
@@ -31747,9 +31762,9 @@ function KP({ frames: e, activeFrameId: t, framePosition: n, canStep: r, onStep:
|
|
|
31747
31762
|
//#endregion
|
|
31748
31763
|
//#region src/page/frames/CorpusAnnotateOverlay.tsx
|
|
31749
31764
|
i();
|
|
31750
|
-
var
|
|
31751
|
-
function
|
|
31752
|
-
let [f, p] = a(null), [m, h] = a(!1), g =
|
|
31765
|
+
var ZP = "flex h-[calc(100dvh-1rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] max-h-[calc(100dvh-1rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] md:h-[calc(100dvh-1rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] md:max-h-[calc(100dvh-1rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] w-[calc(100vw-1rem)] max-w-none flex-col gap-0 overflow-hidden p-0";
|
|
31766
|
+
function QP({ open: e, frames: t, activeFrameId: n, framePosition: r, canStep: i, onStep: o, onClose: c, onFramesChanged: l, onSaved: d }) {
|
|
31767
|
+
let [f, p] = a(null), [m, h] = a(!1), g = qP(m);
|
|
31753
31768
|
y(() => {
|
|
31754
31769
|
p(null);
|
|
31755
31770
|
}, [n]);
|
|
@@ -31777,7 +31792,7 @@ function JP({ open: e, frames: t, activeFrameId: n, framePosition: r, canStep: i
|
|
|
31777
31792
|
"aria-label": "Annotate frame",
|
|
31778
31793
|
"data-testid": "corpus-annotate-overlay",
|
|
31779
31794
|
ref: v,
|
|
31780
|
-
className:
|
|
31795
|
+
className: ZP,
|
|
31781
31796
|
children: [/* @__PURE__ */ H(zp, {
|
|
31782
31797
|
className: "mb-0 shrink-0 border-b border-border py-2 pl-4 pr-12",
|
|
31783
31798
|
children: /* @__PURE__ */ U("div", {
|
|
@@ -31790,7 +31805,7 @@ function JP({ open: e, frames: t, activeFrameId: n, framePosition: r, canStep: i
|
|
|
31790
31805
|
})
|
|
31791
31806
|
}), /* @__PURE__ */ H(Bp, {
|
|
31792
31807
|
className: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
|
|
31793
|
-
children: /* @__PURE__ */ H(
|
|
31808
|
+
children: /* @__PURE__ */ H(XP, {
|
|
31794
31809
|
frames: t,
|
|
31795
31810
|
activeFrameId: n,
|
|
31796
31811
|
framePosition: r,
|
|
@@ -31808,7 +31823,7 @@ function JP({ open: e, frames: t, activeFrameId: n, framePosition: r, canStep: i
|
|
|
31808
31823
|
//#endregion
|
|
31809
31824
|
//#region src/page/frames/RetrainCollectionsList.tsx
|
|
31810
31825
|
i();
|
|
31811
|
-
function
|
|
31826
|
+
function $P({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: o, onDelete: s }) {
|
|
31812
31827
|
let [c, l] = a(""), [u, d] = a(null), [f, p] = a(null), m = async () => {
|
|
31813
31828
|
let e = await i(c);
|
|
31814
31829
|
d(e), e === null && l("");
|
|
@@ -31916,19 +31931,19 @@ function YP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
|
|
|
31916
31931
|
}
|
|
31917
31932
|
//#endregion
|
|
31918
31933
|
//#region src/page/frames/CorpusCollectionsSection.tsx
|
|
31919
|
-
var
|
|
31934
|
+
var eF = {
|
|
31920
31935
|
"empty-name": "Give the collection a name.",
|
|
31921
31936
|
"duplicate-name": "A collection with that name already exists.",
|
|
31922
31937
|
"unknown-collection": "That collection no longer exists."
|
|
31923
31938
|
};
|
|
31924
|
-
function
|
|
31939
|
+
function tF({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: a, onDelete: o }) {
|
|
31925
31940
|
return /* @__PURE__ */ H(Ug, {
|
|
31926
31941
|
headingId: "corpus-collections-heading",
|
|
31927
31942
|
title: "Collections",
|
|
31928
31943
|
testId: "corpus-collections",
|
|
31929
31944
|
children: /* @__PURE__ */ H("div", {
|
|
31930
31945
|
className: w,
|
|
31931
|
-
children: /* @__PURE__ */ H(
|
|
31946
|
+
children: /* @__PURE__ */ H($P, {
|
|
31932
31947
|
collections: e ?? [],
|
|
31933
31948
|
isLoading: t,
|
|
31934
31949
|
selectedId: n,
|
|
@@ -31942,8 +31957,8 @@ function ZP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
|
|
|
31942
31957
|
}
|
|
31943
31958
|
//#endregion
|
|
31944
31959
|
//#region src/page/frames/lib/authed-download.ts
|
|
31945
|
-
var
|
|
31946
|
-
function
|
|
31960
|
+
var nF = "camstack_admin_token", rF = 6e4;
|
|
31961
|
+
function iF(e) {
|
|
31947
31962
|
if (e === null) return null;
|
|
31948
31963
|
let t = /filename\*=UTF-8''([^;]+)/i.exec(e);
|
|
31949
31964
|
if (t?.[1] !== void 0) try {
|
|
@@ -31951,20 +31966,20 @@ function eF(e) {
|
|
|
31951
31966
|
} catch {}
|
|
31952
31967
|
return /filename="?([^";]+)"?/i.exec(e)?.[1]?.trim() ?? null;
|
|
31953
31968
|
}
|
|
31954
|
-
async function
|
|
31955
|
-
let n = localStorage.getItem(
|
|
31969
|
+
async function aF(e, t) {
|
|
31970
|
+
let n = localStorage.getItem(nF), r = {};
|
|
31956
31971
|
n !== null && (r.Authorization = `Bearer ${n}`);
|
|
31957
31972
|
let i = await fetch(e, { headers: r });
|
|
31958
31973
|
if (!i.ok) throw Error(`download failed: ${String(i.status)}`);
|
|
31959
|
-
let a = await i.blob(), o =
|
|
31974
|
+
let a = await i.blob(), o = iF(i.headers.get("content-disposition")) ?? t, s = URL.createObjectURL(a), c = document.createElement("a");
|
|
31960
31975
|
c.href = s, c.download = o, c.click(), setTimeout(() => {
|
|
31961
31976
|
URL.revokeObjectURL(s);
|
|
31962
|
-
},
|
|
31977
|
+
}, rF);
|
|
31963
31978
|
}
|
|
31964
31979
|
//#endregion
|
|
31965
31980
|
//#region src/page/frames/CorpusFilterBar.tsx
|
|
31966
31981
|
i();
|
|
31967
|
-
var
|
|
31982
|
+
var oF = [
|
|
31968
31983
|
{
|
|
31969
31984
|
value: void 0,
|
|
31970
31985
|
label: "All"
|
|
@@ -31981,7 +31996,7 @@ var nF = [
|
|
|
31981
31996
|
value: "complete",
|
|
31982
31997
|
label: "Complete"
|
|
31983
31998
|
}
|
|
31984
|
-
],
|
|
31999
|
+
], sF = [
|
|
31985
32000
|
"person",
|
|
31986
32001
|
"vehicle",
|
|
31987
32002
|
"animal",
|
|
@@ -31989,10 +32004,10 @@ var nF = [
|
|
|
31989
32004
|
"face",
|
|
31990
32005
|
"plate"
|
|
31991
32006
|
];
|
|
31992
|
-
function
|
|
32007
|
+
function cF(e) {
|
|
31993
32008
|
return e ?? "all";
|
|
31994
32009
|
}
|
|
31995
|
-
function
|
|
32010
|
+
function lF({ filter: e, onChange: t, cameraItems: n, camerasListState: r, collections: i, collectionsPending: o }) {
|
|
31996
32011
|
let s = dc(m(() => ({
|
|
31997
32012
|
...e.workState === void 0 ? {} : { workState: e.workState },
|
|
31998
32013
|
...e.deviceIds.length > 0 ? { deviceIds: [...e.deviceIds] } : {},
|
|
@@ -32016,7 +32031,7 @@ function aF({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
32016
32031
|
if (s.data !== void 0) {
|
|
32017
32032
|
l(!0), d(null);
|
|
32018
32033
|
try {
|
|
32019
|
-
await
|
|
32034
|
+
await aF(ie(s.data.url), "camstack-retrain-export.tar");
|
|
32020
32035
|
} catch (e) {
|
|
32021
32036
|
d(e instanceof Error ? e.message : String(e));
|
|
32022
32037
|
} finally {
|
|
@@ -32036,8 +32051,8 @@ function aF({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
32036
32051
|
role: "group",
|
|
32037
32052
|
"aria-label": "Work state",
|
|
32038
32053
|
"data-testid": "corpus-work-state-filter",
|
|
32039
|
-
children:
|
|
32040
|
-
let n =
|
|
32054
|
+
children: oF.map((t) => {
|
|
32055
|
+
let n = cF(e.workState) === cF(t.value);
|
|
32041
32056
|
return /* @__PURE__ */ H("button", {
|
|
32042
32057
|
type: "button",
|
|
32043
32058
|
"aria-pressed": n,
|
|
@@ -32046,7 +32061,7 @@ function aF({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
32046
32061
|
},
|
|
32047
32062
|
className: Y(P, "px-2", n ? ne : ee),
|
|
32048
32063
|
children: t.label
|
|
32049
|
-
},
|
|
32064
|
+
}, cF(t.value));
|
|
32050
32065
|
})
|
|
32051
32066
|
}),
|
|
32052
32067
|
/* @__PURE__ */ H("div", {
|
|
@@ -32097,7 +32112,7 @@ function aF({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
32097
32112
|
role: "group",
|
|
32098
32113
|
"aria-label": "Annotated classes",
|
|
32099
32114
|
"data-testid": "corpus-class-filter",
|
|
32100
|
-
children:
|
|
32115
|
+
children: sF.map((t) => {
|
|
32101
32116
|
let n = e.classes.includes(t);
|
|
32102
32117
|
return /* @__PURE__ */ H("button", {
|
|
32103
32118
|
type: "button",
|
|
@@ -32120,7 +32135,7 @@ function aF({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
32120
32135
|
}
|
|
32121
32136
|
//#endregion
|
|
32122
32137
|
//#region src/page/frames/corpus-frame-badge.ts
|
|
32123
|
-
function
|
|
32138
|
+
function uF(e) {
|
|
32124
32139
|
switch (e) {
|
|
32125
32140
|
case "unannotated": return {
|
|
32126
32141
|
label: "To do",
|
|
@@ -32138,13 +32153,13 @@ function oF(e) {
|
|
|
32138
32153
|
}
|
|
32139
32154
|
//#endregion
|
|
32140
32155
|
//#region src/page/frames/CorpusFrameGrid.tsx
|
|
32141
|
-
var
|
|
32156
|
+
var dF = [
|
|
32142
32157
|
25,
|
|
32143
32158
|
50,
|
|
32144
32159
|
100
|
|
32145
32160
|
];
|
|
32146
|
-
function
|
|
32147
|
-
let r = AM(e.thumbnailUrl === void 0 ? void 0 : ie(e.thumbnailUrl)), i =
|
|
32161
|
+
function fF({ frame: e, cameraName: t, onOpen: n }) {
|
|
32162
|
+
let r = AM(e.thumbnailUrl === void 0 ? void 0 : ie(e.thumbnailUrl)), i = uF(e.workState), a = r.src ?? void 0;
|
|
32148
32163
|
return /* @__PURE__ */ U("button", {
|
|
32149
32164
|
type: "button",
|
|
32150
32165
|
className: "group flex min-w-0 flex-col overflow-hidden rounded-md border border-border bg-surface text-left hover:border-primary/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/40",
|
|
@@ -32173,7 +32188,7 @@ function cF({ frame: e, cameraName: t, onOpen: n }) {
|
|
|
32173
32188
|
})]
|
|
32174
32189
|
});
|
|
32175
32190
|
}
|
|
32176
|
-
function
|
|
32191
|
+
function pF({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError: a, deviceNames: o, onPageChange: s, onPageSizeChange: c, onOpenFrame: l }) {
|
|
32177
32192
|
let u = e !== void 0 && t !== void 0;
|
|
32178
32193
|
return /* @__PURE__ */ U("div", {
|
|
32179
32194
|
className: "space-y-3",
|
|
@@ -32195,7 +32210,7 @@ function lF({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
|
|
|
32195
32210
|
}) : null,
|
|
32196
32211
|
u && e.length > 0 ? /* @__PURE__ */ H("div", {
|
|
32197
32212
|
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",
|
|
32198
|
-
children: e.map((e) => /* @__PURE__ */ H(
|
|
32213
|
+
children: e.map((e) => /* @__PURE__ */ H(fF, {
|
|
32199
32214
|
frame: e,
|
|
32200
32215
|
cameraName: o.get(e.deviceId) ?? `Camera ${String(e.deviceId)}`,
|
|
32201
32216
|
onOpen: () => {
|
|
@@ -32207,7 +32222,7 @@ function lF({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
|
|
|
32207
32222
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
32208
32223
|
children: [/* @__PURE__ */ H(fA, {
|
|
32209
32224
|
value: r,
|
|
32210
|
-
options:
|
|
32225
|
+
options: dF,
|
|
32211
32226
|
onChange: c,
|
|
32212
32227
|
ariaLabel: "Frames per page"
|
|
32213
32228
|
}), /* @__PURE__ */ H(Cd, {
|
|
@@ -32224,18 +32239,18 @@ function lF({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
|
|
|
32224
32239
|
//#endregion
|
|
32225
32240
|
//#region src/page/frames/CorpusKpiBar.tsx
|
|
32226
32241
|
i();
|
|
32227
|
-
var
|
|
32228
|
-
function
|
|
32242
|
+
var mF = 8;
|
|
32243
|
+
function hF(e, t) {
|
|
32229
32244
|
return t.get(e) ?? `Camera ${String(e)}`;
|
|
32230
32245
|
}
|
|
32231
|
-
function
|
|
32246
|
+
function gF(e) {
|
|
32232
32247
|
return e === null ? "—" : `${(e * 100).toFixed(0)}%`;
|
|
32233
32248
|
}
|
|
32234
|
-
function
|
|
32249
|
+
function _F(e) {
|
|
32235
32250
|
return [...e].toSorted((e, t) => t.unannotated === e.unannotated ? e.deviceId - t.deviceId : t.unannotated - e.unannotated);
|
|
32236
32251
|
}
|
|
32237
|
-
function
|
|
32238
|
-
let [o, s] = a(!1), c = m(() => e === void 0 ? [] :
|
|
32252
|
+
function vF({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera: i }) {
|
|
32253
|
+
let [o, s] = a(!1), c = m(() => e === void 0 ? [] : _F(e.cameras), [e]), l = o ? c : c.slice(0, mF);
|
|
32239
32254
|
return /* @__PURE__ */ U("div", {
|
|
32240
32255
|
className: "space-y-3",
|
|
32241
32256
|
"data-testid": "corpus-kpi-bar",
|
|
@@ -32306,10 +32321,10 @@ function mF({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
|
|
|
32306
32321
|
className: "flex items-center justify-between gap-2",
|
|
32307
32322
|
children: [/* @__PURE__ */ H("span", {
|
|
32308
32323
|
className: "min-w-0 truncate font-medium text-foreground",
|
|
32309
|
-
children:
|
|
32324
|
+
children: hF(e.deviceId, r)
|
|
32310
32325
|
}), /* @__PURE__ */ H("span", {
|
|
32311
32326
|
className: "shrink-0 text-foreground-muted",
|
|
32312
|
-
children:
|
|
32327
|
+
children: gF(e.pctOfCorpus)
|
|
32313
32328
|
})]
|
|
32314
32329
|
}),
|
|
32315
32330
|
/* @__PURE__ */ U("div", {
|
|
@@ -32332,7 +32347,7 @@ function mF({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
|
|
|
32332
32347
|
}) }, e.deviceId);
|
|
32333
32348
|
})
|
|
32334
32349
|
}),
|
|
32335
|
-
!o && c.length >
|
|
32350
|
+
!o && c.length > mF ? /* @__PURE__ */ U(Z, {
|
|
32336
32351
|
type: "button",
|
|
32337
32352
|
variant: "ghost",
|
|
32338
32353
|
size: "sm",
|
|
@@ -32353,25 +32368,25 @@ function mF({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
|
|
|
32353
32368
|
}
|
|
32354
32369
|
//#endregion
|
|
32355
32370
|
//#region src/page/frames/frame-url.ts
|
|
32356
|
-
var
|
|
32357
|
-
function
|
|
32371
|
+
var yF = "frame";
|
|
32372
|
+
function bF(e) {
|
|
32358
32373
|
let t = new URLSearchParams(e).get("frame")?.trim() ?? "";
|
|
32359
32374
|
return t === "" ? null : t;
|
|
32360
32375
|
}
|
|
32361
|
-
function
|
|
32362
|
-
t === null || t === "" ? e.delete(
|
|
32376
|
+
function xF(e, t) {
|
|
32377
|
+
t === null || t === "" ? e.delete(yF) : e.set(yF, t);
|
|
32363
32378
|
}
|
|
32364
|
-
function
|
|
32379
|
+
function SF(e) {
|
|
32365
32380
|
if (typeof window > "u") return;
|
|
32366
32381
|
let t = new URL(window.location.href);
|
|
32367
|
-
|
|
32382
|
+
xF(t.searchParams, e), window.history.replaceState({}, "", t.toString());
|
|
32368
32383
|
}
|
|
32369
32384
|
//#endregion
|
|
32370
32385
|
//#region src/page/frames/lib/retrain-frame-step.ts
|
|
32371
|
-
function
|
|
32386
|
+
function CF(e, t) {
|
|
32372
32387
|
return Math.max(1, Math.ceil(e / t));
|
|
32373
32388
|
}
|
|
32374
|
-
function
|
|
32389
|
+
function wF(e, t, n, r, i) {
|
|
32375
32390
|
let a = e.indexOf(t);
|
|
32376
32391
|
if (a < 0) return { kind: "none" };
|
|
32377
32392
|
let o = e[a + n];
|
|
@@ -32388,16 +32403,16 @@ function bF(e, t, n, r, i) {
|
|
|
32388
32403
|
frameId: o
|
|
32389
32404
|
};
|
|
32390
32405
|
}
|
|
32391
|
-
function
|
|
32406
|
+
function TF(e, t) {
|
|
32392
32407
|
return t === "first" ? e[0] : e[e.length - 1];
|
|
32393
32408
|
}
|
|
32394
32409
|
//#endregion
|
|
32395
32410
|
//#region src/page/frames/corpus-filter-url.ts
|
|
32396
|
-
var
|
|
32411
|
+
var EF = new Set([
|
|
32397
32412
|
"unannotated",
|
|
32398
32413
|
"annotated",
|
|
32399
32414
|
"complete"
|
|
32400
|
-
]),
|
|
32415
|
+
]), DF = new Set([
|
|
32401
32416
|
"person",
|
|
32402
32417
|
"vehicle",
|
|
32403
32418
|
"animal",
|
|
@@ -32405,72 +32420,72 @@ var SF = new Set([
|
|
|
32405
32420
|
"face",
|
|
32406
32421
|
"plate"
|
|
32407
32422
|
]);
|
|
32408
|
-
function
|
|
32423
|
+
function OF(e) {
|
|
32409
32424
|
return e === null || e.trim() === "" ? [] : e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
|
|
32410
32425
|
}
|
|
32411
|
-
function
|
|
32426
|
+
function kF(e) {
|
|
32412
32427
|
let t = [];
|
|
32413
|
-
for (let n of
|
|
32428
|
+
for (let n of OF(e)) {
|
|
32414
32429
|
let e = Number.parseInt(n, 10);
|
|
32415
32430
|
Number.isInteger(e) && e > 0 && !t.includes(e) && t.push(e);
|
|
32416
32431
|
}
|
|
32417
32432
|
return t;
|
|
32418
32433
|
}
|
|
32419
|
-
function
|
|
32420
|
-
return
|
|
32434
|
+
function AF(e) {
|
|
32435
|
+
return DF.has(e);
|
|
32421
32436
|
}
|
|
32422
|
-
function
|
|
32423
|
-
return
|
|
32437
|
+
function jF(e) {
|
|
32438
|
+
return EF.has(e);
|
|
32424
32439
|
}
|
|
32425
|
-
function
|
|
32440
|
+
function MF(e) {
|
|
32426
32441
|
let t = [];
|
|
32427
|
-
for (let n of
|
|
32442
|
+
for (let n of OF(e)) !AF(n) || t.includes(n) || t.push(n);
|
|
32428
32443
|
return t;
|
|
32429
32444
|
}
|
|
32430
|
-
function
|
|
32431
|
-
if (!(e === null || e === "")) return
|
|
32445
|
+
function NF(e) {
|
|
32446
|
+
if (!(e === null || e === "")) return jF(e) ? e : void 0;
|
|
32432
32447
|
}
|
|
32433
|
-
function
|
|
32448
|
+
function PF(e) {
|
|
32434
32449
|
if (e === null || e === "") return 1;
|
|
32435
32450
|
let t = Number.parseInt(e, 10);
|
|
32436
32451
|
return Number.isInteger(t) && t >= 1 ? t : 1;
|
|
32437
32452
|
}
|
|
32438
|
-
function
|
|
32453
|
+
function FF(e) {
|
|
32439
32454
|
let t = e.get("collection")?.trim() ?? "";
|
|
32440
32455
|
return {
|
|
32441
|
-
workState:
|
|
32442
|
-
deviceIds:
|
|
32456
|
+
workState: NF(e.get("workState")),
|
|
32457
|
+
deviceIds: kF(e.get("camera")),
|
|
32443
32458
|
collectionId: t.length > 0 ? t : void 0,
|
|
32444
|
-
classes:
|
|
32445
|
-
page:
|
|
32459
|
+
classes: MF(e.get("class")),
|
|
32460
|
+
page: PF(e.get("page"))
|
|
32446
32461
|
};
|
|
32447
32462
|
}
|
|
32448
|
-
function
|
|
32463
|
+
function IF(e, t) {
|
|
32449
32464
|
t.workState === void 0 ? e.delete("workState") : e.set("workState", t.workState), t.deviceIds.length === 0 ? e.delete("camera") : e.set("camera", t.deviceIds.join(",")), t.collectionId === void 0 || t.collectionId === "" ? e.delete("collection") : e.set("collection", t.collectionId), t.classes.length === 0 ? e.delete("class") : e.set("class", t.classes.join(",")), t.page <= 1 ? e.delete("page") : e.set("page", String(t.page));
|
|
32450
32465
|
}
|
|
32451
|
-
function
|
|
32466
|
+
function LF(e) {
|
|
32452
32467
|
if (typeof window > "u") return;
|
|
32453
32468
|
let t = new URL(window.location.href);
|
|
32454
|
-
|
|
32469
|
+
IF(t.searchParams, e), window.history.replaceState({}, "", t.toString());
|
|
32455
32470
|
}
|
|
32456
32471
|
//#endregion
|
|
32457
32472
|
//#region src/page/frames/FramesSection.tsx
|
|
32458
32473
|
i();
|
|
32459
|
-
var
|
|
32474
|
+
var RF = [
|
|
32460
32475
|
25,
|
|
32461
32476
|
50,
|
|
32462
32477
|
100
|
|
32463
32478
|
];
|
|
32464
|
-
function
|
|
32479
|
+
function zF() {
|
|
32465
32480
|
return typeof window > "u" ? {
|
|
32466
32481
|
workState: void 0,
|
|
32467
32482
|
deviceIds: [],
|
|
32468
32483
|
collectionId: void 0,
|
|
32469
32484
|
classes: [],
|
|
32470
32485
|
page: 1
|
|
32471
|
-
} :
|
|
32486
|
+
} : FF(new URLSearchParams(window.location.search));
|
|
32472
32487
|
}
|
|
32473
|
-
function
|
|
32488
|
+
function BF(e, t) {
|
|
32474
32489
|
return {
|
|
32475
32490
|
page: e.page,
|
|
32476
32491
|
pageSize: t,
|
|
@@ -32480,13 +32495,13 @@ function IF(e, t) {
|
|
|
32480
32495
|
...e.classes.length > 0 ? { classes: [...e.classes] } : {}
|
|
32481
32496
|
};
|
|
32482
32497
|
}
|
|
32483
|
-
function
|
|
32484
|
-
let [e, t] = a(
|
|
32498
|
+
function VF() {
|
|
32499
|
+
let [e, t] = a(zF), [n, r] = uA({
|
|
32485
32500
|
storageKey: "training-corpus-page-size",
|
|
32486
|
-
options:
|
|
32501
|
+
options: RF,
|
|
32487
32502
|
defaultSize: 50
|
|
32488
|
-
}), [i, o] = a(() => typeof window > "u" ? null :
|
|
32489
|
-
t(e),
|
|
32503
|
+
}), [i, o] = a(() => typeof window > "u" ? null : bF(window.location.search)), [c, l] = a(null), u = s((e) => {
|
|
32504
|
+
t(e), LF(e);
|
|
32490
32505
|
}, []), d = Zs({
|
|
32491
32506
|
projection: "slim",
|
|
32492
32507
|
isCamera: !0
|
|
@@ -32499,7 +32514,7 @@ function LF() {
|
|
|
32499
32514
|
name: e.name,
|
|
32500
32515
|
type: e.type,
|
|
32501
32516
|
location: typeof e.location == "string" ? e.location : null
|
|
32502
|
-
})), [d.data]), h = nM(d), g = sc({}), _ = oc(
|
|
32517
|
+
})), [d.data]), h = nM(d), g = sc({}), _ = oc(BF(e, n)), v = gc({}), b = hc(), x = _c(), S = vc();
|
|
32503
32518
|
y(() => {
|
|
32504
32519
|
let t = _.data?.total;
|
|
32505
32520
|
if (t === void 0) return;
|
|
@@ -32522,7 +32537,7 @@ function LF() {
|
|
|
32522
32537
|
});
|
|
32523
32538
|
}, [e, u]), w = s(async (t) => {
|
|
32524
32539
|
let n = await b.mutateAsync({ name: t });
|
|
32525
|
-
return await v.refetch(), n.kind === "refused" ?
|
|
32540
|
+
return await v.refetch(), n.kind === "refused" ? eF[n.reason] ?? n.reason : (u({
|
|
32526
32541
|
...e,
|
|
32527
32542
|
collectionId: n.collection.id,
|
|
32528
32543
|
page: 1
|
|
@@ -32537,7 +32552,7 @@ function LF() {
|
|
|
32537
32552
|
id: e,
|
|
32538
32553
|
name: t
|
|
32539
32554
|
});
|
|
32540
|
-
return await v.refetch(), n.kind === "refused" ?
|
|
32555
|
+
return await v.refetch(), n.kind === "refused" ? eF[n.reason] ?? n.reason : null;
|
|
32541
32556
|
}, [x, v]), E = s(async (t) => {
|
|
32542
32557
|
await S.mutateAsync({ id: t }), e.collectionId === t && u({
|
|
32543
32558
|
...e,
|
|
@@ -32550,14 +32565,14 @@ function LF() {
|
|
|
32550
32565
|
e,
|
|
32551
32566
|
u
|
|
32552
32567
|
]), D = s((e) => {
|
|
32553
|
-
o(e),
|
|
32568
|
+
o(e), SF(e);
|
|
32554
32569
|
}, []), O = s((e) => {
|
|
32555
32570
|
D(e);
|
|
32556
32571
|
}, [D]), k = s(() => {
|
|
32557
32572
|
l(null), D(null);
|
|
32558
32573
|
}, [D]), A = _.data?.frames ?? [], j = s(async () => {
|
|
32559
32574
|
await Promise.all([_.refetch(), g.refetch()]);
|
|
32560
|
-
}, [_, g]), M = m(() => A.map((e) => e.frameId), [A]), N = _.data?.total, P =
|
|
32575
|
+
}, [_, g]), M = m(() => A.map((e) => e.frameId), [A]), N = _.data?.total, P = CF(N ?? 0, n), F = s((t) => i === null ? { kind: "none" } : wF(M, i, t, e.page, P), [
|
|
32561
32576
|
M,
|
|
32562
32577
|
i,
|
|
32563
32578
|
e.page,
|
|
@@ -32578,7 +32593,7 @@ function LF() {
|
|
|
32578
32593
|
e
|
|
32579
32594
|
]);
|
|
32580
32595
|
y(() => {
|
|
32581
|
-
c === null || _.isFetching || _.data === void 0 || _.data.page === c.page && (l(null), D(
|
|
32596
|
+
c === null || _.isFetching || _.data === void 0 || _.data.page === c.page && (l(null), D(TF(_.data.frames.map((e) => e.frameId), c.edge) ?? null));
|
|
32582
32597
|
}, [
|
|
32583
32598
|
c,
|
|
32584
32599
|
_.isFetching,
|
|
@@ -32602,14 +32617,14 @@ function LF() {
|
|
|
32602
32617
|
className: "space-y-4",
|
|
32603
32618
|
"data-testid": "frames-section",
|
|
32604
32619
|
children: [
|
|
32605
|
-
/* @__PURE__ */ H(
|
|
32620
|
+
/* @__PURE__ */ H(vF, {
|
|
32606
32621
|
kpi: g.data,
|
|
32607
32622
|
isLoading: g.isLoading,
|
|
32608
32623
|
isError: g.isError,
|
|
32609
32624
|
deviceNames: f,
|
|
32610
32625
|
onSelectCamera: C
|
|
32611
32626
|
}),
|
|
32612
|
-
/* @__PURE__ */ H(
|
|
32627
|
+
/* @__PURE__ */ H(tF, {
|
|
32613
32628
|
collections: v.data,
|
|
32614
32629
|
isLoading: v.isLoading,
|
|
32615
32630
|
selectedId: e.collectionId ?? null,
|
|
@@ -32624,7 +32639,7 @@ function LF() {
|
|
|
32624
32639
|
onRename: T,
|
|
32625
32640
|
onDelete: E
|
|
32626
32641
|
}),
|
|
32627
|
-
/* @__PURE__ */ H(
|
|
32642
|
+
/* @__PURE__ */ H(lF, {
|
|
32628
32643
|
filter: e,
|
|
32629
32644
|
onChange: u,
|
|
32630
32645
|
cameraItems: p,
|
|
@@ -32632,7 +32647,7 @@ function LF() {
|
|
|
32632
32647
|
collections: v.data,
|
|
32633
32648
|
collectionsPending: v.isLoading && v.data === void 0
|
|
32634
32649
|
}),
|
|
32635
|
-
/* @__PURE__ */ H(
|
|
32650
|
+
/* @__PURE__ */ H(pF, {
|
|
32636
32651
|
frames: _.data?.frames,
|
|
32637
32652
|
total: _.data?.total,
|
|
32638
32653
|
page: e.page,
|
|
@@ -32654,7 +32669,7 @@ function LF() {
|
|
|
32654
32669
|
},
|
|
32655
32670
|
onOpenFrame: O
|
|
32656
32671
|
}),
|
|
32657
|
-
i === null ? null : /* @__PURE__ */ H(
|
|
32672
|
+
i === null ? null : /* @__PURE__ */ H(QP, {
|
|
32658
32673
|
open: !0,
|
|
32659
32674
|
frames: A,
|
|
32660
32675
|
activeFrameId: i,
|
|
@@ -32670,7 +32685,7 @@ function LF() {
|
|
|
32670
32685
|
}
|
|
32671
32686
|
//#endregion
|
|
32672
32687
|
//#region src/page/view-model.ts
|
|
32673
|
-
var
|
|
32688
|
+
var HF = [
|
|
32674
32689
|
"uploading",
|
|
32675
32690
|
"submitted",
|
|
32676
32691
|
"starting",
|
|
@@ -32679,7 +32694,7 @@ var RF = [
|
|
|
32679
32694
|
"ready",
|
|
32680
32695
|
"registered",
|
|
32681
32696
|
"canary"
|
|
32682
|
-
],
|
|
32697
|
+
], UF = {
|
|
32683
32698
|
queued: "Queued",
|
|
32684
32699
|
uploading: "Uploading",
|
|
32685
32700
|
submitted: "Submitted",
|
|
@@ -32695,7 +32710,7 @@ var RF = [
|
|
|
32695
32710
|
lost: "Lost",
|
|
32696
32711
|
expired: "Expired",
|
|
32697
32712
|
discarded: "Discarded"
|
|
32698
|
-
},
|
|
32713
|
+
}, WF = new Set([
|
|
32699
32714
|
"ready",
|
|
32700
32715
|
"registered",
|
|
32701
32716
|
"canary",
|
|
@@ -32705,64 +32720,64 @@ var RF = [
|
|
|
32705
32720
|
"expired",
|
|
32706
32721
|
"discarded"
|
|
32707
32722
|
]);
|
|
32708
|
-
function
|
|
32709
|
-
return
|
|
32723
|
+
function GF(e) {
|
|
32724
|
+
return WF.has(e);
|
|
32710
32725
|
}
|
|
32711
|
-
function
|
|
32712
|
-
return e.some((e) => !
|
|
32726
|
+
function KF(e) {
|
|
32727
|
+
return e.some((e) => !GF(e.state));
|
|
32713
32728
|
}
|
|
32714
|
-
function
|
|
32715
|
-
let t =
|
|
32729
|
+
function qF(e) {
|
|
32730
|
+
let t = HF.indexOf(e.state);
|
|
32716
32731
|
if (t >= 0) return t;
|
|
32717
|
-
if (e.artifacts !== null || e.registeredModelIds.length > 0) return
|
|
32732
|
+
if (e.artifacts !== null || e.registeredModelIds.length > 0) return HF.indexOf("ready");
|
|
32718
32733
|
switch (e.provider.state) {
|
|
32719
|
-
case "succeeded": return
|
|
32734
|
+
case "succeeded": return HF.indexOf("collecting");
|
|
32720
32735
|
case "running":
|
|
32721
32736
|
case "failed":
|
|
32722
|
-
case "cancelled": return
|
|
32723
|
-
case "starting": return
|
|
32724
|
-
case "pending": return
|
|
32737
|
+
case "cancelled": return HF.indexOf("running");
|
|
32738
|
+
case "starting": return HF.indexOf("starting");
|
|
32739
|
+
case "pending": return HF.indexOf("submitted");
|
|
32725
32740
|
default: return 0;
|
|
32726
32741
|
}
|
|
32727
32742
|
}
|
|
32728
|
-
function
|
|
32729
|
-
if (e.state === "queued") return
|
|
32743
|
+
function JF(e) {
|
|
32744
|
+
if (e.state === "queued") return HF.map((e) => ({
|
|
32730
32745
|
state: e,
|
|
32731
|
-
label:
|
|
32746
|
+
label: UF[e],
|
|
32732
32747
|
status: "todo"
|
|
32733
32748
|
}));
|
|
32734
|
-
let t = !
|
|
32735
|
-
return
|
|
32749
|
+
let t = !HF.includes(e.state), n = qF(e);
|
|
32750
|
+
return HF.map((r, i) => {
|
|
32736
32751
|
let a = "todo";
|
|
32737
32752
|
return i < n ? a = "done" : i === n && (a = t && e.state !== "expired" ? "failed" : "current"), {
|
|
32738
32753
|
state: r,
|
|
32739
|
-
label:
|
|
32754
|
+
label: UF[r],
|
|
32740
32755
|
status: a
|
|
32741
32756
|
};
|
|
32742
32757
|
});
|
|
32743
32758
|
}
|
|
32744
|
-
function
|
|
32759
|
+
function YF(e, t) {
|
|
32745
32760
|
let n = `$${e.toFixed(2)}`;
|
|
32746
32761
|
return t ? `≈ ${n}` : n;
|
|
32747
32762
|
}
|
|
32748
|
-
function
|
|
32763
|
+
function XF(e) {
|
|
32749
32764
|
let t = Math.max(0, Math.round(e));
|
|
32750
32765
|
return t < 60 ? `${String(t)} s` : t < 3600 ? `${String(Math.floor(t / 60))} min ${String(t % 60)} s` : `${String(Math.floor(t / 3600))} h ${String(Math.floor(t % 3600 / 60))} min`;
|
|
32751
32766
|
}
|
|
32752
|
-
function
|
|
32767
|
+
function ZF(e) {
|
|
32753
32768
|
return e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : e < 1024 ** 3 ? `${(e / 1024 ** 2).toFixed(1)} MB` : `${(e / 1024 ** 3).toFixed(2)} GB`;
|
|
32754
32769
|
}
|
|
32755
|
-
function
|
|
32770
|
+
function QF(e) {
|
|
32756
32771
|
return e == null ? "—" : `${(e * 100).toFixed(1)}%`;
|
|
32757
32772
|
}
|
|
32758
|
-
function
|
|
32773
|
+
function $F(e, t) {
|
|
32759
32774
|
let n = e.provider.startedAt;
|
|
32760
32775
|
return n === null ? null : ((e.provider.endedAt ?? t) - n) / 1e3;
|
|
32761
32776
|
}
|
|
32762
|
-
function
|
|
32777
|
+
function eI(e, t) {
|
|
32763
32778
|
return e?.classes[t] ?? null;
|
|
32764
32779
|
}
|
|
32765
|
-
function
|
|
32780
|
+
function tI(e) {
|
|
32766
32781
|
let t = e.evaluation;
|
|
32767
32782
|
return t === void 0 ? [] : [...new Set([
|
|
32768
32783
|
...Object.keys(t.baseline?.classes ?? {}),
|
|
@@ -32770,12 +32785,12 @@ function ZF(e) {
|
|
|
32770
32785
|
...Object.keys(t.candidateInt8?.classes ?? {})
|
|
32771
32786
|
])].toSorted().map((e) => ({
|
|
32772
32787
|
cls: e,
|
|
32773
|
-
baseline:
|
|
32774
|
-
candidate:
|
|
32775
|
-
int8:
|
|
32788
|
+
baseline: eI(t.baseline, e),
|
|
32789
|
+
candidate: eI(t.candidate, e),
|
|
32790
|
+
int8: eI(t.candidateInt8, e)
|
|
32776
32791
|
}));
|
|
32777
32792
|
}
|
|
32778
|
-
function
|
|
32793
|
+
function nI(e) {
|
|
32779
32794
|
let t = e.evaluation?.recallDeltaByCamera ?? {}, n = [];
|
|
32780
32795
|
for (let [e, r] of Object.entries(t)) for (let [t, i] of Object.entries(r)) {
|
|
32781
32796
|
let r = i < -.01 ? "worse" : i > .01 ? "better" : "same";
|
|
@@ -32788,17 +32803,17 @@ function QF(e) {
|
|
|
32788
32803
|
}
|
|
32789
32804
|
return n.toSorted((e, t) => e.cls.localeCompare(t.cls) || e.deviceId - t.deviceId);
|
|
32790
32805
|
}
|
|
32791
|
-
function
|
|
32806
|
+
function rI(e) {
|
|
32792
32807
|
return e === "ready" || e === "registered" || e === "canary" ? "success" : e === "failed" || e === "lost" ? "danger" : e === "cancelling" || e === "cancelled" || e === "expired" || e === "discarded" ? "default" : "info";
|
|
32793
32808
|
}
|
|
32794
32809
|
//#endregion
|
|
32795
32810
|
//#region src/page/ComparisonTable.tsx
|
|
32796
|
-
var
|
|
32811
|
+
var iI = {
|
|
32797
32812
|
better: "text-success",
|
|
32798
32813
|
worse: "text-danger",
|
|
32799
32814
|
same: "text-foreground-muted"
|
|
32800
32815
|
};
|
|
32801
|
-
function
|
|
32816
|
+
function aI({ c: e }) {
|
|
32802
32817
|
if (e === null) return /* @__PURE__ */ H("td", {
|
|
32803
32818
|
className: "px-2 py-1 text-foreground-subtle",
|
|
32804
32819
|
children: "—"
|
|
@@ -32808,26 +32823,26 @@ function tI({ c: e }) {
|
|
|
32808
32823
|
className: "px-2 py-1 text-foreground",
|
|
32809
32824
|
children: [
|
|
32810
32825
|
"P ",
|
|
32811
|
-
|
|
32826
|
+
QF(e.precision),
|
|
32812
32827
|
" · R ",
|
|
32813
|
-
|
|
32828
|
+
QF(e.recall),
|
|
32814
32829
|
" · AP50 ",
|
|
32815
|
-
|
|
32830
|
+
QF(e.ap50),
|
|
32816
32831
|
/* @__PURE__ */ U("span", {
|
|
32817
32832
|
className: "block text-xs text-foreground-subtle",
|
|
32818
32833
|
children: [
|
|
32819
32834
|
"floor ",
|
|
32820
32835
|
e.floor === null ? "—" : e.floor.toFixed(2),
|
|
32821
32836
|
" · night R ",
|
|
32822
|
-
|
|
32837
|
+
QF(t),
|
|
32823
32838
|
n
|
|
32824
32839
|
]
|
|
32825
32840
|
})
|
|
32826
32841
|
]
|
|
32827
32842
|
});
|
|
32828
32843
|
}
|
|
32829
|
-
function
|
|
32830
|
-
let n =
|
|
32844
|
+
function oI({ result: e, cameraName: t }) {
|
|
32845
|
+
let n = tI(e), r = nI(e), i = n.some((e) => e.int8 !== null);
|
|
32831
32846
|
return n.length === 0 ? /* @__PURE__ */ H("p", {
|
|
32832
32847
|
className: "text-sm text-foreground-muted",
|
|
32833
32848
|
children: "No held-out evaluation in this result."
|
|
@@ -32868,16 +32883,16 @@ function nI({ result: e, cameraName: t }) {
|
|
|
32868
32883
|
")"
|
|
32869
32884
|
]
|
|
32870
32885
|
}),
|
|
32871
|
-
/* @__PURE__ */ H(
|
|
32872
|
-
/* @__PURE__ */ H(
|
|
32873
|
-
i && /* @__PURE__ */ H(
|
|
32886
|
+
/* @__PURE__ */ H(aI, { c: e.baseline }),
|
|
32887
|
+
/* @__PURE__ */ H(aI, { c: e.candidate }),
|
|
32888
|
+
i && /* @__PURE__ */ H(aI, { c: e.int8 })
|
|
32874
32889
|
]
|
|
32875
32890
|
}, e.cls)) })]
|
|
32876
32891
|
}), r.length > 0 && /* @__PURE__ */ H("ul", {
|
|
32877
32892
|
className: "flex flex-wrap gap-x-4 gap-y-1 text-xs",
|
|
32878
32893
|
"aria-label": "Recall change per camera",
|
|
32879
32894
|
children: r.map((e) => /* @__PURE__ */ U("li", {
|
|
32880
|
-
className:
|
|
32895
|
+
className: iI[e.tone],
|
|
32881
32896
|
children: [
|
|
32882
32897
|
t(e.deviceId),
|
|
32883
32898
|
" ",
|
|
@@ -32894,10 +32909,10 @@ function nI({ result: e, cameraName: t }) {
|
|
|
32894
32909
|
//#endregion
|
|
32895
32910
|
//#region src/page/use-async.ts
|
|
32896
32911
|
i();
|
|
32897
|
-
function
|
|
32912
|
+
function sI(e) {
|
|
32898
32913
|
return e instanceof Error ? e.message : String(e);
|
|
32899
32914
|
}
|
|
32900
|
-
function
|
|
32915
|
+
function cI(e, t, n = {}) {
|
|
32901
32916
|
let [r, i] = a({ status: "pending" }), [o, c] = a(0), l = u(e);
|
|
32902
32917
|
l.current = e;
|
|
32903
32918
|
let d = s(() => c((e) => e + 1), []);
|
|
@@ -32911,7 +32926,7 @@ function iI(e, t, n = {}) {
|
|
|
32911
32926
|
}).catch((t) => {
|
|
32912
32927
|
e && i({
|
|
32913
32928
|
status: "error",
|
|
32914
|
-
error:
|
|
32929
|
+
error: sI(t)
|
|
32915
32930
|
});
|
|
32916
32931
|
}), () => {
|
|
32917
32932
|
e = !1;
|
|
@@ -32935,13 +32950,13 @@ function iI(e, t, n = {}) {
|
|
|
32935
32950
|
//#endregion
|
|
32936
32951
|
//#region src/page/ResultPanel.tsx
|
|
32937
32952
|
i();
|
|
32938
|
-
function
|
|
32939
|
-
let i = Xl(), o =
|
|
32953
|
+
function lI({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
32954
|
+
let i = Xl(), o = cI(() => t.training.getJobResult.query({ id: e.id }), [e.id, e.state]), s = cI(async () => (await t.deviceManager.listAll.query({ slim: !0 })).filter((e) => e.type === "camera"), []), [c, l] = a([]), [u, d] = a(!1), [f, p] = a(null), m = async (e) => {
|
|
32940
32955
|
d(!0), p(null);
|
|
32941
32956
|
try {
|
|
32942
32957
|
await e(), n();
|
|
32943
32958
|
} catch (e) {
|
|
32944
|
-
p(
|
|
32959
|
+
p(sI(e));
|
|
32945
32960
|
} finally {
|
|
32946
32961
|
d(!1);
|
|
32947
32962
|
}
|
|
@@ -32983,7 +32998,7 @@ function aI({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
|
32983
32998
|
className: "space-y-3 border-t border-border pt-3",
|
|
32984
32999
|
"data-testid": "result-panel",
|
|
32985
33000
|
children: [
|
|
32986
|
-
/* @__PURE__ */ H(
|
|
33001
|
+
/* @__PURE__ */ H(oI, {
|
|
32987
33002
|
result: y,
|
|
32988
33003
|
cameraName: r
|
|
32989
33004
|
}),
|
|
@@ -33010,7 +33025,7 @@ function aI({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
|
33010
33025
|
children: [
|
|
33011
33026
|
b.length,
|
|
33012
33027
|
" files, ",
|
|
33013
|
-
|
|
33028
|
+
ZF(b.reduce((e, t) => e + t.bytes, 0)),
|
|
33014
33029
|
" · ",
|
|
33015
33030
|
y.licence
|
|
33016
33031
|
]
|
|
@@ -33118,12 +33133,12 @@ function aI({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
|
33118
33133
|
}
|
|
33119
33134
|
//#endregion
|
|
33120
33135
|
//#region src/page/Sparkline.tsx
|
|
33121
|
-
function
|
|
33136
|
+
function uI(e, t, n) {
|
|
33122
33137
|
if (e.length === 0) return "";
|
|
33123
33138
|
let r = Math.max(...e, 1e-4), i = e.length > 1 ? t / (e.length - 1) : 0;
|
|
33124
33139
|
return e.map((e, t) => `${t === 0 ? "M" : "L"}${(t * i).toFixed(1)},${(n - e / r * n).toFixed(1)}`).join(" ");
|
|
33125
33140
|
}
|
|
33126
|
-
function
|
|
33141
|
+
function dI({ series: e, width: t = 160, height: n = 32 }) {
|
|
33127
33142
|
let r = e.map((e) => e.map50 ?? 0);
|
|
33128
33143
|
if (r.length < 2) return /* @__PURE__ */ H("span", {
|
|
33129
33144
|
className: "text-xs text-foreground-subtle",
|
|
@@ -33139,7 +33154,7 @@ function sI({ series: e, width: t = 160, height: n = 32 }) {
|
|
|
33139
33154
|
viewBox: `0 0 ${String(t)} ${String(n)}`,
|
|
33140
33155
|
"aria-label": "mAP50 per epoch",
|
|
33141
33156
|
children: /* @__PURE__ */ H("path", {
|
|
33142
|
-
d:
|
|
33157
|
+
d: uI(r, t, n),
|
|
33143
33158
|
fill: "none",
|
|
33144
33159
|
stroke: "currentColor",
|
|
33145
33160
|
strokeWidth: 1.5
|
|
@@ -33153,13 +33168,13 @@ function sI({ series: e, width: t = 160, height: n = 32 }) {
|
|
|
33153
33168
|
//#endregion
|
|
33154
33169
|
//#region src/page/JobDetail.tsx
|
|
33155
33170
|
i();
|
|
33156
|
-
var
|
|
33171
|
+
var fI = {
|
|
33157
33172
|
done: "bg-primary/15 text-primary",
|
|
33158
33173
|
current: "bg-primary text-primary-foreground",
|
|
33159
33174
|
failed: "bg-danger text-white",
|
|
33160
33175
|
todo: "bg-surface-hover text-foreground-subtle"
|
|
33161
33176
|
};
|
|
33162
|
-
function
|
|
33177
|
+
function pI({ lines: e }) {
|
|
33163
33178
|
let t = u(null);
|
|
33164
33179
|
return y(() => {
|
|
33165
33180
|
t.current !== null && (t.current.scrollTop = t.current.scrollHeight);
|
|
@@ -33170,8 +33185,8 @@ function lI({ lines: e }) {
|
|
|
33170
33185
|
children: e.join("\n")
|
|
33171
33186
|
});
|
|
33172
33187
|
}
|
|
33173
|
-
function
|
|
33174
|
-
let a =
|
|
33188
|
+
function mI({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
|
|
33189
|
+
let a = $F(e, Date.now()), { epoch: o, epochs: s, etaSec: c, series: l } = e.progress, u = e.state === "ready" || e.state === "registered" || e.state === "canary", d = e.request.selection.collectionIds.map((e) => i(e));
|
|
33175
33190
|
return /* @__PURE__ */ U("section", {
|
|
33176
33191
|
className: "space-y-3 rounded-lg border border-border bg-surface p-3 sm:p-4",
|
|
33177
33192
|
"data-testid": `job-detail-${e.id}`,
|
|
@@ -33185,10 +33200,10 @@ function uI({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
33185
33200
|
children: e.name
|
|
33186
33201
|
}),
|
|
33187
33202
|
/* @__PURE__ */ H(hl, {
|
|
33188
|
-
variant:
|
|
33189
|
-
children:
|
|
33203
|
+
variant: rI(e.state),
|
|
33204
|
+
children: UF[e.state]
|
|
33190
33205
|
}),
|
|
33191
|
-
e.stage !== null && !
|
|
33206
|
+
e.stage !== null && !GF(e.state) && /* @__PURE__ */ H(hl, {
|
|
33192
33207
|
variant: "info",
|
|
33193
33208
|
children: e.stage
|
|
33194
33209
|
}),
|
|
@@ -33213,10 +33228,10 @@ function uI({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
33213
33228
|
/* @__PURE__ */ H("ol", {
|
|
33214
33229
|
className: "flex flex-wrap gap-1",
|
|
33215
33230
|
"aria-label": "Job progress",
|
|
33216
|
-
children:
|
|
33217
|
-
className: `rounded-full px-2 py-0.5 text-xs ${
|
|
33231
|
+
children: JF(e).map((t) => /* @__PURE__ */ H("li", {
|
|
33232
|
+
className: `rounded-full px-2 py-0.5 text-xs ${fI[t.status]}`,
|
|
33218
33233
|
"aria-current": t.status === "current" ? "step" : void 0,
|
|
33219
|
-
children: t.status === "failed" ? `${t.label} — ${
|
|
33234
|
+
children: t.status === "failed" ? `${t.label} — ${UF[e.state]}` : t.label
|
|
33220
33235
|
}, t.state))
|
|
33221
33236
|
}),
|
|
33222
33237
|
e.failure !== null && /* @__PURE__ */ U("p", {
|
|
@@ -33248,17 +33263,17 @@ function uI({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
33248
33263
|
o,
|
|
33249
33264
|
" / ",
|
|
33250
33265
|
s,
|
|
33251
|
-
c !== null && !
|
|
33266
|
+
c !== null && !GF(e.state) ? ` · about ${XF(c)} left` : ""
|
|
33252
33267
|
]
|
|
33253
33268
|
})]
|
|
33254
33269
|
}),
|
|
33255
|
-
/* @__PURE__ */ H(
|
|
33270
|
+
/* @__PURE__ */ H(dI, { series: l }),
|
|
33256
33271
|
/* @__PURE__ */ U("p", {
|
|
33257
33272
|
className: "text-xs text-foreground-muted",
|
|
33258
33273
|
children: [
|
|
33259
|
-
a !== null && `Ran ${
|
|
33274
|
+
a !== null && `Ran ${XF(a)} · `,
|
|
33260
33275
|
"Cost ",
|
|
33261
|
-
|
|
33276
|
+
YF(e.provider.costUsd, e.provider.costIsEstimate),
|
|
33262
33277
|
" of $",
|
|
33263
33278
|
e.maxCostUsd.toFixed(2),
|
|
33264
33279
|
" cap",
|
|
@@ -33266,8 +33281,8 @@ function uI({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
33266
33281
|
e.artifacts !== null && ` · result kept on the hub until ${new Date(e.artifacts.expiresAt).toLocaleDateString()}`
|
|
33267
33282
|
]
|
|
33268
33283
|
}),
|
|
33269
|
-
/* @__PURE__ */ H(
|
|
33270
|
-
u && /* @__PURE__ */ H(
|
|
33284
|
+
/* @__PURE__ */ H(pI, { lines: e.logTail }),
|
|
33285
|
+
u && /* @__PURE__ */ H(lI, {
|
|
33271
33286
|
job: e,
|
|
33272
33287
|
trpc: t,
|
|
33273
33288
|
onChanged: n,
|
|
@@ -33279,18 +33294,18 @@ function uI({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
33279
33294
|
//#endregion
|
|
33280
33295
|
//#region src/page/JobsTable.tsx
|
|
33281
33296
|
i();
|
|
33282
|
-
var
|
|
33297
|
+
var hI = {
|
|
33283
33298
|
searchText: (e) => [
|
|
33284
33299
|
e.name,
|
|
33285
33300
|
e.id,
|
|
33286
33301
|
e.request.baseModelId,
|
|
33287
33302
|
e.request.gpuType,
|
|
33288
|
-
|
|
33303
|
+
UF[e.state],
|
|
33289
33304
|
e.stage ?? ""
|
|
33290
33305
|
],
|
|
33291
33306
|
facetValue: (e) => e.state
|
|
33292
33307
|
};
|
|
33293
|
-
function
|
|
33308
|
+
function gI({ job: e }) {
|
|
33294
33309
|
let { epoch: t, epochs: n } = e.progress;
|
|
33295
33310
|
return t === null || n === null ? /* @__PURE__ */ H("span", {
|
|
33296
33311
|
className: "text-foreground-subtle",
|
|
@@ -33304,9 +33319,9 @@ function fI({ job: e }) {
|
|
|
33304
33319
|
]
|
|
33305
33320
|
});
|
|
33306
33321
|
}
|
|
33307
|
-
function
|
|
33322
|
+
function _I({ job: e, trpc: t, onChanged: n }) {
|
|
33308
33323
|
let r = Xl(), [i, o] = a(null);
|
|
33309
|
-
if (
|
|
33324
|
+
if (GF(e.state) || e.state === "cancelling") return null;
|
|
33310
33325
|
let s = async () => {
|
|
33311
33326
|
if (await r({
|
|
33312
33327
|
title: "Cancel this job?",
|
|
@@ -33316,7 +33331,7 @@ function pI({ job: e, trpc: t, onChanged: n }) {
|
|
|
33316
33331
|
})) try {
|
|
33317
33332
|
await t.training.cancelJob.mutate({ id: e.id }), n();
|
|
33318
33333
|
} catch (e) {
|
|
33319
|
-
o(
|
|
33334
|
+
o(sI(e));
|
|
33320
33335
|
}
|
|
33321
33336
|
};
|
|
33322
33337
|
return /* @__PURE__ */ U("div", {
|
|
@@ -33332,8 +33347,8 @@ function pI({ job: e, trpc: t, onChanged: n }) {
|
|
|
33332
33347
|
})]
|
|
33333
33348
|
});
|
|
33334
33349
|
}
|
|
33335
|
-
function
|
|
33336
|
-
let o = y_(e,
|
|
33350
|
+
function vI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
|
|
33351
|
+
let o = y_(e, hI), [s, c] = a(null);
|
|
33337
33352
|
y(() => {
|
|
33338
33353
|
if (o.rows.length === 0) {
|
|
33339
33354
|
c(null);
|
|
@@ -33370,9 +33385,9 @@ function mI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
33370
33385
|
render: (e) => /* @__PURE__ */ U("span", {
|
|
33371
33386
|
className: "inline-flex flex-wrap items-center gap-1",
|
|
33372
33387
|
children: [/* @__PURE__ */ H(hl, {
|
|
33373
|
-
variant:
|
|
33374
|
-
children:
|
|
33375
|
-
}), e.stage !== null && !
|
|
33388
|
+
variant: rI(e.state),
|
|
33389
|
+
children: UF[e.state]
|
|
33390
|
+
}), e.stage !== null && !GF(e.state) && /* @__PURE__ */ H(hl, {
|
|
33376
33391
|
variant: "info",
|
|
33377
33392
|
children: e.stage
|
|
33378
33393
|
})]
|
|
@@ -33396,7 +33411,7 @@ function mI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
33396
33411
|
key: "progress",
|
|
33397
33412
|
header: "Progress",
|
|
33398
33413
|
sortValue: (e) => e.progress.epoch ?? -1,
|
|
33399
|
-
render: (e) => /* @__PURE__ */ H(
|
|
33414
|
+
render: (e) => /* @__PURE__ */ H(gI, { job: e })
|
|
33400
33415
|
},
|
|
33401
33416
|
{
|
|
33402
33417
|
key: "cost",
|
|
@@ -33406,7 +33421,7 @@ function mI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
33406
33421
|
render: (e) => /* @__PURE__ */ U("span", {
|
|
33407
33422
|
className: "font-mono text-[11px] tabular-nums",
|
|
33408
33423
|
children: [
|
|
33409
|
-
|
|
33424
|
+
YF(e.provider.costUsd, e.provider.costIsEstimate),
|
|
33410
33425
|
" / $",
|
|
33411
33426
|
e.maxCostUsd.toFixed(2)
|
|
33412
33427
|
]
|
|
@@ -33424,7 +33439,7 @@ function mI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
33424
33439
|
{
|
|
33425
33440
|
key: "actions",
|
|
33426
33441
|
align: "right",
|
|
33427
|
-
render: (e) => /* @__PURE__ */ H(
|
|
33442
|
+
render: (e) => /* @__PURE__ */ H(_I, {
|
|
33428
33443
|
job: e,
|
|
33429
33444
|
trpc: t,
|
|
33430
33445
|
onChanged: n
|
|
@@ -33441,7 +33456,7 @@ function mI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
33441
33456
|
/* @__PURE__ */ H(v_, {
|
|
33442
33457
|
state: o.state,
|
|
33443
33458
|
facets: o.facets,
|
|
33444
|
-
facetLabel: (e) =>
|
|
33459
|
+
facetLabel: (e) => UF[e] ?? e,
|
|
33445
33460
|
labels: {
|
|
33446
33461
|
searchPlaceholder: "Search jobs…",
|
|
33447
33462
|
searchLabel: "Search jobs",
|
|
@@ -33467,7 +33482,7 @@ function mI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
33467
33482
|
onRowClick: (e) => c(e.id),
|
|
33468
33483
|
rowClassName: (e) => e.id === s ? "bg-primary/[0.04]" : void 0
|
|
33469
33484
|
}),
|
|
33470
|
-
l !== null && /* @__PURE__ */ H(
|
|
33485
|
+
l !== null && /* @__PURE__ */ H(mI, {
|
|
33471
33486
|
job: l,
|
|
33472
33487
|
trpc: t,
|
|
33473
33488
|
onChanged: n,
|
|
@@ -33479,7 +33494,7 @@ function mI({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
33479
33494
|
}
|
|
33480
33495
|
//#endregion
|
|
33481
33496
|
//#region src/page/cluster-root-model-rows.ts
|
|
33482
|
-
function
|
|
33497
|
+
function yI(e) {
|
|
33483
33498
|
for (let t of e.slots) for (let e of t.addons) if (e.id === "object-detection") return typeof e.defaultModelId != "string" || e.defaultModelId.length === 0 ? null : {
|
|
33484
33499
|
defaultModelId: e.defaultModelId,
|
|
33485
33500
|
...e.defaultModelIdByFormat === void 0 ? {} : { defaultModelIdByFormat: e.defaultModelIdByFormat },
|
|
@@ -33492,10 +33507,10 @@ function hI(e) {
|
|
|
33492
33507
|
};
|
|
33493
33508
|
return null;
|
|
33494
33509
|
}
|
|
33495
|
-
function
|
|
33510
|
+
function bI(e) {
|
|
33496
33511
|
let t = [];
|
|
33497
33512
|
for (let n of e) {
|
|
33498
|
-
let e =
|
|
33513
|
+
let e = yI(n.schema);
|
|
33499
33514
|
e !== null && t.push({
|
|
33500
33515
|
nodeId: n.nodeId,
|
|
33501
33516
|
devices: n.devices,
|
|
@@ -33504,8 +33519,8 @@ function gI(e) {
|
|
|
33504
33519
|
}
|
|
33505
33520
|
return t;
|
|
33506
33521
|
}
|
|
33507
|
-
function
|
|
33508
|
-
let n = Qg(
|
|
33522
|
+
function xI(e, t) {
|
|
33523
|
+
let n = Qg(bI(t)), r = $g(n);
|
|
33509
33524
|
return {
|
|
33510
33525
|
models: e.map((e) => ({
|
|
33511
33526
|
modelId: e.modelId,
|
|
@@ -33518,7 +33533,7 @@ function _I(e, t) {
|
|
|
33518
33533
|
}
|
|
33519
33534
|
//#endregion
|
|
33520
33535
|
//#region src/page/PlanSummary.tsx
|
|
33521
|
-
function
|
|
33536
|
+
function SI({ plan: e, cameraName: t }) {
|
|
33522
33537
|
let { split: n, estimate: r } = e;
|
|
33523
33538
|
return /* @__PURE__ */ U("div", {
|
|
33524
33539
|
className: "space-y-2 text-sm",
|
|
@@ -33564,14 +33579,14 @@ function vI({ plan: e, cameraName: t }) {
|
|
|
33564
33579
|
] }),
|
|
33565
33580
|
/* @__PURE__ */ U("span", { children: [
|
|
33566
33581
|
"GPU time: ",
|
|
33567
|
-
|
|
33582
|
+
XF(r.gpuSecondsLow),
|
|
33568
33583
|
" –",
|
|
33569
33584
|
" ",
|
|
33570
|
-
|
|
33585
|
+
XF(r.gpuSecondsHigh)
|
|
33571
33586
|
] }),
|
|
33572
33587
|
/* @__PURE__ */ U("span", { children: [
|
|
33573
33588
|
"Upload: about ",
|
|
33574
|
-
|
|
33589
|
+
ZF(r.datasetBytes),
|
|
33575
33590
|
", ",
|
|
33576
33591
|
r.uploadMinutesAt20Mbps,
|
|
33577
33592
|
" min at 20 Mbit/s"
|
|
@@ -33591,16 +33606,16 @@ function vI({ plan: e, cameraName: t }) {
|
|
|
33591
33606
|
}
|
|
33592
33607
|
//#endregion
|
|
33593
33608
|
//#region src/page/plan-form.ts
|
|
33594
|
-
var
|
|
33609
|
+
var CI = {
|
|
33595
33610
|
quick: "Quick — 15 epochs",
|
|
33596
33611
|
standard: "Standard — 40 epochs",
|
|
33597
33612
|
thorough: "Thorough — 80 epochs, nothing frozen"
|
|
33598
|
-
},
|
|
33613
|
+
}, wI = {
|
|
33599
33614
|
complete: "Complete frames only",
|
|
33600
33615
|
annotated_or_complete: "Annotated or complete",
|
|
33601
33616
|
any_annotated: "Any annotated (incl. hard negatives)"
|
|
33602
33617
|
};
|
|
33603
|
-
function
|
|
33618
|
+
function TI(e) {
|
|
33604
33619
|
let t = e.baseModelIds[0];
|
|
33605
33620
|
if (e.collectionIds.length === 0 || e.entryId === "" || e.gpuType === "" || t === void 0) return null;
|
|
33606
33621
|
let n = e.freeze.trim() === "" ? null : Number(e.freeze);
|
|
@@ -33618,7 +33633,7 @@ function xI(e) {
|
|
|
33618
33633
|
holdoutCameras: e.holdoutCameras.length > 0 ? [...e.holdoutCameras] : null
|
|
33619
33634
|
};
|
|
33620
33635
|
}
|
|
33621
|
-
function
|
|
33636
|
+
function EI(e, t) {
|
|
33622
33637
|
return {
|
|
33623
33638
|
...e,
|
|
33624
33639
|
entryId: t.entryId,
|
|
@@ -33626,7 +33641,7 @@ function SI(e, t) {
|
|
|
33626
33641
|
region: t.defaults.region
|
|
33627
33642
|
};
|
|
33628
33643
|
}
|
|
33629
|
-
var
|
|
33644
|
+
var DI = {
|
|
33630
33645
|
collectionIds: [],
|
|
33631
33646
|
workState: "complete",
|
|
33632
33647
|
entryId: "",
|
|
@@ -33640,24 +33655,24 @@ var CI = {
|
|
|
33640
33655
|
//#endregion
|
|
33641
33656
|
//#region src/page/NewJobSection.tsx
|
|
33642
33657
|
i();
|
|
33643
|
-
function
|
|
33658
|
+
function OI(e) {
|
|
33644
33659
|
if (typeof e != "object" || !e) return !1;
|
|
33645
33660
|
let t = Reflect.get(e, "slots");
|
|
33646
33661
|
return Array.isArray(t);
|
|
33647
33662
|
}
|
|
33648
|
-
function
|
|
33663
|
+
function kI(e) {
|
|
33649
33664
|
if (typeof e != "object" || !e) return [];
|
|
33650
33665
|
let t = Reflect.get(e, "devices");
|
|
33651
33666
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
33652
|
-
let t =
|
|
33667
|
+
let t = AI(e);
|
|
33653
33668
|
return t === null ? [] : [t];
|
|
33654
33669
|
}) : [];
|
|
33655
33670
|
}
|
|
33656
|
-
function
|
|
33671
|
+
function AI(e) {
|
|
33657
33672
|
if (typeof e != "object" || !e) return null;
|
|
33658
33673
|
let t = Reflect.get(e, "key"), n = Reflect.get(e, "backend"), r = Reflect.get(e, "device"), i = Reflect.get(e, "enabled"), a = Reflect.get(e, "format");
|
|
33659
33674
|
if (typeof t != "string" || typeof n != "string" || typeof r != "string" || typeof i != "boolean" || typeof a != "string") return null;
|
|
33660
|
-
let o = Reflect.get(e, "defaultModelId"), s =
|
|
33675
|
+
let o = Reflect.get(e, "defaultModelId"), s = jI(Reflect.get(e, "steps"));
|
|
33661
33676
|
return {
|
|
33662
33677
|
key: t,
|
|
33663
33678
|
backend: n,
|
|
@@ -33668,7 +33683,7 @@ function EI(e) {
|
|
|
33668
33683
|
...s === void 0 ? {} : { steps: s }
|
|
33669
33684
|
};
|
|
33670
33685
|
}
|
|
33671
|
-
function
|
|
33686
|
+
function jI(e) {
|
|
33672
33687
|
if (typeof e != "object" || !e) return;
|
|
33673
33688
|
let t = {};
|
|
33674
33689
|
for (let [n, r] of Object.entries(e)) {
|
|
@@ -33678,8 +33693,8 @@ function DI(e) {
|
|
|
33678
33693
|
}
|
|
33679
33694
|
return t;
|
|
33680
33695
|
}
|
|
33681
|
-
function
|
|
33682
|
-
let c = Xl(), { nodes: l } = Ia(), u = m(() => l.filter((e) => e.isOnline).map((e) => e.id), [l]), d = u.join("\0"), [f, p] = a(
|
|
33696
|
+
function MI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName: i, onStarted: o, onClose: s }) {
|
|
33697
|
+
let c = Xl(), { nodes: l } = Ia(), u = m(() => l.filter((e) => e.isOnline).map((e) => e.id), [l]), d = u.join("\0"), [f, p] = a(DI), [h, g] = a(""), [_, v] = a(""), [b, x] = a(""), [S, C] = a(null), [w, T] = a(!1), [E, D] = a(!1), [O, k] = a(!1), A = cI(async () => {
|
|
33683
33698
|
if (n.length === 0) return {
|
|
33684
33699
|
models: [],
|
|
33685
33700
|
clusterRootModelIds: []
|
|
@@ -33688,14 +33703,14 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33688
33703
|
return await Promise.all(u.map(async (n) => {
|
|
33689
33704
|
try {
|
|
33690
33705
|
let [r, i] = await Promise.all([e.pipelineOrchestrator.getNodeInferenceDevices.query({ nodeId: n }), e.pipelineExecutor.getSchema.query({ nodeId: n })]);
|
|
33691
|
-
if (!
|
|
33706
|
+
if (!OI(i)) return;
|
|
33692
33707
|
t.push({
|
|
33693
33708
|
nodeId: n,
|
|
33694
|
-
devices:
|
|
33709
|
+
devices: kI(r),
|
|
33695
33710
|
schema: i
|
|
33696
33711
|
});
|
|
33697
33712
|
} catch {}
|
|
33698
|
-
})),
|
|
33713
|
+
})), xI(n, t);
|
|
33699
33714
|
}, [d, n.map((e) => e.modelId).join("\0")]), j = A.state.status === "ok" ? A.state.data.models : n.map((e) => ({
|
|
33700
33715
|
modelId: e.modelId,
|
|
33701
33716
|
label: e.label,
|
|
@@ -33708,7 +33723,7 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33708
33723
|
...e,
|
|
33709
33724
|
holdoutCameras: []
|
|
33710
33725
|
}, r = t.find((e) => e.configured) ?? t[0];
|
|
33711
|
-
return n.entryId === "" && r !== void 0 && (n =
|
|
33726
|
+
return n.entryId === "" && r !== void 0 && (n = EI(n, r)), n;
|
|
33712
33727
|
});
|
|
33713
33728
|
}, [t]), y(() => {
|
|
33714
33729
|
if (E || A.state.status !== "ok") return;
|
|
@@ -33735,7 +33750,7 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33735
33750
|
E,
|
|
33736
33751
|
O
|
|
33737
33752
|
]);
|
|
33738
|
-
let N =
|
|
33753
|
+
let N = TI(f), P = cI(async () => N === null ? null : e.training.planJob.query(N), [JSON.stringify(N)]), F = P.state.status === "ok" ? P.state.data : null;
|
|
33739
33754
|
y(() => {
|
|
33740
33755
|
F?.defaults != null && (v(F.defaults.maxCostUsd.toFixed(2)), x((F.defaults.maxRuntimeSec / 3600).toFixed(1)));
|
|
33741
33756
|
}, [F?.defaults?.maxCostUsd, F?.defaults?.maxRuntimeSec]);
|
|
@@ -33780,7 +33795,7 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33780
33795
|
t.kind === "refused" ? C(`Refused (${t.reason}): ${t.detail}`) : (o(), s?.());
|
|
33781
33796
|
}
|
|
33782
33797
|
} catch (e) {
|
|
33783
|
-
C(
|
|
33798
|
+
C(sI(e));
|
|
33784
33799
|
} finally {
|
|
33785
33800
|
T(!1);
|
|
33786
33801
|
}
|
|
@@ -33807,7 +33822,7 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33807
33822
|
value: f.entryId,
|
|
33808
33823
|
onChange: (e) => {
|
|
33809
33824
|
let n = t.find((t) => t.entryId === e.target.value);
|
|
33810
|
-
n !== void 0 && p((e) =>
|
|
33825
|
+
n !== void 0 && p((e) => EI(e, n));
|
|
33811
33826
|
},
|
|
33812
33827
|
options: t.map((e) => ({
|
|
33813
33828
|
value: e.entryId,
|
|
@@ -33851,9 +33866,9 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33851
33866
|
let t = e.target.value;
|
|
33852
33867
|
(t === "complete" || t === "annotated_or_complete" || t === "any_annotated") && L({ workState: t });
|
|
33853
33868
|
},
|
|
33854
|
-
options: Object.keys(
|
|
33869
|
+
options: Object.keys(wI).map((e) => ({
|
|
33855
33870
|
value: e,
|
|
33856
|
-
label:
|
|
33871
|
+
label: wI[e]
|
|
33857
33872
|
}))
|
|
33858
33873
|
})]
|
|
33859
33874
|
}),
|
|
@@ -33894,7 +33909,7 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33894
33909
|
children: [/* @__PURE__ */ H("span", { children: "Preset" }), /* @__PURE__ */ H(Rs, {
|
|
33895
33910
|
value: f.preset,
|
|
33896
33911
|
onChange: (e) => L({ preset: e.target.value === "quick" ? "quick" : e.target.value === "thorough" ? "thorough" : "standard" }),
|
|
33897
|
-
options: Object.entries(
|
|
33912
|
+
options: Object.entries(CI).map(([e, t]) => ({
|
|
33898
33913
|
value: e,
|
|
33899
33914
|
label: t
|
|
33900
33915
|
}))
|
|
@@ -33945,7 +33960,7 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33945
33960
|
className: "text-sm text-danger",
|
|
33946
33961
|
children: ["Could not plan: ", P.state.error]
|
|
33947
33962
|
}),
|
|
33948
|
-
F !== null && /* @__PURE__ */ H(
|
|
33963
|
+
F !== null && /* @__PURE__ */ H(SI, {
|
|
33949
33964
|
plan: F,
|
|
33950
33965
|
cameraName: i
|
|
33951
33966
|
}),
|
|
@@ -33996,7 +34011,7 @@ function OI({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33996
34011
|
}
|
|
33997
34012
|
//#endregion
|
|
33998
34013
|
//#region src/page/SectionState.tsx
|
|
33999
|
-
function
|
|
34014
|
+
function NI({ state: e, empty: t, emptyAction: n, children: r }) {
|
|
34000
34015
|
return e.status === "pending" ? /* @__PURE__ */ H(cd, { className: "h-16 w-full" }) : e.status === "error" ? /* @__PURE__ */ U("p", {
|
|
34001
34016
|
className: "text-sm text-danger",
|
|
34002
34017
|
children: ["Could not load: ", e.error]
|
|
@@ -34012,12 +34027,12 @@ function kI({ state: e, empty: t, emptyAction: n, children: r }) {
|
|
|
34012
34027
|
//#endregion
|
|
34013
34028
|
//#region src/page/JobsSection.tsx
|
|
34014
34029
|
i();
|
|
34015
|
-
function
|
|
34030
|
+
function PI(e) {
|
|
34016
34031
|
let t = new Map((e ?? []).map((e) => [e.id, e.name]));
|
|
34017
34032
|
return (e) => t.get(e) ?? e;
|
|
34018
34033
|
}
|
|
34019
|
-
function
|
|
34020
|
-
let f = m(() =>
|
|
34034
|
+
function FI({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJobsReload: o, cameraName: s, depsPending: c, depsError: l, createRequested: u = !1, onCreateConsumed: d }) {
|
|
34035
|
+
let f = m(() => PI(r), [r]), [p, h] = a(!1), [g, _] = a(0), v = !c && l === null && t !== null && n !== null && r !== null;
|
|
34021
34036
|
y(() => {
|
|
34022
34037
|
u && v && (_((e) => e + 1), h(!0), d?.());
|
|
34023
34038
|
}, [
|
|
@@ -34043,10 +34058,10 @@ function jI({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
|
|
|
34043
34058
|
title: "Jobs",
|
|
34044
34059
|
children: /* @__PURE__ */ H("div", {
|
|
34045
34060
|
className: `${w} space-y-3`,
|
|
34046
|
-
children: /* @__PURE__ */ H(
|
|
34061
|
+
children: /* @__PURE__ */ H(NI, {
|
|
34047
34062
|
state: i,
|
|
34048
34063
|
empty: "No training job yet.",
|
|
34049
|
-
children: (t) => /* @__PURE__ */ H(
|
|
34064
|
+
children: (t) => /* @__PURE__ */ H(vI, {
|
|
34050
34065
|
jobs: t,
|
|
34051
34066
|
trpc: e,
|
|
34052
34067
|
onChanged: o,
|
|
@@ -34063,7 +34078,7 @@ function jI({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
|
|
|
34063
34078
|
icon: vn,
|
|
34064
34079
|
width: "xl",
|
|
34065
34080
|
testId: "job-create-dialog",
|
|
34066
|
-
children: /* @__PURE__ */ H(
|
|
34081
|
+
children: /* @__PURE__ */ H(MI, {
|
|
34067
34082
|
trpc: e,
|
|
34068
34083
|
providers: t,
|
|
34069
34084
|
baseModels: n,
|
|
@@ -34147,7 +34162,7 @@ function jI({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
|
|
|
34147
34162
|
value: e.id,
|
|
34148
34163
|
label: e.label
|
|
34149
34164
|
}));
|
|
34150
|
-
var
|
|
34165
|
+
var II = {
|
|
34151
34166
|
tokenId: "",
|
|
34152
34167
|
tokenSecret: "",
|
|
34153
34168
|
environment: "",
|
|
@@ -34159,17 +34174,17 @@ var MI = {
|
|
|
34159
34174
|
};
|
|
34160
34175
|
//#endregion
|
|
34161
34176
|
//#region src/page/provider-icon-url.ts
|
|
34162
|
-
function
|
|
34177
|
+
function LI(e, t) {
|
|
34163
34178
|
let n = t.trim();
|
|
34164
34179
|
return n.length === 0 || n.includes("..") ? null : ie(`/api/addon-assets/${encodeURIComponent(e)}/${n}`);
|
|
34165
34180
|
}
|
|
34166
34181
|
//#endregion
|
|
34167
34182
|
//#region src/page/ProviderSection.tsx
|
|
34168
34183
|
i();
|
|
34169
|
-
function
|
|
34184
|
+
function RI(e) {
|
|
34170
34185
|
return e.map((e) => `${e.typeId}\0${e.label}\0${e.addonId}\0${e.iconAsset}`).join("\n");
|
|
34171
34186
|
}
|
|
34172
|
-
function
|
|
34187
|
+
function zI(e) {
|
|
34173
34188
|
let t = e.configSchema;
|
|
34174
34189
|
return typeof t != "object" || !t ? {
|
|
34175
34190
|
typeId: e.typeId,
|
|
@@ -34184,7 +34199,7 @@ function FI(e) {
|
|
|
34184
34199
|
configSchema: t
|
|
34185
34200
|
};
|
|
34186
34201
|
}
|
|
34187
|
-
function
|
|
34202
|
+
function BI({ state: e }) {
|
|
34188
34203
|
if (e.kind === "idle") return null;
|
|
34189
34204
|
if (e.kind === "running") return /* @__PURE__ */ H("span", {
|
|
34190
34205
|
className: "text-xs text-foreground-subtle",
|
|
@@ -34203,32 +34218,32 @@ function II({ state: e }) {
|
|
|
34203
34218
|
children: [t.reason ?? "refused", t.detail === void 0 ? "" : `: ${t.detail}`]
|
|
34204
34219
|
});
|
|
34205
34220
|
}
|
|
34206
|
-
function
|
|
34207
|
-
return e === "modal" ? { ...
|
|
34221
|
+
function VI(e) {
|
|
34222
|
+
return e === "modal" ? { ...II } : {};
|
|
34208
34223
|
}
|
|
34209
|
-
function
|
|
34224
|
+
function HI(e, t) {
|
|
34210
34225
|
if (t) return typeof e == "string" && e.length > 0 ? e : void 0;
|
|
34211
34226
|
if (it(e)) return Re;
|
|
34212
34227
|
if (typeof e == "string" && e.length > 0) return e;
|
|
34213
34228
|
Me(e);
|
|
34214
34229
|
}
|
|
34215
|
-
function
|
|
34230
|
+
function UI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r }) {
|
|
34216
34231
|
let i = od("training-provider"), o = Xl(), c = HA({
|
|
34217
34232
|
editKey: "edit",
|
|
34218
34233
|
newKey: "new"
|
|
34219
|
-
}), [l, d] = a(!1), [f, p] = a(null), [h, g] = a(""), [_, v] = a(""), [b, x] = a({}), [S, C] = a({ kind: "idle" }), w = u(null), T =
|
|
34234
|
+
}), [l, d] = a(!1), [f, p] = a(null), [h, g] = a(""), [_, v] = a(""), [b, x] = a({}), [S, C] = a({ kind: "idle" }), w = u(null), T = cI(() => e.trainingProvider.describe.query({}), []), E = cI(() => e.trainingProvider.describeTypes.query({}), []), D = E.state.status === "ok" ? E.state.data : null, O = D === null ? "" : RI(D), k = u(D);
|
|
34220
34235
|
k.current = D;
|
|
34221
34236
|
let A = m(() => {
|
|
34222
34237
|
let e = /* @__PURE__ */ new Map(), t = k.current;
|
|
34223
34238
|
if (t !== null) for (let n of t) {
|
|
34224
|
-
let t =
|
|
34239
|
+
let t = zI(n);
|
|
34225
34240
|
e.set(t.typeId, t);
|
|
34226
34241
|
}
|
|
34227
34242
|
return e;
|
|
34228
34243
|
}, [O]), j = m(() => {
|
|
34229
34244
|
let e = k.current;
|
|
34230
34245
|
return e === null ? [] : e.map((e) => {
|
|
34231
|
-
let t =
|
|
34246
|
+
let t = zI(e);
|
|
34232
34247
|
return {
|
|
34233
34248
|
value: t.typeId,
|
|
34234
34249
|
label: t.label
|
|
@@ -34238,7 +34253,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34238
34253
|
y(() => {
|
|
34239
34254
|
if (!n || E.state.status !== "ok") return;
|
|
34240
34255
|
let e = j[0]?.value ?? "";
|
|
34241
|
-
p(null), C({ kind: "idle" }), g(e), v(""), x(
|
|
34256
|
+
p(null), C({ kind: "idle" }), g(e), v(""), x(VI(e)), w.current = "new", c.openNew(), r?.();
|
|
34242
34257
|
}, [n, E.state.status]);
|
|
34243
34258
|
let N = c.state, P = N.mode === "edit" ? M.find((e) => e.entryId === N.id) ?? null : null;
|
|
34244
34259
|
y(() => {
|
|
@@ -34252,7 +34267,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34252
34267
|
if (w.current === "new") return;
|
|
34253
34268
|
w.current = "new";
|
|
34254
34269
|
let e = j[0]?.value ?? "";
|
|
34255
|
-
p(null), C({ kind: "idle" }), g(e), v(""), x(
|
|
34270
|
+
p(null), C({ kind: "idle" }), g(e), v(""), x(VI(e));
|
|
34256
34271
|
return;
|
|
34257
34272
|
}
|
|
34258
34273
|
w.current = null;
|
|
@@ -34262,7 +34277,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34262
34277
|
j
|
|
34263
34278
|
]);
|
|
34264
34279
|
let F = (A.get(h) ?? (P === null ? void 0 : A.get(P.typeId)))?.configSchema, I = c.state.mode === "edit" && P !== null && w.current !== `edit:${P.entryId}` ? P.formValues === void 0 ? {} : { ...P.formValues } : b, ee = c.state.mode === "edit" && P !== null ? `edit:${P.entryId}` : `new:${h}`, te = s((e) => {
|
|
34265
|
-
g(e), x(
|
|
34280
|
+
g(e), x(VI(e));
|
|
34266
34281
|
}, []), ne = s(async () => {
|
|
34267
34282
|
if (P !== null) {
|
|
34268
34283
|
C({ kind: "running" });
|
|
@@ -34277,7 +34292,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34277
34292
|
} catch (e) {
|
|
34278
34293
|
C({
|
|
34279
34294
|
kind: "error",
|
|
34280
|
-
message:
|
|
34295
|
+
message: sI(e)
|
|
34281
34296
|
});
|
|
34282
34297
|
}
|
|
34283
34298
|
}
|
|
@@ -34301,7 +34316,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34301
34316
|
ok: !1,
|
|
34302
34317
|
message: "Grace hours must be a non-negative number."
|
|
34303
34318
|
};
|
|
34304
|
-
let i = c.state.mode === "new", a =
|
|
34319
|
+
let i = c.state.mode === "new", a = HI(b.tokenSecret, i), o = b.tokenId, s = b.environment, l = b.gpuType, u = b.region;
|
|
34305
34320
|
return {
|
|
34306
34321
|
ok: !0,
|
|
34307
34322
|
fields: {
|
|
@@ -34362,7 +34377,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34362
34377
|
}
|
|
34363
34378
|
T.reload(), E.reload(), c.close(), w.current = null;
|
|
34364
34379
|
} catch (e) {
|
|
34365
|
-
p(
|
|
34380
|
+
p(sI(e));
|
|
34366
34381
|
} finally {
|
|
34367
34382
|
d(!1);
|
|
34368
34383
|
}
|
|
@@ -34399,7 +34414,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34399
34414
|
render: (e) => /* @__PURE__ */ U("div", {
|
|
34400
34415
|
className: "flex min-w-0 items-center gap-2",
|
|
34401
34416
|
children: [/* @__PURE__ */ H("img", {
|
|
34402
|
-
src:
|
|
34417
|
+
src: LI(e.addonId, e.iconAsset) ?? void 0,
|
|
34403
34418
|
alt: "",
|
|
34404
34419
|
className: "h-4 w-4 shrink-0"
|
|
34405
34420
|
}), /* @__PURE__ */ H("span", {
|
|
@@ -34564,7 +34579,7 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34564
34579
|
disabled: !P.configured || S.kind === "running",
|
|
34565
34580
|
onClick: () => void ne(),
|
|
34566
34581
|
children: "Test credentials"
|
|
34567
|
-
}), /* @__PURE__ */ H(
|
|
34582
|
+
}), /* @__PURE__ */ H(BI, { state: S })]
|
|
34568
34583
|
}),
|
|
34569
34584
|
P === null ? null : /* @__PURE__ */ H("p", {
|
|
34570
34585
|
className: "text-xs text-foreground-muted",
|
|
@@ -34578,24 +34593,24 @@ function zI({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
|
|
|
34578
34593
|
}
|
|
34579
34594
|
//#endregion
|
|
34580
34595
|
//#region src/page/training-tab.ts
|
|
34581
|
-
function
|
|
34596
|
+
function WI(e) {
|
|
34582
34597
|
let t = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get("tab");
|
|
34583
34598
|
return t === "jobs" || t === "providers" || t === "frames" ? t : "frames";
|
|
34584
34599
|
}
|
|
34585
34600
|
//#endregion
|
|
34586
34601
|
//#region src/page.tsx
|
|
34587
34602
|
i();
|
|
34588
|
-
var
|
|
34589
|
-
function
|
|
34603
|
+
var GI = 5e3;
|
|
34604
|
+
function KI(e) {
|
|
34590
34605
|
let t = new URL(window.location.href);
|
|
34591
34606
|
t.searchParams.set("tab", e), window.history.replaceState({}, "", t.toString());
|
|
34592
34607
|
}
|
|
34593
|
-
function
|
|
34594
|
-
let [n, r] = a(() => typeof window > "u" ? "frames" :
|
|
34595
|
-
r(e), o(!1),
|
|
34596
|
-
}, []), l =
|
|
34597
|
-
pollMs:
|
|
34598
|
-
poll:
|
|
34608
|
+
function qI({ trpc: e, navigate: t }) {
|
|
34609
|
+
let [n, r] = a(() => typeof window > "u" ? "frames" : WI(window.location.search)), [i, o] = a(!1), c = s((e) => {
|
|
34610
|
+
r(e), o(!1), KI(e);
|
|
34611
|
+
}, []), l = cI(() => e.trainingProvider.describe.query({}), []), u = cI(() => e.training.listBaseModels.query({}), []), d = cI(() => e.pipelineAnalytics.listRetrainCollections.query({}), []), f = cI(() => e.deviceManager.listAll.query({ projection: "slim" }), []), p = cI(() => e.training.listJobs.query({}), [], {
|
|
34612
|
+
pollMs: GI,
|
|
34613
|
+
poll: KF
|
|
34599
34614
|
}), h = m(() => new Map(f.state.status === "ok" ? f.state.data.map((e) => [e.id, e.name]) : []), [f.state]), g = s((e) => h.get(e) ?? `#${String(e)}`, [h]), _ = l.state.status === "pending" || u.state.status === "pending" || d.state.status === "pending", v = (() => {
|
|
34600
34615
|
let e = [];
|
|
34601
34616
|
return l.state.status === "error" && e.push(`providers: ${l.state.error}`), u.state.status === "error" && e.push(`base models: ${u.state.error}`), d.state.status === "error" && e.push(`collections: ${d.state.error}`), e.length > 0 ? e.join("; ") : null;
|
|
@@ -34637,14 +34652,14 @@ function UI({ trpc: e, navigate: t }) {
|
|
|
34637
34652
|
})
|
|
34638
34653
|
] })
|
|
34639
34654
|
}),
|
|
34640
|
-
n === "frames" ? /* @__PURE__ */ H(
|
|
34641
|
-
n === "providers" ? /* @__PURE__ */ H(
|
|
34655
|
+
n === "frames" ? /* @__PURE__ */ H(VF, {}) : null,
|
|
34656
|
+
n === "providers" ? /* @__PURE__ */ H(UI, {
|
|
34642
34657
|
trpc: e,
|
|
34643
34658
|
navigate: t,
|
|
34644
34659
|
createRequested: i,
|
|
34645
34660
|
onCreateConsumed: () => o(!1)
|
|
34646
34661
|
}) : null,
|
|
34647
|
-
n === "jobs" ? /* @__PURE__ */ H(
|
|
34662
|
+
n === "jobs" ? /* @__PURE__ */ H(FI, {
|
|
34648
34663
|
trpc: e,
|
|
34649
34664
|
providers: l.state.status === "ok" ? l.state.data : null,
|
|
34650
34665
|
baseModels: u.state.status === "ok" ? u.state.data : null,
|
|
@@ -34661,4 +34676,4 @@ function UI({ trpc: e, navigate: t }) {
|
|
|
34661
34676
|
});
|
|
34662
34677
|
}
|
|
34663
34678
|
//#endregion
|
|
34664
|
-
export {
|
|
34679
|
+
export { GI as JOB_POLL_MS, qI as default, WI as readTrainingTab };
|