Compare commits

...

2 Commits

Author SHA1 Message Date
andrew.ng 6ef757e8a2 Merge pull request 'Update index.js' (#7) from that into main
Reviewed-on: #7
2025-03-13 19:22:26 +11:00
nguentrungthat 911c4d590c Update index.js 2025-03-13 15:21:52 +07:00
1 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,8 @@ export const generateImageUrl = (image_path) => {
export function convertToBoundingBox(points) {
return {
label: points[0].label,
subLabel: points[0].subLabel || "",
label: (points[0].subLabel || "") + "." + points[0].label,
x1: Math.min(...points.map((p) => p.x)),
x2: Math.max(...points.map((p) => p.x)),
y1: Math.min(...points.map((p) => p.y)),