Quazim0t0 commited on
Commit
974ac1d
·
verified ·
1 Parent(s): 64d8c3f

Upload 37 files

Browse files
Files changed (1) hide show
  1. src/components/BoxAnnotator.ts +1 -0
src/components/BoxAnnotator.ts CHANGED
@@ -31,6 +31,7 @@ export function drawBoundingBoxesOnCanvas(
31
  boxes: { bbox_2d: number[]; label?: string }[],
32
  options?: { color?: string; lineWidth?: number; font?: string }
33
  ) {
 
34
  const color = options?.color || "#00FF00";
35
  const lineWidth = options?.lineWidth || 2;
36
  const font = options?.font || "16px Arial";
 
31
  boxes: { bbox_2d: number[]; label?: string }[],
32
  options?: { color?: string; lineWidth?: number; font?: string }
33
  ) {
34
+ if (!Array.isArray(boxes)) return; // Prevent errors if boxes is undefined/null
35
  const color = options?.color || "#00FF00";
36
  const lineWidth = options?.lineWidth || 2;
37
  const font = options?.font || "16px Arial";