luo-image-annotator 0.0.12 → 0.0.13
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/README.md +35 -0
- package/dist/luo-image-annotator.css +1 -1
- package/dist/luo-image-annotator.es.js +410 -403
- package/dist/luo-image-annotator.umd.js +17 -17
- package/package.json +1 -1
- package//347/273/204/344/273/266/346/216/245/345/205/245/344/270/216/345/271/263/345/217/260/345/210/206/345/261/202/350/257/264/346/230/216.md +19 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var Jt = Object.defineProperty;
|
|
2
|
-
var jt = (
|
|
3
|
-
var S = (
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
const ct = (
|
|
2
|
+
var jt = (f, t, i) => t in f ? Jt(f, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : f[t] = i;
|
|
3
|
+
var S = (f, t, i) => jt(f, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import { defineComponent as tt, ref as M, watchEffect as Yt, openBlock as y, createElementBlock as x, normalizeClass as J, computed as D, onMounted as Xt, watch as Y, createElementVNode as g, toDisplayString as P, Fragment as B, renderList as F, normalizeStyle as V, createCommentVNode as T, createVNode as L, withModifiers as qt, createTextVNode as K, withDirectives as lt, vModelText as rt, createBlock as yt, nextTick as Gt } from "vue";
|
|
5
|
+
const ct = (f, t) => Math.sqrt(Math.pow(f.x - t.x, 2) + Math.pow(f.y - t.y, 2)), Kt = (f, t) => {
|
|
6
6
|
let i = !1;
|
|
7
|
-
for (let e = 0,
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
for (let e = 0, o = t.length - 1; e < t.length; o = e++) {
|
|
8
|
+
const c = t[e].x, r = t[e].y, a = t[o].x, d = t[o].y;
|
|
9
|
+
r > f.y != d > f.y && f.x < (a - c) * (f.y - r) / (d - r) + c && (i = !i);
|
|
10
10
|
}
|
|
11
11
|
return i;
|
|
12
|
-
},
|
|
13
|
-
const e = i * (Math.PI / 180),
|
|
12
|
+
}, pt = (f, t, i) => {
|
|
13
|
+
const e = i * (Math.PI / 180), o = Math.cos(e), c = Math.sin(e), r = f.x - t.x, a = f.y - t.y;
|
|
14
14
|
return {
|
|
15
|
-
x: t.x + (
|
|
16
|
-
y: t.y + (
|
|
15
|
+
x: t.x + (r * o - a * c),
|
|
16
|
+
y: t.y + (r * c + a * o)
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
class Zt {
|
|
@@ -89,8 +89,8 @@ class Zt {
|
|
|
89
89
|
zoom(t) {
|
|
90
90
|
const e = t > 0 ? this.scale * 1.1 : this.scale / 1.1;
|
|
91
91
|
if (e < 0.1 || e > 10) return;
|
|
92
|
-
const
|
|
93
|
-
this.scale = e, this.offset.x =
|
|
92
|
+
const o = this.canvas.width / 2, c = this.canvas.height / 2, r = this.toImageCoords(o, c);
|
|
93
|
+
this.scale = e, this.offset.x = o - r.x * this.scale, this.offset.y = c - r.y * this.scale, this.clampViewportOffset(), this.render();
|
|
94
94
|
}
|
|
95
95
|
resize() {
|
|
96
96
|
this.fitImageToCanvas(), this.render();
|
|
@@ -122,14 +122,14 @@ class Zt {
|
|
|
122
122
|
if (t <= this.canvas.width)
|
|
123
123
|
this.offset.x = (this.canvas.width - t) / 2;
|
|
124
124
|
else {
|
|
125
|
-
const e = this.canvas.width - t,
|
|
126
|
-
this.offset.x = Math.min(
|
|
125
|
+
const e = this.canvas.width - t, o = 0;
|
|
126
|
+
this.offset.x = Math.min(o, Math.max(e, this.offset.x));
|
|
127
127
|
}
|
|
128
128
|
if (i <= this.canvas.height)
|
|
129
129
|
this.offset.y = (this.canvas.height - i) / 2;
|
|
130
130
|
else {
|
|
131
|
-
const e = this.canvas.height - i,
|
|
132
|
-
this.offset.y = Math.min(
|
|
131
|
+
const e = this.canvas.height - i, o = 0;
|
|
132
|
+
this.offset.y = Math.min(o, Math.max(e, this.offset.y));
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
// --- 事件处理 ---
|
|
@@ -151,28 +151,28 @@ class Zt {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
handleMouseDown(t) {
|
|
154
|
-
const i = this.canvas.getBoundingClientRect(), e = t.clientX - i.left,
|
|
154
|
+
const i = this.canvas.getBoundingClientRect(), e = t.clientX - i.left, o = t.clientY - i.top, c = this.toImageCoords(e, o);
|
|
155
155
|
if (this.canvas.style.cursor === "grab" || this.canvas.style.cursor === "grabbing") {
|
|
156
|
-
this.isPanning = !0, this.panStartPoint = { x: e, y:
|
|
156
|
+
this.isPanning = !0, this.panStartPoint = { x: e, y: o }, this.canvas.style.cursor = "grabbing";
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
159
|
if (this.interactionMode === "select" && this.activeAnnotation) {
|
|
160
|
-
const d = this.getHitHandle(e,
|
|
160
|
+
const d = this.getHitHandle(e, o, this.activeAnnotation);
|
|
161
161
|
if (d !== -100) {
|
|
162
|
-
this.isDragging = !0, this.dragStartPoint =
|
|
162
|
+
this.isDragging = !0, this.dragStartPoint = c, this.selectedHandleIndex = d, this.dragStartAnnotation = JSON.parse(JSON.stringify(this.activeAnnotation));
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
this.activeAnnotation =
|
|
166
|
+
const r = this.interactionMode === "select" ? this.getHitCategory(e, o) : null;
|
|
167
|
+
if (r) {
|
|
168
|
+
this.activeAnnotation = r, this.isDragging = !1, this.selectedHandleIndex = -1, this.emit("annotationChange", { action: "select", changedItem: r, imageUrl: this.imageUrl }), this.render();
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
|
-
const
|
|
171
|
+
const a = this.getHitAnnotation(c);
|
|
172
172
|
if (this.interactionMode === "select") {
|
|
173
|
-
if (
|
|
174
|
-
if (!(this.visibleLabels.size > 0 && !this.visibleLabels.has(
|
|
175
|
-
this.activeAnnotation =
|
|
173
|
+
if (a) {
|
|
174
|
+
if (!(this.visibleLabels.size > 0 && !this.visibleLabels.has(a.label))) {
|
|
175
|
+
this.activeAnnotation = a, this.isDragging = !0, this.dragStartPoint = c, this.selectedHandleIndex = -1, this.dragStartAnnotation = JSON.parse(JSON.stringify(a)), this.emit("annotationChange", { action: "select", changedItem: a, imageUrl: this.imageUrl }), this.render();
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
} else
|
|
@@ -182,42 +182,42 @@ class Zt {
|
|
|
182
182
|
if (this.interactionMode === "draw") {
|
|
183
183
|
if (this.isDrawing && this.currentTool === "polygon" && this.activeAnnotation) {
|
|
184
184
|
const d = this.activeAnnotation.coordinates;
|
|
185
|
-
if (d.points.length > 2 && ct(
|
|
185
|
+
if (d.points.length > 2 && ct(c, d.points[0]) < 20 / this.scale) {
|
|
186
186
|
this.finishDrawing();
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
this.startDrawing(
|
|
189
|
+
this.startDrawing(c);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
if (this.currentTool) {
|
|
193
193
|
if (this.currentTool === "polygon" && !this.isDrawing) {
|
|
194
|
-
this.startDrawing(
|
|
194
|
+
this.startDrawing(c);
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
this.startDrawing(
|
|
197
|
+
this.startDrawing(c);
|
|
198
198
|
}
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
201
|
this.activeAnnotation = null, this.render();
|
|
202
202
|
}
|
|
203
203
|
handleMouseMove(t) {
|
|
204
|
-
const i = this.canvas.getBoundingClientRect(), e = t.clientX - i.left,
|
|
204
|
+
const i = this.canvas.getBoundingClientRect(), e = t.clientX - i.left, o = t.clientY - i.top, c = this.toImageCoords(e, o);
|
|
205
205
|
if (this.isPanning && this.panStartPoint) {
|
|
206
|
-
const
|
|
207
|
-
this.offset.x +=
|
|
206
|
+
const r = e - this.panStartPoint.x, a = o - this.panStartPoint.y;
|
|
207
|
+
this.offset.x += r, this.offset.y += a, this.clampViewportOffset(), this.panStartPoint = { x: e, y: o }, this.render();
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
|
-
if (this.lastMouseMovePoint =
|
|
210
|
+
if (this.lastMouseMovePoint = c, this.isDrawing) {
|
|
211
211
|
if (this.currentTool === "polygon" && this.activeAnnotation) {
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
const
|
|
212
|
+
const r = this.activeAnnotation.coordinates;
|
|
213
|
+
if (r.points.length > 2) {
|
|
214
|
+
const a = r.points[0], d = ct(c, a);
|
|
215
215
|
this.isHoveringStartPoint = d < 20 / this.scale;
|
|
216
216
|
} else
|
|
217
217
|
this.isHoveringStartPoint = !1;
|
|
218
218
|
}
|
|
219
|
-
this.updateDrawing(
|
|
220
|
-
} else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(
|
|
219
|
+
this.updateDrawing(c);
|
|
220
|
+
} else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(c) : this.checkHover(e, o, c);
|
|
221
221
|
this.render();
|
|
222
222
|
}
|
|
223
223
|
handleMouseUp(t) {
|
|
@@ -242,8 +242,8 @@ class Zt {
|
|
|
242
242
|
// 辅助函数:将 hex 转换为 rgba
|
|
243
243
|
hexToRgba(t, i) {
|
|
244
244
|
if (!t.startsWith("#")) return t;
|
|
245
|
-
const e = parseInt(t.slice(1, 3), 16),
|
|
246
|
-
return `rgba(${e}, ${
|
|
245
|
+
const e = parseInt(t.slice(1, 3), 16), o = parseInt(t.slice(3, 5), 16), c = parseInt(t.slice(5, 7), 16);
|
|
246
|
+
return `rgba(${e}, ${o}, ${c}, ${i})`;
|
|
247
247
|
}
|
|
248
248
|
startDrawing(t) {
|
|
249
249
|
if (!this.currentTool) return;
|
|
@@ -299,8 +299,8 @@ class Zt {
|
|
|
299
299
|
const i = this.activeAnnotation.coordinates;
|
|
300
300
|
i.x2 = t.x, i.y2 = t.y;
|
|
301
301
|
} else if (this.activeAnnotation.type === "rotatedRect" && this.dragStartPoint) {
|
|
302
|
-
const i = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x),
|
|
303
|
-
i.width = e * 2, i.height =
|
|
302
|
+
const i = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x), o = Math.abs(t.y - this.dragStartPoint.y);
|
|
303
|
+
i.width = e * 2, i.height = o * 2;
|
|
304
304
|
} else this.activeAnnotation.type;
|
|
305
305
|
}
|
|
306
306
|
finishDrawing() {
|
|
@@ -311,8 +311,8 @@ class Zt {
|
|
|
311
311
|
this.activeAnnotation = null, this.isDrawing = !1;
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
const i = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2),
|
|
315
|
-
t.x1 = i, t.x2 = e, t.y1 =
|
|
314
|
+
const i = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2), o = Math.min(t.y1, t.y2), c = Math.max(t.y1, t.y2);
|
|
315
|
+
t.x1 = i, t.x2 = e, t.y1 = o, t.y2 = c, this.annotations.push(this.activeAnnotation), this.emit("annotationChange", { action: "add", changedItem: this.activeAnnotation, imageUrl: this.imageUrl });
|
|
316
316
|
} else if (this.activeAnnotation.type === "polygon") {
|
|
317
317
|
if (this.activeAnnotation.coordinates.points.length < 3) {
|
|
318
318
|
this.activeAnnotation = null, this.isDrawing = !1;
|
|
@@ -336,40 +336,40 @@ class Zt {
|
|
|
336
336
|
const i = t.x - this.dragStartPoint.x, e = t.y - this.dragStartPoint.y;
|
|
337
337
|
this.selectedHandleIndex === -1 ? this.moveAnnotation(this.activeAnnotation, this.dragStartAnnotation, i, e) : this.resizeAnnotation(this.activeAnnotation, this.dragStartAnnotation, this.selectedHandleIndex, t);
|
|
338
338
|
}
|
|
339
|
-
moveAnnotation(t, i, e,
|
|
339
|
+
moveAnnotation(t, i, e, o) {
|
|
340
340
|
if (t.type === "rectangle") {
|
|
341
|
-
const
|
|
342
|
-
|
|
341
|
+
const c = i.coordinates, r = t.coordinates;
|
|
342
|
+
r.x1 = c.x1 + e, r.x2 = c.x2 + e, r.y1 = c.y1 + o, r.y2 = c.y2 + o;
|
|
343
343
|
} else if (t.type === "point") {
|
|
344
|
-
const
|
|
345
|
-
|
|
344
|
+
const c = i.coordinates, r = t.coordinates;
|
|
345
|
+
r.points = c.points.map((a) => ({ x: a.x + e, y: a.y + o }));
|
|
346
346
|
} else if (t.type === "rotatedRect") {
|
|
347
|
-
const
|
|
348
|
-
|
|
347
|
+
const c = i.coordinates, r = t.coordinates;
|
|
348
|
+
r.x = c.x + e, r.y = c.y + o;
|
|
349
349
|
} else if (t.type === "polygon") {
|
|
350
|
-
const
|
|
351
|
-
|
|
350
|
+
const c = i.coordinates, r = t.coordinates;
|
|
351
|
+
r.points = c.points.map((a) => ({ x: a.x + e, y: a.y + o }));
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
resizeAnnotation(t, i, e,
|
|
354
|
+
resizeAnnotation(t, i, e, o) {
|
|
355
355
|
if (t.type === "rectangle") {
|
|
356
|
-
const
|
|
357
|
-
e === 0 && (
|
|
356
|
+
const c = t.coordinates;
|
|
357
|
+
e === 0 && (c.x1 = o.x, c.y1 = o.y), e === 1 && (c.x2 = o.x, c.y1 = o.y), e === 2 && (c.x2 = o.x, c.y2 = o.y), e === 3 && (c.x1 = o.x, c.y2 = o.y);
|
|
358
358
|
} else if (t.type === "polygon") {
|
|
359
|
-
const
|
|
360
|
-
e >= 0 && e <
|
|
359
|
+
const c = t.coordinates;
|
|
360
|
+
e >= 0 && e < c.points.length && (c.points[e] = o);
|
|
361
361
|
} else if (t.type === "point") {
|
|
362
|
-
const
|
|
363
|
-
e >= 0 && e <
|
|
362
|
+
const c = t.coordinates;
|
|
363
|
+
e >= 0 && e < c.points.length && (c.points[e] = o);
|
|
364
364
|
} else if (t.type === "rotatedRect") {
|
|
365
|
-
const
|
|
365
|
+
const c = t.coordinates;
|
|
366
366
|
if (e === -2) {
|
|
367
|
-
const
|
|
368
|
-
let w = Math.atan2(
|
|
369
|
-
w += 90,
|
|
367
|
+
const r = c.x, a = c.y, d = o.x - r, u = o.y - a;
|
|
368
|
+
let w = Math.atan2(u, d) * 180 / Math.PI;
|
|
369
|
+
w += 90, c.angle = w;
|
|
370
370
|
} else {
|
|
371
|
-
const
|
|
372
|
-
(e === 0 || e === 3) && (
|
|
371
|
+
const r = c.angle * Math.PI / 180, a = Math.cos(-r), d = Math.sin(-r), u = o.x - c.x, w = o.y - c.y, m = u * a - w * d, _ = u * d + w * a;
|
|
372
|
+
(e === 0 || e === 3) && (c.width / 2, c.width = Math.abs(m) * 2), (e === 1 || e === 2) && (c.width = Math.abs(m) * 2), (e === 0 || e === 1) && (c.height = Math.abs(_) * 2), (e === 2 || e === 3) && (c.height = Math.abs(_) * 2);
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -390,18 +390,18 @@ class Zt {
|
|
|
390
390
|
const e = i.coordinates;
|
|
391
391
|
return Kt(t, e.points);
|
|
392
392
|
} else if (i.type === "rotatedRect") {
|
|
393
|
-
const e = i.coordinates,
|
|
394
|
-
return
|
|
393
|
+
const e = i.coordinates, o = pt(t, { x: e.x, y: e.y }, -e.angle), c = e.width / 2, r = e.height / 2;
|
|
394
|
+
return o.x >= e.x - c && o.x <= e.x + c && o.y >= e.y - r && o.y <= e.y + r;
|
|
395
395
|
} else if (i.type === "point")
|
|
396
|
-
return i.coordinates.points.some((
|
|
396
|
+
return i.coordinates.points.some((o) => ct(t, o) < 10 / this.scale);
|
|
397
397
|
return !1;
|
|
398
398
|
}
|
|
399
399
|
getHitHandle(t, i, e) {
|
|
400
|
-
const
|
|
401
|
-
for (let
|
|
402
|
-
const
|
|
403
|
-
if (Math.abs(t - d.x) <
|
|
404
|
-
return e.type === "rotatedRect" &&
|
|
400
|
+
const o = this.getAnnotationHandles(e), c = 6;
|
|
401
|
+
for (let r = 0; r < o.length; r++) {
|
|
402
|
+
const a = o[r], d = this.toScreenCoords(a.x, a.y);
|
|
403
|
+
if (Math.abs(t - d.x) < c && Math.abs(i - d.y) < c)
|
|
404
|
+
return e.type === "rotatedRect" && r === 4 ? -2 : r;
|
|
405
405
|
}
|
|
406
406
|
return -100;
|
|
407
407
|
}
|
|
@@ -424,24 +424,24 @@ class Zt {
|
|
|
424
424
|
if (t.type === "point")
|
|
425
425
|
return t.coordinates.points;
|
|
426
426
|
if (t.type === "rotatedRect") {
|
|
427
|
-
const i = t.coordinates, e = { x: i.x, y: i.y },
|
|
428
|
-
return [
|
|
427
|
+
const i = t.coordinates, e = { x: i.x, y: i.y }, o = i.width / 2, c = i.height / 2, r = { x: i.x - o, y: i.y - c }, a = { x: i.x + o, y: i.y - c }, d = { x: i.x + o, y: i.y + c }, u = { x: i.x - o, y: i.y + c }, w = { x: i.x, y: i.y - c - 20 / this.scale };
|
|
428
|
+
return [r, a, d, u, w].map((m) => pt(m, e, i.angle));
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
return [];
|
|
432
432
|
}
|
|
433
433
|
checkHover(t, i, e) {
|
|
434
|
-
const
|
|
435
|
-
if (
|
|
436
|
-
this.canvas.style.cursor = "pointer", this.hoverAnnotation =
|
|
434
|
+
const o = this.getHitCategory(t, i);
|
|
435
|
+
if (o) {
|
|
436
|
+
this.canvas.style.cursor = "pointer", this.hoverAnnotation = o;
|
|
437
437
|
return;
|
|
438
438
|
}
|
|
439
439
|
if (this.activeAnnotation && this.getHitHandle(t, i, this.activeAnnotation) !== -100) {
|
|
440
440
|
this.canvas.style.cursor = "pointer";
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
|
-
const
|
|
444
|
-
|
|
443
|
+
const c = this.getHitAnnotation(e);
|
|
444
|
+
c ? (this.canvas.style.cursor = "move", this.hoverAnnotation = c) : (this.canvas.style.cursor = "default", this.hoverAnnotation = null);
|
|
445
445
|
}
|
|
446
446
|
render() {
|
|
447
447
|
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.img.complete && this.img.width > 0 && this.ctx.drawImage(this.img, this.offset.x, this.offset.y, this.img.width * this.scale, this.img.height * this.scale), this.annotations.forEach((t) => {
|
|
@@ -453,71 +453,71 @@ class Zt {
|
|
|
453
453
|
if (t.length === 0) return;
|
|
454
454
|
this.ctx.save(), this.ctx.font = "14px sans-serif", this.ctx.textBaseline = "top";
|
|
455
455
|
let i = 10;
|
|
456
|
-
const e = 10,
|
|
456
|
+
const e = 10, o = 8, c = 4, r = 24, a = 8;
|
|
457
457
|
t.forEach((d) => {
|
|
458
|
-
const
|
|
459
|
-
this.ctx.fillStyle = m ? "#E3F2FD" : _ ? "#F5F5F5" : "rgba(255, 255, 255, 0.9)", this.ctx.strokeStyle = m ? "#2196F3" : "#666", this.ctx.lineWidth = m ? 2 : 1, this.ctx.beginPath(), this.ctx.rect(i, e, w,
|
|
458
|
+
const u = d.label || "Unlabeled", w = this.ctx.measureText(u).width + o * 2, m = this.activeAnnotation === d, _ = this.hoverAnnotation === d;
|
|
459
|
+
this.ctx.fillStyle = m ? "#E3F2FD" : _ ? "#F5F5F5" : "rgba(255, 255, 255, 0.9)", this.ctx.strokeStyle = m ? "#2196F3" : "#666", this.ctx.lineWidth = m ? 2 : 1, this.ctx.beginPath(), this.ctx.rect(i, e, w, r), this.ctx.fill(), this.ctx.stroke(), this.ctx.fillStyle = m ? "#1976D2" : "#333", this.ctx.fillText(u, i + o, e + c), i += w + a;
|
|
460
460
|
}), this.ctx.restore();
|
|
461
461
|
}
|
|
462
462
|
getHitCategory(t, i) {
|
|
463
463
|
const e = this.annotations.filter((w) => w.type === "category");
|
|
464
464
|
if (e.length === 0) return null;
|
|
465
465
|
this.ctx.save(), this.ctx.font = "14px sans-serif";
|
|
466
|
-
let
|
|
467
|
-
const
|
|
468
|
-
let
|
|
466
|
+
let o = 10;
|
|
467
|
+
const c = 10, r = 8, a = 24, d = 8;
|
|
468
|
+
let u = null;
|
|
469
469
|
for (const w of e) {
|
|
470
|
-
const m = w.label || "Unlabeled", _ = this.ctx.measureText(m).width +
|
|
471
|
-
if (t >=
|
|
472
|
-
|
|
470
|
+
const m = w.label || "Unlabeled", _ = this.ctx.measureText(m).width + r * 2;
|
|
471
|
+
if (t >= o && t <= o + _ && i >= c && i <= c + a) {
|
|
472
|
+
u = w;
|
|
473
473
|
break;
|
|
474
474
|
}
|
|
475
|
-
|
|
475
|
+
o += _ + d;
|
|
476
476
|
}
|
|
477
|
-
return this.ctx.restore(),
|
|
477
|
+
return this.ctx.restore(), u;
|
|
478
478
|
}
|
|
479
479
|
drawItem(t, i) {
|
|
480
|
-
var
|
|
480
|
+
var c;
|
|
481
481
|
if (this.visibleLabels.size > 0 && !this.visibleLabels.has(t.label) && !i)
|
|
482
482
|
return;
|
|
483
483
|
this.ctx.save();
|
|
484
|
-
const e = ((
|
|
485
|
-
if (this.ctx.strokeStyle =
|
|
486
|
-
const
|
|
487
|
-
this.ctx.strokeRect(
|
|
484
|
+
const e = ((c = t.style) == null ? void 0 : c.strokeColor) || "#FF4081", o = i ? "#00E5FF" : e;
|
|
485
|
+
if (this.ctx.strokeStyle = o, this.ctx.lineWidth = 2, i ? this.ctx.fillStyle = "rgba(0, 229, 255, 0.2)" : this.ctx.fillStyle = this.hexToRgba(e, 0.2), t.type === "rectangle") {
|
|
486
|
+
const r = t.coordinates, a = this.toScreenCoords(r.x1, r.y1), d = this.toScreenCoords(r.x2, r.y2), u = Math.min(a.x, d.x), w = Math.min(a.y, d.y), m = Math.abs(a.x - d.x), _ = Math.abs(a.y - d.y);
|
|
487
|
+
this.ctx.strokeRect(u, w, m, _), this.ctx.fillStyle = i ? "rgba(0, 229, 255, 0.2)" : "rgba(255, 64, 129, 0.2)", this.ctx.fillRect(u, w, m, _), i && this.drawHandles(this.getAnnotationHandles(t));
|
|
488
488
|
} else if (t.type === "polygon") {
|
|
489
|
-
const
|
|
490
|
-
if (
|
|
489
|
+
const r = t.coordinates;
|
|
490
|
+
if (r.points.length === 0) {
|
|
491
491
|
this.ctx.restore();
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
494
494
|
this.ctx.beginPath();
|
|
495
|
-
const
|
|
496
|
-
this.ctx.moveTo(
|
|
497
|
-
for (let d = 1; d <
|
|
498
|
-
const
|
|
499
|
-
this.ctx.lineTo(
|
|
495
|
+
const a = this.toScreenCoords(r.points[0].x, r.points[0].y);
|
|
496
|
+
this.ctx.moveTo(a.x, a.y);
|
|
497
|
+
for (let d = 1; d < r.points.length; d++) {
|
|
498
|
+
const u = this.toScreenCoords(r.points[d].x, r.points[d].y);
|
|
499
|
+
this.ctx.lineTo(u.x, u.y);
|
|
500
500
|
}
|
|
501
501
|
if (!this.isDrawing || t !== this.activeAnnotation)
|
|
502
502
|
this.ctx.closePath();
|
|
503
503
|
else if (this.lastMouseMovePoint) {
|
|
504
504
|
let d = this.lastMouseMovePoint;
|
|
505
|
-
if (this.isHoveringStartPoint &&
|
|
506
|
-
d =
|
|
507
|
-
const w = this.toScreenCoords(
|
|
505
|
+
if (this.isHoveringStartPoint && r.points.length > 0) {
|
|
506
|
+
d = r.points[0];
|
|
507
|
+
const w = this.toScreenCoords(r.points[0].x, r.points[0].y);
|
|
508
508
|
this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(w.x, w.y, 10, 0, Math.PI * 2), this.ctx.fillStyle = "rgba(255, 215, 0, 0.6)", this.ctx.strokeStyle = "#FFFFFF", this.ctx.lineWidth = 2, this.ctx.fill(), this.ctx.stroke(), this.ctx.restore();
|
|
509
509
|
}
|
|
510
|
-
const
|
|
511
|
-
this.ctx.lineTo(
|
|
510
|
+
const u = this.toScreenCoords(d.x, d.y);
|
|
511
|
+
this.ctx.lineTo(u.x, u.y);
|
|
512
512
|
}
|
|
513
513
|
this.ctx.stroke(), this.ctx.fillStyle = i ? "rgba(0, 229, 255, 0.2)" : "rgba(255, 64, 129, 0.2)", this.ctx.fill(), i && this.drawHandles(this.getAnnotationHandles(t));
|
|
514
514
|
} else if (t.type === "rotatedRect") {
|
|
515
|
-
const
|
|
516
|
-
this.ctx.translate(this.toScreenCoords(
|
|
517
|
-
const
|
|
518
|
-
this.ctx.strokeRect(-
|
|
519
|
-
} else t.type === "point" && t.coordinates.points.forEach((
|
|
520
|
-
const d = this.toScreenCoords(
|
|
515
|
+
const r = t.coordinates;
|
|
516
|
+
this.ctx.translate(this.toScreenCoords(r.x, r.y).x, this.toScreenCoords(r.x, r.y).y), this.ctx.rotate(r.angle * Math.PI / 180);
|
|
517
|
+
const a = r.width * this.scale, d = r.height * this.scale;
|
|
518
|
+
this.ctx.strokeRect(-a / 2, -d / 2, a, d), this.ctx.fillStyle = i ? "rgba(0, 229, 255, 0.2)" : "rgba(255, 64, 129, 0.2)", this.ctx.fillRect(-a / 2, -d / 2, a, d), this.ctx.rotate(-r.angle * Math.PI / 180), this.ctx.translate(-this.toScreenCoords(r.x, r.y).x, -this.toScreenCoords(r.x, r.y).y), i && this.drawHandles(this.getAnnotationHandles(t));
|
|
519
|
+
} else t.type === "point" && t.coordinates.points.forEach((a) => {
|
|
520
|
+
const d = this.toScreenCoords(a.x, a.y);
|
|
521
521
|
this.ctx.beginPath(), this.ctx.arc(d.x, d.y, 5, 0, Math.PI * 2), this.ctx.fillStyle = i ? "#00E5FF" : e, this.ctx.fill(), this.ctx.stroke();
|
|
522
522
|
});
|
|
523
523
|
this.ctx.restore();
|
|
@@ -561,28 +561,28 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
561
561
|
<path d="M637.12 693.376l182.208 182.208a32 32 0 1 1-45.248 45.248L591.872 738.624a352 352 0 1 1 45.248-45.248z m-45.248-45.248A288 288 0 1 0 183.872 240.128a288 288 0 0 0 408 408zM416 448h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96v-96a32 32 0 0 1 64 0v96z" fill="currentColor"/>\r
|
|
562
562
|
</svg>`, ve = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
|
|
563
563
|
<path d="M637.12 693.376l182.208 182.208a32 32 0 1 1-45.248 45.248L591.872 738.624a352 352 0 1 1 45.248-45.248z m-45.248-45.248A288 288 0 1 0 183.872 240.128a288 288 0 0 0 408 408zM256 448h320a32 32 0 1 1 0 64H256a32 32 0 1 1 0-64z" fill="currentColor"/>\r
|
|
564
|
-
</svg>`, me = ["innerHTML"], fe = /* @__PURE__ */
|
|
564
|
+
</svg>`, me = ["innerHTML"], fe = /* @__PURE__ */ tt({
|
|
565
565
|
__name: "SvgIcon",
|
|
566
566
|
props: {
|
|
567
567
|
name: {},
|
|
568
568
|
size: {}
|
|
569
569
|
},
|
|
570
|
-
setup(
|
|
571
|
-
const t =
|
|
570
|
+
setup(f) {
|
|
571
|
+
const t = f, i = M(""), e = /* @__PURE__ */ Object.assign({ "../assets/svg/aim.svg": Qt, "../assets/svg/back.svg": te, "../assets/svg/connection.svg": ee, "../assets/svg/crop.svg": ne, "../assets/svg/delete.svg": se, "../assets/svg/download.svg": ie, "../assets/svg/edit.svg": oe, "../assets/svg/hide.svg": ae, "../assets/svg/pointer.svg": le, "../assets/svg/price-tag.svg": re, "../assets/svg/rank.svg": ce, "../assets/svg/refresh-right.svg": he, "../assets/svg/right.svg": de, "../assets/svg/view.svg": ge, "../assets/svg/zoom-in.svg": ue, "../assets/svg/zoom-out.svg": ve });
|
|
572
572
|
return Yt(() => {
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
}), (
|
|
576
|
-
class:
|
|
573
|
+
const o = `../assets/svg/${t.name}.svg`, c = e[o];
|
|
574
|
+
c ? i.value = c : (console.warn(`Icon ${t.name} not found at path ${o}`), i.value = "");
|
|
575
|
+
}), (o, c) => (y(), x("i", {
|
|
576
|
+
class: J(["svg-icon", [f.size ? `size-${f.size}` : ""]]),
|
|
577
577
|
innerHTML: i.value
|
|
578
578
|
}, null, 10, me));
|
|
579
579
|
}
|
|
580
|
-
}),
|
|
581
|
-
const i =
|
|
582
|
-
for (const [e,
|
|
583
|
-
i[e] =
|
|
580
|
+
}), et = (f, t) => {
|
|
581
|
+
const i = f.__vccOpts || f;
|
|
582
|
+
for (const [e, o] of t)
|
|
583
|
+
i[e] = o;
|
|
584
584
|
return i;
|
|
585
|
-
}, H = /* @__PURE__ */
|
|
585
|
+
}, H = /* @__PURE__ */ et(fe, [["__scopeId", "data-v-3928607b"]]), ye = {
|
|
586
586
|
key: 0,
|
|
587
587
|
class: "image-list-sidebar"
|
|
588
588
|
}, pe = { class: "image-list-title" }, xe = { class: "image-list-scroll" }, be = ["onClick"], we = { class: "image-list-stage" }, Ce = ["src", "alt"], Ae = {
|
|
@@ -608,10 +608,10 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
608
608
|
}, Be = ["disabled"], De = ["disabled"], Ue = {
|
|
609
609
|
key: 2,
|
|
610
610
|
class: "right-sidebar"
|
|
611
|
-
}, Fe = { class: "label-list" },
|
|
611
|
+
}, Fe = { class: "label-list" }, Oe = { class: "label-row" }, Ee = ["onUpdate:modelValue", "onChange"], Ve = ["title"], Ne = ["onClick"], We = { class: "action-icon more-actions" }, Je = ["onClick"], je = {
|
|
612
612
|
key: 3,
|
|
613
613
|
class: "modal-overlay"
|
|
614
|
-
}, Ye = { class: "modal-content" }, Xe = { class: "form-group" }, qe = { class: "form-group" }, Ge = { class: "color-input-wrapper" }, Ke = /* @__PURE__ */
|
|
614
|
+
}, Ye = { class: "modal-content" }, Xe = { class: "form-group" }, qe = { class: "form-group" }, Ge = { class: "color-input-wrapper" }, Ke = /* @__PURE__ */ tt({
|
|
615
615
|
__name: "ImageAnnotator",
|
|
616
616
|
props: {
|
|
617
617
|
annotationTypes: { default: () => ["rectangle", "polygon", "point", "rotatedRect"] },
|
|
@@ -628,8 +628,8 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
628
628
|
maxZoom: {}
|
|
629
629
|
},
|
|
630
630
|
emits: ["annotationChange", "batchChange", "labelChange", "ready", "error", "tool:change", "viewport:change", "annotation:add", "annotation:update", "annotation:delete", "annotation:select", "prediction:loaded", "prediction:apply", "prediction:reject"],
|
|
631
|
-
setup(
|
|
632
|
-
const e =
|
|
631
|
+
setup(f, { expose: t, emit: i }) {
|
|
632
|
+
const e = f, o = i, c = M(null), r = M(null), a = M(null), d = M(null), u = M(0), w = M(""), m = M([]), _ = M(""), U = M(!1), k = M({ name: "", color: "#FF0000" }), I = M("none"), C = M([]), R = M({}), N = D(() => d.value === "select" && !!w.value), j = (n) => {
|
|
633
633
|
if (!n || R.value[n]) return;
|
|
634
634
|
const s = new Image();
|
|
635
635
|
s.onload = () => {
|
|
@@ -639,13 +639,13 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
639
639
|
[n]: { width: l, height: h }
|
|
640
640
|
};
|
|
641
641
|
}, s.src = n;
|
|
642
|
-
},
|
|
642
|
+
}, X = () => {
|
|
643
643
|
e.batchImages.forEach((n) => {
|
|
644
|
-
|
|
644
|
+
j(n.imageUrl);
|
|
645
645
|
});
|
|
646
|
-
},
|
|
646
|
+
}, O = () => {
|
|
647
647
|
var l, h, v, A;
|
|
648
|
-
const n = e.batchImages[
|
|
648
|
+
const n = e.batchImages[u.value], s = (n == null ? void 0 : n.imageUrl) || ((l = e.image) == null ? void 0 : l.url);
|
|
649
649
|
return {
|
|
650
650
|
eventId: `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`,
|
|
651
651
|
timestamp: Date.now(),
|
|
@@ -654,17 +654,17 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
654
654
|
imageId: ((v = e.image) == null ? void 0 : v.id) || s,
|
|
655
655
|
operator: (A = e.session) == null ? void 0 : A.userId
|
|
656
656
|
};
|
|
657
|
-
},
|
|
657
|
+
}, ht = (n) => {
|
|
658
658
|
var h;
|
|
659
659
|
const s = n == null ? void 0 : n.action;
|
|
660
660
|
if (!s) return;
|
|
661
661
|
const l = {
|
|
662
|
-
meta:
|
|
662
|
+
meta: O(),
|
|
663
663
|
action: s,
|
|
664
664
|
current: n == null ? void 0 : n.changedItem,
|
|
665
665
|
source: (h = n == null ? void 0 : n.changedItem) != null && h.predictionId ? "prediction" : "manual"
|
|
666
666
|
};
|
|
667
|
-
s === "add" &&
|
|
667
|
+
s === "add" && o("annotation:add", l), s === "update" && o("annotation:update", l), s === "delete" && o("annotation:delete", l), s === "select" && o("annotation:select", l);
|
|
668
668
|
}, nt = D(() => e.annotationTypes.filter((n) => n !== "category")), st = (n) => ({
|
|
669
669
|
rectangle: "crop",
|
|
670
670
|
polygon: "connection",
|
|
@@ -679,64 +679,64 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
679
679
|
category: "分类标签"
|
|
680
680
|
})[n] || n;
|
|
681
681
|
Xt(() => {
|
|
682
|
-
if (
|
|
683
|
-
|
|
682
|
+
if (X(), c.value) {
|
|
683
|
+
a.value = new Zt(c.value), a.value.on("annotationChange", (s) => {
|
|
684
684
|
var l, h;
|
|
685
685
|
if (s.action === "add" && s.changedItem) {
|
|
686
686
|
const v = m.value.find((A) => A.id === _.value);
|
|
687
687
|
v && (s.changedItem.label = v.name, s.changedItem.labelId = v.id);
|
|
688
688
|
}
|
|
689
|
-
s.action === "select" ? w.value = ((l = s.changedItem) == null ? void 0 : l.id) || "" : s.action === "delete" && ((h = s.changedItem) == null ? void 0 : h.id) === w.value && (w.value = ""),
|
|
690
|
-
}),
|
|
689
|
+
s.action === "select" ? w.value = ((l = s.changedItem) == null ? void 0 : l.id) || "" : s.action === "delete" && ((h = s.changedItem) == null ? void 0 : h.id) === w.value && (w.value = ""), o("annotationChange", s), ht(s);
|
|
690
|
+
}), W(), E();
|
|
691
691
|
const n = new ResizeObserver(() => {
|
|
692
692
|
var s;
|
|
693
|
-
(s =
|
|
693
|
+
(s = a.value) == null || s.resize();
|
|
694
694
|
});
|
|
695
|
-
|
|
695
|
+
r.value && n.observe(r.value), e.defaultActiveType && p(e.defaultActiveType), o("ready", { meta: O() });
|
|
696
696
|
}
|
|
697
697
|
});
|
|
698
|
-
const
|
|
699
|
-
if (!
|
|
698
|
+
const E = () => {
|
|
699
|
+
if (!a.value) return;
|
|
700
700
|
const n = m.value.find((l) => l.id === _.value);
|
|
701
|
-
n &&
|
|
701
|
+
n && a.value.setLabelStyle(n.color);
|
|
702
702
|
const s = m.value.filter((l) => l.visible).map((l) => l.name);
|
|
703
|
-
|
|
704
|
-
},
|
|
703
|
+
a.value.setVisibleLabels(s);
|
|
704
|
+
}, W = () => {
|
|
705
705
|
var n;
|
|
706
|
-
if (
|
|
706
|
+
if (a.value)
|
|
707
707
|
if (w.value = "", requestAnimationFrame(() => {
|
|
708
708
|
var s;
|
|
709
|
-
(s =
|
|
709
|
+
(s = a.value) == null || s.resize();
|
|
710
710
|
}), e.batchImages.length > 0) {
|
|
711
|
-
const s = e.batchImages[
|
|
712
|
-
|
|
713
|
-
} else (n = e.image) != null && n.url &&
|
|
714
|
-
},
|
|
711
|
+
const s = e.batchImages[u.value];
|
|
712
|
+
a.value.loadImage(s.imageUrl), s.annotations ? a.value.setAnnotations(s.annotations) : a.value.setAnnotations([]);
|
|
713
|
+
} else (n = e.image) != null && n.url && a.value.loadImage(e.image.url);
|
|
714
|
+
}, p = (n) => {
|
|
715
715
|
var s, l;
|
|
716
716
|
if (d.value = n, w.value = "", n !== "pan" && n !== "select" && m.value.length === 0) {
|
|
717
717
|
alert("请先创建标签!");
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
|
-
n === "pan" || n === "select" ? (s =
|
|
721
|
-
},
|
|
720
|
+
n === "pan" || n === "select" ? (s = a.value) == null || s.setTool(n) : (l = a.value) == null || l.setTool(n), o("tool:change", { meta: O(), tool: n });
|
|
721
|
+
}, b = () => {
|
|
722
722
|
var n;
|
|
723
|
-
(n =
|
|
724
|
-
},
|
|
725
|
-
|
|
726
|
-
meta:
|
|
727
|
-
scale:
|
|
728
|
-
offset: { ...
|
|
723
|
+
(n = a.value) != null && n.activeAnnotation && a.value.deleteAnnotation(a.value.activeAnnotation.id);
|
|
724
|
+
}, z = () => {
|
|
725
|
+
a.value && o("viewport:change", {
|
|
726
|
+
meta: O(),
|
|
727
|
+
scale: a.value.scale,
|
|
728
|
+
offset: { ...a.value.offset }
|
|
729
729
|
});
|
|
730
|
-
},
|
|
730
|
+
}, q = () => {
|
|
731
731
|
var n;
|
|
732
|
-
(n =
|
|
733
|
-
},
|
|
732
|
+
(n = a.value) == null || n.zoom(1), z();
|
|
733
|
+
}, dt = () => {
|
|
734
734
|
var n;
|
|
735
|
-
(n =
|
|
735
|
+
(n = a.value) == null || n.zoom(-1), z();
|
|
736
736
|
}, xt = () => {
|
|
737
|
-
k.value = { name: "", color: "#2196F3" },
|
|
738
|
-
},
|
|
739
|
-
|
|
737
|
+
k.value = { name: "", color: "#2196F3" }, U.value = !0;
|
|
738
|
+
}, gt = () => {
|
|
739
|
+
U.value = !1;
|
|
740
740
|
}, bt = () => {
|
|
741
741
|
if (!k.value.name.trim()) {
|
|
742
742
|
alert("请输入标签名称");
|
|
@@ -748,167 +748,167 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
748
748
|
color: k.value.color,
|
|
749
749
|
visible: !0
|
|
750
750
|
};
|
|
751
|
-
m.value.push(s),
|
|
752
|
-
},
|
|
751
|
+
m.value.push(s), o("labelChange", m.value), E(), m.value.length === 1 && G(s), gt();
|
|
752
|
+
}, G = (n) => {
|
|
753
753
|
var s;
|
|
754
|
-
_.value = n.id, (s =
|
|
754
|
+
_.value = n.id, (s = a.value) == null || s.setLabelStyle(n.color);
|
|
755
755
|
}, wt = (n, s) => {
|
|
756
756
|
if (!n.startsWith("#")) return n;
|
|
757
757
|
let l = 0, h = 0, v = 0;
|
|
758
758
|
return n.length === 4 ? (l = parseInt(n[1] + n[1], 16), h = parseInt(n[2] + n[2], 16), v = parseInt(n[3] + n[3], 16)) : n.length === 7 && (l = parseInt(n.slice(1, 3), 16), h = parseInt(n.slice(3, 5), 16), v = parseInt(n.slice(5, 7), 16)), `rgba(${l}, ${h}, ${v}, ${s})`;
|
|
759
759
|
}, Ct = (n) => {
|
|
760
760
|
var s;
|
|
761
|
-
if (n.id === _.value && ((s =
|
|
762
|
-
const l =
|
|
761
|
+
if (n.id === _.value && ((s = a.value) == null || s.setLabelStyle(n.color)), a.value) {
|
|
762
|
+
const l = a.value.getAnnotations();
|
|
763
763
|
let h = !1;
|
|
764
764
|
l.forEach((v) => {
|
|
765
765
|
v.label === n.name && (v.style || (v.style = {}), v.style.strokeColor = n.color, v.style.fillColor = wt(n.color, 0.2), h = !0);
|
|
766
|
-
}), h &&
|
|
766
|
+
}), h && a.value.render();
|
|
767
767
|
}
|
|
768
|
-
|
|
768
|
+
o("labelChange", m.value), E();
|
|
769
769
|
}, At = (n) => {
|
|
770
|
-
n.visible = !n.visible,
|
|
770
|
+
n.visible = !n.visible, E();
|
|
771
771
|
}, _t = (n) => {
|
|
772
772
|
const s = m.value.findIndex((l) => l.id === n);
|
|
773
|
-
s > -1 && (m.value.splice(s, 1),
|
|
773
|
+
s > -1 && (m.value.splice(s, 1), o("labelChange", m.value), _.value === n && (_.value = m.value.length > 0 ? m.value[0].id : "", _.value && G(m.value[0])), E());
|
|
774
774
|
};
|
|
775
|
-
|
|
775
|
+
Y(() => e.labels, (n) => {
|
|
776
776
|
const s = JSON.parse(JSON.stringify(n || []));
|
|
777
777
|
if (m.value = s, m.value.length > 0)
|
|
778
778
|
if (!_.value || !m.value.find((l) => l.id === _.value))
|
|
779
|
-
|
|
779
|
+
G(m.value[0]);
|
|
780
780
|
else {
|
|
781
781
|
const l = m.value.find((h) => h.id === _.value);
|
|
782
|
-
l &&
|
|
782
|
+
l && G(l);
|
|
783
783
|
}
|
|
784
784
|
else
|
|
785
785
|
_.value = "";
|
|
786
|
-
|
|
786
|
+
E();
|
|
787
787
|
}, { immediate: !0, deep: !0 });
|
|
788
788
|
const It = () => {
|
|
789
|
-
|
|
789
|
+
u.value > 0 && (ot(), u.value--, W(), at());
|
|
790
790
|
}, kt = () => {
|
|
791
|
-
|
|
791
|
+
u.value < e.batchImages.length - 1 && (ot(), u.value++, W(), at());
|
|
792
792
|
}, ot = () => {
|
|
793
|
-
if (
|
|
794
|
-
const n =
|
|
795
|
-
e.batchImages[
|
|
793
|
+
if (a.value) {
|
|
794
|
+
const n = a.value.getAnnotations();
|
|
795
|
+
e.batchImages[u.value].annotations = n;
|
|
796
796
|
}
|
|
797
797
|
}, at = () => {
|
|
798
|
-
const n = e.batchImages[
|
|
799
|
-
|
|
800
|
-
currentIndex:
|
|
798
|
+
const n = e.batchImages[u.value];
|
|
799
|
+
o("batchChange", {
|
|
800
|
+
currentIndex: u.value,
|
|
801
801
|
total: e.batchImages.length,
|
|
802
802
|
currentImageUrl: n.imageUrl,
|
|
803
803
|
currentAnnotations: n.annotations || []
|
|
804
804
|
});
|
|
805
|
-
},
|
|
805
|
+
}, ut = (n = []) => {
|
|
806
806
|
var v;
|
|
807
|
-
if (!
|
|
807
|
+
if (!a.value) return;
|
|
808
808
|
if (C.value = JSON.parse(JSON.stringify(n)), C.value.length === 0) {
|
|
809
809
|
I.value = "none";
|
|
810
810
|
return;
|
|
811
811
|
}
|
|
812
812
|
I.value = "loaded";
|
|
813
|
-
const l = (
|
|
813
|
+
const l = (a.value.getAnnotations() || []).filter((A) => !A.predictionId), h = C.value.map((A) => {
|
|
814
814
|
const $ = JSON.parse(JSON.stringify(A.annotation));
|
|
815
815
|
return $.id = $.id || `pred-${A.id}`, $.predictionId = A.id, $.modelRunId = A.modelRunId || $.modelRunId, $.confidence = A.confidence ?? $.confidence, $.reviewStatus = $.reviewStatus || "draft", $;
|
|
816
816
|
});
|
|
817
|
-
|
|
818
|
-
meta:
|
|
817
|
+
a.value.setAnnotations([...l, ...h]), o("prediction:loaded", {
|
|
818
|
+
meta: O(),
|
|
819
819
|
modelRunId: (v = C.value[0]) == null ? void 0 : v.modelRunId,
|
|
820
820
|
candidates: C.value
|
|
821
821
|
});
|
|
822
822
|
}, St = (n, s) => {
|
|
823
823
|
var v;
|
|
824
|
-
if (!
|
|
824
|
+
if (!a.value) return [];
|
|
825
825
|
I.value = "applying";
|
|
826
|
-
const h = (
|
|
826
|
+
const h = (a.value.getAnnotations() || []).filter((A) => A.predictionId && n.includes(A.predictionId));
|
|
827
827
|
return h.forEach((A) => {
|
|
828
828
|
A.reviewStatus = "accepted";
|
|
829
|
-
}), I.value = "applied",
|
|
830
|
-
meta:
|
|
829
|
+
}), I.value = "applied", o("prediction:apply", {
|
|
830
|
+
meta: O(),
|
|
831
831
|
modelRunId: (v = h[0]) == null ? void 0 : v.modelRunId,
|
|
832
832
|
candidateIds: n,
|
|
833
833
|
threshold: s,
|
|
834
834
|
acceptedAnnotations: h
|
|
835
|
-
}),
|
|
835
|
+
}), a.value.render(), h;
|
|
836
836
|
}, Mt = (n, s) => {
|
|
837
837
|
var v;
|
|
838
|
-
if (!
|
|
839
|
-
const l =
|
|
840
|
-
|
|
841
|
-
meta:
|
|
838
|
+
if (!a.value) return;
|
|
839
|
+
const l = a.value.getAnnotations() || [], h = l.filter((A) => !(A.predictionId && n.includes(A.predictionId)));
|
|
840
|
+
a.value.setAnnotations(h), o("prediction:reject", {
|
|
841
|
+
meta: O(),
|
|
842
842
|
modelRunId: (v = l.find((A) => A.predictionId && n.includes(A.predictionId))) == null ? void 0 : v.modelRunId,
|
|
843
843
|
candidateIds: n,
|
|
844
844
|
reason: s
|
|
845
845
|
});
|
|
846
846
|
}, zt = (n, s = []) => {
|
|
847
|
-
|
|
847
|
+
a.value && (a.value.loadImage(n.url), a.value.setAnnotations(s));
|
|
848
848
|
}, $t = (n) => {
|
|
849
849
|
var s;
|
|
850
|
-
(s =
|
|
851
|
-
},
|
|
850
|
+
(s = a.value) == null || s.setAnnotations(n);
|
|
851
|
+
}, vt = () => {
|
|
852
852
|
var n;
|
|
853
|
-
return ((n =
|
|
853
|
+
return ((n = a.value) == null ? void 0 : n.getAnnotations()) || [];
|
|
854
854
|
}, Tt = (n = "json") => {
|
|
855
855
|
var l, h;
|
|
856
|
-
const s =
|
|
856
|
+
const s = vt();
|
|
857
857
|
return {
|
|
858
858
|
format: n,
|
|
859
|
-
image: ((l = e.batchImages[
|
|
859
|
+
image: ((l = e.batchImages[u.value]) == null ? void 0 : l.imageUrl) || ((h = e.image) == null ? void 0 : h.url) || "",
|
|
860
860
|
annotations: s
|
|
861
861
|
};
|
|
862
|
-
},
|
|
863
|
-
n >= 0 && n < e.batchImages.length && (ot(),
|
|
862
|
+
}, mt = (n) => {
|
|
863
|
+
n >= 0 && n < e.batchImages.length && (ot(), u.value = n, W(), at());
|
|
864
864
|
}, Pt = (n) => {
|
|
865
865
|
var s;
|
|
866
|
-
return n ===
|
|
867
|
-
}, Ht = (n) => n.type === "rectangle", Lt = (n) => n.type === "polygon", Rt = (n) => n.type === "point", Bt = (n) => n.type === "rotatedRect",
|
|
866
|
+
return n === u.value && a.value ? a.value.getAnnotations() || [] : ((s = e.batchImages[n]) == null ? void 0 : s.annotations) || [];
|
|
867
|
+
}, Ht = (n) => n.type === "rectangle", Lt = (n) => n.type === "polygon", Rt = (n) => n.type === "point", Bt = (n) => n.type === "rotatedRect", Z = (n) => {
|
|
868
868
|
var l, h;
|
|
869
869
|
const s = (l = m.value.find((v) => v.name === n.label)) == null ? void 0 : l.color;
|
|
870
870
|
return ((h = n.style) == null ? void 0 : h.strokeColor) || s || "#409eff";
|
|
871
|
-
},
|
|
871
|
+
}, ft = (n) => {
|
|
872
872
|
const s = n.coordinates;
|
|
873
873
|
return (s == null ? void 0 : s.points) || [];
|
|
874
|
-
},
|
|
874
|
+
}, Q = (n) => {
|
|
875
875
|
const s = e.batchImages[n];
|
|
876
876
|
if (s != null && s.width && (s != null && s.height))
|
|
877
877
|
return { width: s.width, height: s.height };
|
|
878
878
|
const l = s != null && s.imageUrl ? R.value[s.imageUrl] : void 0;
|
|
879
|
-
return l || (s != null && s.imageUrl &&
|
|
879
|
+
return l || (s != null && s.imageUrl && j(s.imageUrl), { width: 1, height: 1 });
|
|
880
880
|
}, Dt = (n) => {
|
|
881
881
|
const s = e.batchImages[n];
|
|
882
882
|
return s != null && s.width && (s != null && s.height) ? !0 : s != null && s.imageUrl ? !!R.value[s.imageUrl] : !1;
|
|
883
883
|
}, Ut = (n, s) => {
|
|
884
|
-
const l = s.coordinates, h =
|
|
884
|
+
const l = s.coordinates, h = Q(n), v = Z(s), A = Math.min(l.x1, l.x2), $ = Math.min(l.y1, l.y2), Nt = Math.max(l.x1, l.x2), Wt = Math.max(l.y1, l.y2);
|
|
885
885
|
return {
|
|
886
886
|
left: `${A / h.width * 100}%`,
|
|
887
887
|
top: `${$ / h.height * 100}%`,
|
|
888
|
-
width: `${(
|
|
889
|
-
height: `${(
|
|
888
|
+
width: `${(Nt - A) / h.width * 100}%`,
|
|
889
|
+
height: `${(Wt - $) / h.height * 100}%`,
|
|
890
890
|
borderColor: v,
|
|
891
891
|
backgroundColor: `${v}22`
|
|
892
892
|
};
|
|
893
893
|
}, Ft = (n, s) => {
|
|
894
|
-
const l =
|
|
895
|
-
return
|
|
896
|
-
},
|
|
897
|
-
const s =
|
|
894
|
+
const l = Q(n);
|
|
895
|
+
return ft(s).map((h) => `${h.x / l.width * 100},${h.y / l.height * 100}`).join(" ");
|
|
896
|
+
}, Ot = (n) => {
|
|
897
|
+
const s = Z(n);
|
|
898
898
|
return {
|
|
899
899
|
fill: `${s}33`,
|
|
900
900
|
stroke: s,
|
|
901
901
|
strokeWidth: "1.4"
|
|
902
902
|
};
|
|
903
|
-
},
|
|
904
|
-
const h =
|
|
903
|
+
}, Et = (n, s, l) => {
|
|
904
|
+
const h = Q(n), v = Z(l);
|
|
905
905
|
return {
|
|
906
906
|
left: `${s.x / h.width * 100}%`,
|
|
907
907
|
top: `${s.y / h.height * 100}%`,
|
|
908
908
|
backgroundColor: v
|
|
909
909
|
};
|
|
910
910
|
}, Vt = (n, s) => {
|
|
911
|
-
const l = s.coordinates, h =
|
|
911
|
+
const l = s.coordinates, h = Q(n), v = Z(s), A = Math.abs(l.width), $ = Math.abs(l.height);
|
|
912
912
|
return {
|
|
913
913
|
left: `${(l.x - A / 2) / h.width * 100}%`,
|
|
914
914
|
top: `${(l.y - $ / 2) / h.height * 100}%`,
|
|
@@ -920,12 +920,12 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
920
920
|
};
|
|
921
921
|
};
|
|
922
922
|
return t({
|
|
923
|
-
jumpTo:
|
|
923
|
+
jumpTo: mt,
|
|
924
924
|
setImage: zt,
|
|
925
925
|
setAnnotations: $t,
|
|
926
|
-
getAnnotations:
|
|
927
|
-
selectTool:
|
|
928
|
-
loadPredictionCandidates:
|
|
926
|
+
getAnnotations: vt,
|
|
927
|
+
selectTool: p,
|
|
928
|
+
loadPredictionCandidates: ut,
|
|
929
929
|
applyPredictions: St,
|
|
930
930
|
rejectPredictions: Mt,
|
|
931
931
|
exportAnnotations: Tt,
|
|
@@ -933,40 +933,40 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
933
933
|
var n, s;
|
|
934
934
|
return e.batchImages.length > 0 ? e.batchImages : [{
|
|
935
935
|
imageUrl: ((n = e.image) == null ? void 0 : n.url) || "",
|
|
936
|
-
annotations: ((s =
|
|
936
|
+
annotations: ((s = a.value) == null ? void 0 : s.getAnnotations()) || []
|
|
937
937
|
}];
|
|
938
938
|
},
|
|
939
939
|
getCurrentAnnotation: () => {
|
|
940
940
|
var n, s, l;
|
|
941
941
|
return {
|
|
942
|
-
imageUrl: ((n = e.batchImages[
|
|
943
|
-
annotations: ((l =
|
|
942
|
+
imageUrl: ((n = e.batchImages[u.value]) == null ? void 0 : n.imageUrl) || ((s = e.image) == null ? void 0 : s.url) || "",
|
|
943
|
+
annotations: ((l = a.value) == null ? void 0 : l.getAnnotations()) || []
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
|
-
}),
|
|
946
|
+
}), Y(() => {
|
|
947
947
|
var n;
|
|
948
948
|
return (n = e.image) == null ? void 0 : n.url;
|
|
949
949
|
}, () => {
|
|
950
950
|
var n;
|
|
951
|
-
e.batchImages.length === 0 && ((n = e.image) != null && n.url) &&
|
|
952
|
-
}),
|
|
953
|
-
n &&
|
|
954
|
-
}, { immediate: !0, deep: !0 }),
|
|
951
|
+
e.batchImages.length === 0 && ((n = e.image) != null && n.url) && W();
|
|
952
|
+
}), Y(() => e.predictionCandidates, (n) => {
|
|
953
|
+
n && ut(n);
|
|
954
|
+
}, { immediate: !0, deep: !0 }), Y(
|
|
955
955
|
() => e.batchImages.map((n) => `${n.imageUrl}:${n.width || ""}x${n.height || ""}`),
|
|
956
956
|
() => {
|
|
957
|
-
|
|
957
|
+
X();
|
|
958
958
|
},
|
|
959
959
|
{ immediate: !0 }
|
|
960
|
-
), (n, s) => (y(),
|
|
961
|
-
class:
|
|
960
|
+
), (n, s) => (y(), x("div", {
|
|
961
|
+
class: J(["annotation-container", f.theme])
|
|
962
962
|
}, [
|
|
963
|
-
|
|
964
|
-
g("div", pe, "批量图片(" + P(
|
|
963
|
+
f.batchImages && f.batchImages.length > 0 ? (y(), x("div", ye, [
|
|
964
|
+
g("div", pe, "批量图片(" + P(f.batchImages.length) + ")", 1),
|
|
965
965
|
g("div", xe, [
|
|
966
|
-
(y(!0),
|
|
966
|
+
(y(!0), x(B, null, F(f.batchImages, (l, h) => (y(), x("button", {
|
|
967
967
|
key: `${l.imageUrl}-${h}`,
|
|
968
|
-
class:
|
|
969
|
-
onClick: (v) =>
|
|
968
|
+
class: J(["image-list-item", { active: h === u.value }]),
|
|
969
|
+
onClick: (v) => mt(h)
|
|
970
970
|
}, [
|
|
971
971
|
g("div", we, [
|
|
972
972
|
g("img", {
|
|
@@ -974,27 +974,27 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
974
974
|
alt: `第${h + 1}张`,
|
|
975
975
|
class: "image-list-thumb"
|
|
976
976
|
}, null, 8, Ce),
|
|
977
|
-
Dt(h) ? (y(),
|
|
978
|
-
(y(!0),
|
|
977
|
+
Dt(h) ? (y(), x("div", Ae, [
|
|
978
|
+
(y(!0), x(B, null, F(Pt(h), (v) => (y(), x(B, {
|
|
979
979
|
key: v.id
|
|
980
980
|
}, [
|
|
981
|
-
Ht(v) ? (y(),
|
|
981
|
+
Ht(v) ? (y(), x("div", {
|
|
982
982
|
key: 0,
|
|
983
983
|
class: "thumb-overlay-rect",
|
|
984
|
-
style:
|
|
985
|
-
}, null, 4)) : Lt(v) ? (y(),
|
|
984
|
+
style: V(Ut(h, v))
|
|
985
|
+
}, null, 4)) : Lt(v) ? (y(), x("svg", _e, [
|
|
986
986
|
g("polygon", {
|
|
987
987
|
points: Ft(h, v),
|
|
988
|
-
style:
|
|
988
|
+
style: V(Ot(v))
|
|
989
989
|
}, null, 12, Ie)
|
|
990
|
-
])) : Rt(v) ? (y(!0),
|
|
990
|
+
])) : Rt(v) ? (y(!0), x(B, { key: 2 }, F(ft(v), (A, $) => (y(), x("div", {
|
|
991
991
|
key: `${v.id}-${$}`,
|
|
992
992
|
class: "thumb-overlay-point",
|
|
993
|
-
style:
|
|
994
|
-
}, null, 4))), 128)) : Bt(v) ? (y(),
|
|
993
|
+
style: V(Et(h, A, v))
|
|
994
|
+
}, null, 4))), 128)) : Bt(v) ? (y(), x("div", {
|
|
995
995
|
key: 3,
|
|
996
996
|
class: "thumb-overlay-rotated",
|
|
997
|
-
style:
|
|
997
|
+
style: V(Vt(h, v))
|
|
998
998
|
}, null, 4)) : T("", !0)
|
|
999
999
|
], 64))), 128))
|
|
1000
1000
|
])) : T("", !0)
|
|
@@ -1003,26 +1003,26 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1003
1003
|
], 10, be))), 128))
|
|
1004
1004
|
])
|
|
1005
1005
|
])) : T("", !0),
|
|
1006
|
-
|
|
1006
|
+
f.readOnly ? T("", !0) : (y(), x("div", Se, [
|
|
1007
1007
|
g("div", {
|
|
1008
|
-
class:
|
|
1009
|
-
onClick: s[0] || (s[0] = (l) =>
|
|
1008
|
+
class: J(["tool-btn", { active: d.value === "pan" }]),
|
|
1009
|
+
onClick: s[0] || (s[0] = (l) => p("pan")),
|
|
1010
1010
|
title: "拖动"
|
|
1011
1011
|
}, [
|
|
1012
1012
|
L(H, { name: "rank" })
|
|
1013
1013
|
], 2),
|
|
1014
1014
|
g("div", {
|
|
1015
|
-
class:
|
|
1016
|
-
onClick: s[1] || (s[1] = (l) =>
|
|
1015
|
+
class: J(["tool-btn", { active: d.value === "select" }]),
|
|
1016
|
+
onClick: s[1] || (s[1] = (l) => p("select")),
|
|
1017
1017
|
title: "选择"
|
|
1018
1018
|
}, [
|
|
1019
1019
|
L(H, { name: "pointer" })
|
|
1020
1020
|
], 2),
|
|
1021
1021
|
s[5] || (s[5] = g("div", { class: "divider" }, null, -1)),
|
|
1022
|
-
(y(!0),
|
|
1022
|
+
(y(!0), x(B, null, F(nt.value, (l) => (y(), x("div", {
|
|
1023
1023
|
key: l,
|
|
1024
|
-
class:
|
|
1025
|
-
onClick: (h) =>
|
|
1024
|
+
class: J(["tool-btn", { active: d.value === l }]),
|
|
1025
|
+
onClick: (h) => p(l),
|
|
1026
1026
|
title: it(l)
|
|
1027
1027
|
}, [
|
|
1028
1028
|
L(H, {
|
|
@@ -1032,74 +1032,74 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1032
1032
|
s[6] || (s[6] = g("div", { class: "divider" }, null, -1)),
|
|
1033
1033
|
g("div", {
|
|
1034
1034
|
class: "tool-btn",
|
|
1035
|
-
onClick:
|
|
1035
|
+
onClick: q,
|
|
1036
1036
|
title: "放大"
|
|
1037
1037
|
}, [
|
|
1038
1038
|
L(H, { name: "zoom-in" })
|
|
1039
1039
|
]),
|
|
1040
1040
|
g("div", {
|
|
1041
1041
|
class: "tool-btn",
|
|
1042
|
-
onClick:
|
|
1042
|
+
onClick: dt,
|
|
1043
1043
|
title: "缩小"
|
|
1044
1044
|
}, [
|
|
1045
1045
|
L(H, { name: "zoom-out" })
|
|
1046
1046
|
]),
|
|
1047
1047
|
s[7] || (s[7] = g("div", { class: "divider" }, null, -1)),
|
|
1048
|
-
|
|
1048
|
+
N.value ? (y(), x("div", {
|
|
1049
1049
|
key: 0,
|
|
1050
1050
|
class: "tool-btn",
|
|
1051
|
-
onClick:
|
|
1051
|
+
onClick: b,
|
|
1052
1052
|
title: "删除选中"
|
|
1053
1053
|
}, [
|
|
1054
1054
|
L(H, { name: "delete" })
|
|
1055
1055
|
])) : T("", !0)
|
|
1056
1056
|
])),
|
|
1057
1057
|
g("div", ze, [
|
|
1058
|
-
|
|
1058
|
+
f.readOnly ? T("", !0) : (y(), x("div", $e, [
|
|
1059
1059
|
g("div", Te, [
|
|
1060
1060
|
s[8] || (s[8] = g("span", { class: "label-text" }, "当前标签:", -1)),
|
|
1061
1061
|
g("div", Pe, [
|
|
1062
|
-
(y(!0),
|
|
1062
|
+
(y(!0), x(B, null, F(m.value, (l) => (y(), x("div", {
|
|
1063
1063
|
key: l.id,
|
|
1064
|
-
class:
|
|
1065
|
-
style:
|
|
1066
|
-
onClick: (h) =>
|
|
1064
|
+
class: J(["tag-chip", { active: _.value === l.id }]),
|
|
1065
|
+
style: V({ backgroundColor: l.color, borderColor: l.color }),
|
|
1066
|
+
onClick: (h) => G(l)
|
|
1067
1067
|
}, P(l.name), 15, He))), 128)),
|
|
1068
|
-
m.value.length === 0 ? (y(),
|
|
1068
|
+
m.value.length === 0 ? (y(), x("div", Le, "请在右侧创建标签")) : T("", !0)
|
|
1069
1069
|
])
|
|
1070
1070
|
])
|
|
1071
1071
|
])),
|
|
1072
1072
|
g("div", {
|
|
1073
1073
|
class: "canvas-wrapper",
|
|
1074
1074
|
ref_key: "canvasWrapper",
|
|
1075
|
-
ref:
|
|
1075
|
+
ref: r,
|
|
1076
1076
|
onWheel: s[2] || (s[2] = qt(() => {
|
|
1077
1077
|
}, ["prevent"]))
|
|
1078
1078
|
}, [
|
|
1079
1079
|
g("canvas", {
|
|
1080
1080
|
ref_key: "canvasRef",
|
|
1081
|
-
ref:
|
|
1081
|
+
ref: c
|
|
1082
1082
|
}, null, 512)
|
|
1083
1083
|
], 544),
|
|
1084
|
-
|
|
1084
|
+
f.batchImages && f.batchImages.length > 0 ? (y(), x("div", Re, [
|
|
1085
1085
|
g("button", {
|
|
1086
1086
|
onClick: It,
|
|
1087
|
-
disabled:
|
|
1087
|
+
disabled: u.value <= 0
|
|
1088
1088
|
}, [
|
|
1089
1089
|
L(H, { name: "back" }),
|
|
1090
|
-
s[9] || (s[9] =
|
|
1090
|
+
s[9] || (s[9] = K(" 上一张 ", -1))
|
|
1091
1091
|
], 8, Be),
|
|
1092
|
-
g("span", null, P(
|
|
1092
|
+
g("span", null, P(u.value + 1) + " / " + P(f.batchImages.length), 1),
|
|
1093
1093
|
g("button", {
|
|
1094
1094
|
onClick: kt,
|
|
1095
|
-
disabled:
|
|
1095
|
+
disabled: u.value >= f.batchImages.length - 1
|
|
1096
1096
|
}, [
|
|
1097
|
-
s[10] || (s[10] =
|
|
1097
|
+
s[10] || (s[10] = K(" 下一张 ", -1)),
|
|
1098
1098
|
L(H, { name: "right" })
|
|
1099
1099
|
], 8, De)
|
|
1100
1100
|
])) : T("", !0)
|
|
1101
1101
|
]),
|
|
1102
|
-
|
|
1102
|
+
f.readOnly ? T("", !0) : (y(), x("div", Ue, [
|
|
1103
1103
|
g("div", { class: "sidebar-header" }, [
|
|
1104
1104
|
s[11] || (s[11] = g("h3", null, "标签管理", -1)),
|
|
1105
1105
|
g("button", {
|
|
@@ -1108,21 +1108,21 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1108
1108
|
}, "添加标签")
|
|
1109
1109
|
]),
|
|
1110
1110
|
g("div", Fe, [
|
|
1111
|
-
(y(!0),
|
|
1111
|
+
(y(!0), x(B, null, F(m.value, (l) => (y(), x("div", {
|
|
1112
1112
|
key: l.id,
|
|
1113
1113
|
class: "label-item"
|
|
1114
1114
|
}, [
|
|
1115
|
-
g("div",
|
|
1115
|
+
g("div", Oe, [
|
|
1116
1116
|
g("label", {
|
|
1117
1117
|
class: "color-wrapper",
|
|
1118
|
-
style:
|
|
1118
|
+
style: V({ backgroundColor: l.color })
|
|
1119
1119
|
}, [
|
|
1120
1120
|
lt(g("input", {
|
|
1121
1121
|
type: "color",
|
|
1122
1122
|
"onUpdate:modelValue": (h) => l.color = h,
|
|
1123
1123
|
onChange: (h) => Ct(l),
|
|
1124
1124
|
style: { visibility: "hidden", width: "0", height: "0" }
|
|
1125
|
-
}, null, 40,
|
|
1125
|
+
}, null, 40, Ee), [
|
|
1126
1126
|
[rt, l.color]
|
|
1127
1127
|
])
|
|
1128
1128
|
], 4),
|
|
@@ -1134,15 +1134,15 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1134
1134
|
class: "action-icon eye",
|
|
1135
1135
|
onClick: (h) => At(l)
|
|
1136
1136
|
}, [
|
|
1137
|
-
l.visible ? (y(),
|
|
1137
|
+
l.visible ? (y(), yt(H, {
|
|
1138
1138
|
key: 0,
|
|
1139
1139
|
name: "view"
|
|
1140
|
-
})) : (y(),
|
|
1140
|
+
})) : (y(), yt(H, {
|
|
1141
1141
|
key: 1,
|
|
1142
1142
|
name: "hide"
|
|
1143
1143
|
}))
|
|
1144
|
-
], 8,
|
|
1145
|
-
g("div",
|
|
1144
|
+
], 8, Ne),
|
|
1145
|
+
g("div", We, [
|
|
1146
1146
|
s[12] || (s[12] = g("span", { class: "dots" }, "•••", -1)),
|
|
1147
1147
|
g("span", {
|
|
1148
1148
|
class: "delete-btn",
|
|
@@ -1156,7 +1156,7 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1156
1156
|
]))), 128))
|
|
1157
1157
|
])
|
|
1158
1158
|
])),
|
|
1159
|
-
|
|
1159
|
+
U.value ? (y(), x("div", je, [
|
|
1160
1160
|
g("div", Ye, [
|
|
1161
1161
|
s[15] || (s[15] = g("h3", null, "新增标签", -1)),
|
|
1162
1162
|
g("div", Xe, [
|
|
@@ -1184,7 +1184,7 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1184
1184
|
]),
|
|
1185
1185
|
g("div", { class: "modal-actions" }, [
|
|
1186
1186
|
g("button", {
|
|
1187
|
-
onClick:
|
|
1187
|
+
onClick: gt,
|
|
1188
1188
|
class: "cancel-btn"
|
|
1189
1189
|
}, "取消"),
|
|
1190
1190
|
g("button", {
|
|
@@ -1196,13 +1196,13 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1196
1196
|
])) : T("", !0)
|
|
1197
1197
|
], 2));
|
|
1198
1198
|
}
|
|
1199
|
-
}), Ze = /* @__PURE__ */
|
|
1199
|
+
}), Ze = /* @__PURE__ */ et(Ke, [["__scopeId", "data-v-ccc538f3"]]), Qe = {
|
|
1200
1200
|
class: "thumbnail-wrapper",
|
|
1201
1201
|
ref: "wrapper"
|
|
1202
1202
|
}, tn = ["src", "alt"], en = ["viewBox", "preserveAspectRatio"], nn = ["x", "y", "width", "height", "stroke", "stroke-width"], sn = ["points", "stroke", "stroke-width"], on = ["x", "y", "fill", "font-size"], an = {
|
|
1203
1203
|
key: 1,
|
|
1204
1204
|
class: "loading-placeholder"
|
|
1205
|
-
}, ln = /* @__PURE__ */
|
|
1205
|
+
}, ln = /* @__PURE__ */ tt({
|
|
1206
1206
|
__name: "AnnotationThumbnail",
|
|
1207
1207
|
props: {
|
|
1208
1208
|
src: {},
|
|
@@ -1213,10 +1213,10 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1213
1213
|
strokeWidth: {},
|
|
1214
1214
|
fontSize: {}
|
|
1215
1215
|
},
|
|
1216
|
-
setup(
|
|
1217
|
-
const t =
|
|
1218
|
-
i.value && (
|
|
1219
|
-
},
|
|
1216
|
+
setup(f) {
|
|
1217
|
+
const t = f, i = M(null), e = M(!1), o = M(0), c = M(0), r = () => {
|
|
1218
|
+
i.value && (o.value = i.value.naturalWidth, c.value = i.value.naturalHeight, e.value = !0);
|
|
1219
|
+
}, a = D(() => t.fit === "contain" ? "xMidYMid meet" : "xMidYMid slice"), d = D(() => t.strokeWidth ?? 10), u = D(() => t.fontSize ?? 30), w = (k) => {
|
|
1220
1220
|
var I;
|
|
1221
1221
|
if ((I = k.style) != null && I.strokeColor) return k.style.strokeColor;
|
|
1222
1222
|
if (t.labels) {
|
|
@@ -1225,9 +1225,9 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1225
1225
|
}
|
|
1226
1226
|
return "#FF0000";
|
|
1227
1227
|
}, m = (k) => {
|
|
1228
|
-
const I = k.coordinates, C = Math.min(I.x1, I.x2), R = Math.min(I.y1, I.y2),
|
|
1229
|
-
return { x: C, y: R, width:
|
|
1230
|
-
}, _ = (k) => k.coordinates.points.map((C) => `${C.x},${C.y}`).join(" "),
|
|
1228
|
+
const I = k.coordinates, C = Math.min(I.x1, I.x2), R = Math.min(I.y1, I.y2), N = Math.abs(I.x1 - I.x2), j = Math.abs(I.y1 - I.y2);
|
|
1229
|
+
return { x: C, y: R, width: N, height: j };
|
|
1230
|
+
}, _ = (k) => k.coordinates.points.map((C) => `${C.x},${C.y}`).join(" "), U = (k) => {
|
|
1231
1231
|
if (k.type === "rectangle") {
|
|
1232
1232
|
const I = m(k);
|
|
1233
1233
|
return { x: I.x, y: I.y - 5 };
|
|
@@ -1237,26 +1237,26 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1237
1237
|
}
|
|
1238
1238
|
return { x: 0, y: 0 };
|
|
1239
1239
|
};
|
|
1240
|
-
return (k, I) => (y(),
|
|
1240
|
+
return (k, I) => (y(), x("div", Qe, [
|
|
1241
1241
|
g("img", {
|
|
1242
1242
|
ref_key: "img",
|
|
1243
1243
|
ref: i,
|
|
1244
|
-
src:
|
|
1244
|
+
src: f.src,
|
|
1245
1245
|
class: "thumbnail-image",
|
|
1246
|
-
style:
|
|
1247
|
-
onLoad:
|
|
1248
|
-
alt:
|
|
1246
|
+
style: V({ objectFit: f.fit }),
|
|
1247
|
+
onLoad: r,
|
|
1248
|
+
alt: f.alt
|
|
1249
1249
|
}, null, 44, tn),
|
|
1250
|
-
e.value ? (y(),
|
|
1250
|
+
e.value ? (y(), x("svg", {
|
|
1251
1251
|
key: 0,
|
|
1252
1252
|
class: "annotation-overlay",
|
|
1253
|
-
viewBox: `0 0 ${
|
|
1254
|
-
preserveAspectRatio:
|
|
1253
|
+
viewBox: `0 0 ${o.value} ${c.value}`,
|
|
1254
|
+
preserveAspectRatio: a.value
|
|
1255
1255
|
}, [
|
|
1256
|
-
(y(!0),
|
|
1256
|
+
(y(!0), x(B, null, F(f.annotations, (C) => (y(), x(B, {
|
|
1257
1257
|
key: C.id
|
|
1258
1258
|
}, [
|
|
1259
|
-
C.type === "rectangle" ? (y(),
|
|
1259
|
+
C.type === "rectangle" ? (y(), x("rect", {
|
|
1260
1260
|
key: 0,
|
|
1261
1261
|
x: m(C).x,
|
|
1262
1262
|
y: m(C).y,
|
|
@@ -1266,27 +1266,27 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1266
1266
|
"stroke-width": d.value,
|
|
1267
1267
|
fill: "transparent"
|
|
1268
1268
|
}, null, 8, nn)) : T("", !0),
|
|
1269
|
-
C.type === "polygon" ? (y(),
|
|
1269
|
+
C.type === "polygon" ? (y(), x("polygon", {
|
|
1270
1270
|
key: 1,
|
|
1271
1271
|
points: _(C),
|
|
1272
1272
|
stroke: w(C),
|
|
1273
1273
|
"stroke-width": d.value,
|
|
1274
1274
|
fill: "transparent"
|
|
1275
1275
|
}, null, 8, sn)) : T("", !0),
|
|
1276
|
-
C.label ? (y(),
|
|
1276
|
+
C.label ? (y(), x("text", {
|
|
1277
1277
|
key: 2,
|
|
1278
|
-
x:
|
|
1279
|
-
y:
|
|
1278
|
+
x: U(C).x,
|
|
1279
|
+
y: U(C).y,
|
|
1280
1280
|
fill: w(C),
|
|
1281
|
-
"font-size":
|
|
1281
|
+
"font-size": u.value,
|
|
1282
1282
|
"font-weight": "bold",
|
|
1283
1283
|
class: "anno-label"
|
|
1284
1284
|
}, P(C.label), 9, on)) : T("", !0)
|
|
1285
1285
|
], 64))), 128))
|
|
1286
|
-
], 8, en)) : (y(),
|
|
1286
|
+
], 8, en)) : (y(), x("div", an, "Loading..."))
|
|
1287
1287
|
], 512));
|
|
1288
1288
|
}
|
|
1289
|
-
}), rn = /* @__PURE__ */
|
|
1289
|
+
}), rn = /* @__PURE__ */ et(ln, [["__scopeId", "data-v-d2fd08ec"]]), cn = {
|
|
1290
1290
|
key: 0,
|
|
1291
1291
|
class: "gallery-view"
|
|
1292
1292
|
}, hn = { class: "gallery-header" }, dn = { class: "label-summary" }, gn = ["onClick"], un = { class: "thumbnail-wrapper" }, vn = { class: "img-meta" }, mn = { class: "img-index" }, fn = { class: "anno-count" }, yn = {
|
|
@@ -1295,7 +1295,7 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1295
1295
|
}, pn = {
|
|
1296
1296
|
key: 1,
|
|
1297
1297
|
class: "editor-view"
|
|
1298
|
-
}, xn = { class: "editor-header" }, bn = { class: "header-left" }, wn = { class: "editor-title" }, Cn = { class: "editor-content" }, An = /* @__PURE__ */
|
|
1298
|
+
}, xn = { class: "editor-header" }, bn = { class: "header-left" }, wn = { class: "editor-title" }, Cn = { class: "editor-content" }, An = /* @__PURE__ */ tt({
|
|
1299
1299
|
__name: "BatchAnnotator",
|
|
1300
1300
|
props: {
|
|
1301
1301
|
images: {},
|
|
@@ -1305,157 +1305,164 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
|
|
|
1305
1305
|
thumbStrokeWidth: {},
|
|
1306
1306
|
thumbFontSize: {}
|
|
1307
1307
|
},
|
|
1308
|
-
emits: ["export", "update:images", "imageClick"],
|
|
1309
|
-
setup(
|
|
1310
|
-
const e =
|
|
1311
|
-
var
|
|
1312
|
-
return ((b = (
|
|
1313
|
-
}),
|
|
1314
|
-
var
|
|
1315
|
-
return ((b = (
|
|
1316
|
-
}),
|
|
1317
|
-
var
|
|
1318
|
-
return ((b = (
|
|
1319
|
-
}),
|
|
1320
|
-
var
|
|
1321
|
-
return ((b = (
|
|
1322
|
-
}),
|
|
1323
|
-
|
|
1324
|
-
|
|
1308
|
+
emits: ["export", "update:images", "imageClick", "update:labels"],
|
|
1309
|
+
setup(f, { expose: t, emit: i }) {
|
|
1310
|
+
const e = f, o = i, c = M("gallery"), r = M([]), a = M([]), d = M(0), u = M(null), w = M(null), m = M(null), _ = D(() => {
|
|
1311
|
+
var p, b;
|
|
1312
|
+
return ((b = (p = e.actionBar) == null ? void 0 : p.annotateButton) == null ? void 0 : b.show) === !0;
|
|
1313
|
+
}), U = D(() => {
|
|
1314
|
+
var p, b;
|
|
1315
|
+
return ((b = (p = e.actionBar) == null ? void 0 : p.exportButton) == null ? void 0 : b.show) === !0;
|
|
1316
|
+
}), k = D(() => _.value || U.value), I = D(() => {
|
|
1317
|
+
var p, b;
|
|
1318
|
+
return ((b = (p = e.actionBar) == null ? void 0 : p.annotateButton) == null ? void 0 : b.text) || "手动标注";
|
|
1319
|
+
}), C = D(() => {
|
|
1320
|
+
var p, b;
|
|
1321
|
+
return ((b = (p = e.actionBar) == null ? void 0 : p.exportButton) == null ? void 0 : b.text) || "导出";
|
|
1322
|
+
}), R = D(() => e.clickToEnterEditor !== !1);
|
|
1323
|
+
Y(() => e.images, (p) => {
|
|
1324
|
+
r.value = JSON.parse(JSON.stringify(p));
|
|
1325
|
+
}, { immediate: !0, deep: !0 }), Y(() => e.labels, (p) => {
|
|
1326
|
+
a.value = JSON.parse(JSON.stringify(p || []));
|
|
1325
1327
|
}, { immediate: !0, deep: !0 });
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1328
|
-
|
|
1328
|
+
const N = (p) => {
|
|
1329
|
+
d.value = p, c.value = "editor", m.value && (m.value.scrollTop = 0), Gt(() => {
|
|
1330
|
+
w.value && (w.value.scrollTop = 0), window.scrollTo(0, 0), requestAnimationFrame(() => {
|
|
1329
1331
|
var b, z;
|
|
1330
|
-
(z = (b =
|
|
1332
|
+
(z = (b = u.value) == null ? void 0 : b.jumpTo) == null || z.call(b, p);
|
|
1331
1333
|
});
|
|
1332
1334
|
});
|
|
1333
|
-
}, j = (
|
|
1334
|
-
if (
|
|
1335
|
-
|
|
1335
|
+
}, j = (p, b) => {
|
|
1336
|
+
if (R.value) {
|
|
1337
|
+
N(p);
|
|
1336
1338
|
return;
|
|
1337
1339
|
}
|
|
1338
|
-
|
|
1339
|
-
},
|
|
1340
|
+
o("imageClick", { index: p, imageId: b.id, image: b });
|
|
1341
|
+
}, X = (p) => r.value.findIndex((b) => b.id === p);
|
|
1340
1342
|
t({
|
|
1341
|
-
openImageById: (
|
|
1342
|
-
const b =
|
|
1343
|
-
return b < 0 ? !1 : (
|
|
1343
|
+
openImageById: (p) => {
|
|
1344
|
+
const b = X(p);
|
|
1345
|
+
return b < 0 ? !1 : (N(b), !0);
|
|
1344
1346
|
},
|
|
1345
|
-
triggerImageClickById: (
|
|
1346
|
-
const b =
|
|
1347
|
+
triggerImageClickById: (p) => {
|
|
1348
|
+
const b = X(p);
|
|
1347
1349
|
if (b < 0)
|
|
1348
1350
|
return !1;
|
|
1349
|
-
const z =
|
|
1350
|
-
return z ? (
|
|
1351
|
-
}
|
|
1351
|
+
const z = r.value[b];
|
|
1352
|
+
return z ? (o("imageClick", { index: b, imageId: z.id, image: z }), !0) : !1;
|
|
1353
|
+
},
|
|
1354
|
+
getFinalData: () => ({
|
|
1355
|
+
images: JSON.parse(JSON.stringify(r.value)),
|
|
1356
|
+
labels: JSON.parse(JSON.stringify(a.value))
|
|
1357
|
+
})
|
|
1352
1358
|
});
|
|
1353
|
-
const
|
|
1354
|
-
if (
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1359
|
+
const nt = () => {
|
|
1360
|
+
if (u.value && u.value.getCurrentAnnotation) {
|
|
1361
|
+
const p = u.value.getCurrentAnnotation();
|
|
1362
|
+
r.value[d.value] && (r.value[d.value].annotations = p.annotations);
|
|
1357
1363
|
}
|
|
1358
|
-
|
|
1359
|
-
},
|
|
1360
|
-
|
|
1361
|
-
},
|
|
1362
|
-
|
|
1363
|
-
},
|
|
1364
|
-
if (
|
|
1365
|
-
const b =
|
|
1366
|
-
|
|
1364
|
+
c.value = "gallery";
|
|
1365
|
+
}, st = () => {
|
|
1366
|
+
o("export", r.value);
|
|
1367
|
+
}, it = (p) => {
|
|
1368
|
+
d.value = p.currentIndex, r.value[p.currentIndex] && (r.value[p.currentIndex].annotations = p.currentAnnotations);
|
|
1369
|
+
}, E = (p) => {
|
|
1370
|
+
if (u.value && u.value.getCurrentAnnotation) {
|
|
1371
|
+
const b = u.value.getCurrentAnnotation();
|
|
1372
|
+
r.value[d.value] && (r.value[d.value].annotations = b.annotations, o("update:images", r.value));
|
|
1367
1373
|
}
|
|
1368
|
-
},
|
|
1374
|
+
}, W = (p) => {
|
|
1375
|
+
a.value = JSON.parse(JSON.stringify(p || [])), o("update:labels", a.value);
|
|
1369
1376
|
};
|
|
1370
|
-
return (
|
|
1377
|
+
return (p, b) => (y(), x("div", {
|
|
1371
1378
|
ref_key: "batchRootRef",
|
|
1372
|
-
ref:
|
|
1379
|
+
ref: w,
|
|
1373
1380
|
class: "batch-annotator"
|
|
1374
1381
|
}, [
|
|
1375
|
-
|
|
1382
|
+
c.value === "gallery" ? (y(), x("div", cn, [
|
|
1376
1383
|
g("div", hn, [
|
|
1377
|
-
g("h3", null, "批量查看与标注 (" + P(
|
|
1384
|
+
g("h3", null, "批量查看与标注 (" + P(r.value.length) + " 张)", 1),
|
|
1378
1385
|
g("div", dn, [
|
|
1379
|
-
(y(!0),
|
|
1386
|
+
(y(!0), x(B, null, F(a.value, (z) => (y(), x("span", {
|
|
1380
1387
|
key: z.id,
|
|
1381
1388
|
class: "label-badge",
|
|
1382
|
-
style:
|
|
1389
|
+
style: V({ backgroundColor: z.color })
|
|
1383
1390
|
}, P(z.name), 5))), 128))
|
|
1384
1391
|
])
|
|
1385
1392
|
]),
|
|
1386
1393
|
g("div", {
|
|
1387
1394
|
ref_key: "galleryGridRef",
|
|
1388
|
-
ref:
|
|
1395
|
+
ref: m,
|
|
1389
1396
|
class: "gallery-grid"
|
|
1390
1397
|
}, [
|
|
1391
|
-
(y(!0),
|
|
1392
|
-
key:
|
|
1398
|
+
(y(!0), x(B, null, F(r.value, (z, q) => (y(), x("div", {
|
|
1399
|
+
key: q,
|
|
1393
1400
|
class: "gallery-item",
|
|
1394
|
-
onClick: (
|
|
1401
|
+
onClick: (dt) => j(q, z)
|
|
1395
1402
|
}, [
|
|
1396
1403
|
g("div", un, [
|
|
1397
1404
|
L(rn, {
|
|
1398
1405
|
src: z.imageUrl,
|
|
1399
1406
|
annotations: z.annotations || [],
|
|
1400
|
-
labels:
|
|
1407
|
+
labels: a.value,
|
|
1401
1408
|
fit: "cover",
|
|
1402
1409
|
strokeWidth: e.thumbStrokeWidth,
|
|
1403
1410
|
fontSize: e.thumbFontSize
|
|
1404
1411
|
}, null, 8, ["src", "annotations", "labels", "strokeWidth", "fontSize"])
|
|
1405
1412
|
]),
|
|
1406
1413
|
g("div", vn, [
|
|
1407
|
-
g("span", mn, "#" + P(
|
|
1414
|
+
g("span", mn, "#" + P(q + 1), 1),
|
|
1408
1415
|
g("span", fn, P((z.annotations || []).length) + " 标注", 1)
|
|
1409
1416
|
])
|
|
1410
1417
|
], 8, gn))), 128))
|
|
1411
1418
|
], 512),
|
|
1412
|
-
|
|
1413
|
-
|
|
1419
|
+
k.value ? (y(), x("div", yn, [
|
|
1420
|
+
_.value ? (y(), x("button", {
|
|
1414
1421
|
key: 0,
|
|
1415
1422
|
class: "action-btn primary",
|
|
1416
|
-
onClick: b[0] || (b[0] = (z) =>
|
|
1423
|
+
onClick: b[0] || (b[0] = (z) => N(0))
|
|
1417
1424
|
}, [
|
|
1418
1425
|
L(H, { name: "edit" }),
|
|
1419
|
-
|
|
1426
|
+
K(" " + P(I.value), 1)
|
|
1420
1427
|
])) : T("", !0),
|
|
1421
|
-
|
|
1428
|
+
U.value ? (y(), x("button", {
|
|
1422
1429
|
key: 1,
|
|
1423
1430
|
class: "action-btn success",
|
|
1424
|
-
onClick:
|
|
1431
|
+
onClick: st
|
|
1425
1432
|
}, [
|
|
1426
1433
|
L(H, { name: "download" }),
|
|
1427
|
-
|
|
1434
|
+
K(" " + P(C.value), 1)
|
|
1428
1435
|
])) : T("", !0)
|
|
1429
1436
|
])) : T("", !0)
|
|
1430
|
-
])) : (y(),
|
|
1437
|
+
])) : (y(), x("div", pn, [
|
|
1431
1438
|
g("div", xn, [
|
|
1432
1439
|
g("div", bn, [
|
|
1433
1440
|
g("button", {
|
|
1434
1441
|
class: "back-btn",
|
|
1435
|
-
onClick:
|
|
1442
|
+
onClick: nt
|
|
1436
1443
|
}, [
|
|
1437
1444
|
L(H, { name: "back" }),
|
|
1438
|
-
b[1] || (b[1] =
|
|
1445
|
+
b[1] || (b[1] = K(" 返回列表 ", -1))
|
|
1439
1446
|
]),
|
|
1440
|
-
g("span", wn, "正在标注: " + P(
|
|
1447
|
+
g("span", wn, "正在标注: " + P(d.value + 1) + " / " + P(r.value.length), 1)
|
|
1441
1448
|
])
|
|
1442
1449
|
]),
|
|
1443
1450
|
g("div", Cn, [
|
|
1444
1451
|
L(Ze, {
|
|
1445
1452
|
ref_key: "annotatorRef",
|
|
1446
|
-
ref:
|
|
1447
|
-
batchImages:
|
|
1448
|
-
labels:
|
|
1453
|
+
ref: u,
|
|
1454
|
+
batchImages: r.value,
|
|
1455
|
+
labels: a.value,
|
|
1449
1456
|
annotationTypes: ["rectangle", "polygon", "point", "rotatedRect"],
|
|
1450
|
-
onBatchChange:
|
|
1451
|
-
onAnnotationChange:
|
|
1452
|
-
onLabelChange:
|
|
1457
|
+
onBatchChange: it,
|
|
1458
|
+
onAnnotationChange: E,
|
|
1459
|
+
onLabelChange: W
|
|
1453
1460
|
}, null, 8, ["batchImages", "labels"])
|
|
1454
1461
|
])
|
|
1455
1462
|
]))
|
|
1456
1463
|
], 512));
|
|
1457
1464
|
}
|
|
1458
|
-
}), kn = /* @__PURE__ */
|
|
1465
|
+
}), kn = /* @__PURE__ */ et(An, [["__scopeId", "data-v-0ae1040a"]]);
|
|
1459
1466
|
export {
|
|
1460
1467
|
kn as BatchAnnotator,
|
|
1461
1468
|
Ze as ImageAnnotator,
|