Spaces:
Running
Running
Upload 2 files
Browse files- index.html +18 -10
index.html
CHANGED
|
@@ -846,6 +846,10 @@
|
|
| 846 |
return Number.isFinite(value) ? value.toFixed(6) : "0.000000";
|
| 847 |
}
|
| 848 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 849 |
function resultLines(box) {
|
| 850 |
if (!box || !state.image) {
|
| 851 |
return null;
|
|
@@ -861,16 +865,20 @@
|
|
| 861 |
const ih = imageHeight();
|
| 862 |
|
| 863 |
return {
|
| 864 |
-
absolute:
|
| 865 |
-
size:
|
| 866 |
-
relative: [
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 874 |
};
|
| 875 |
}
|
| 876 |
|
|
|
|
| 846 |
return Number.isFinite(value) ? value.toFixed(6) : "0.000000";
|
| 847 |
}
|
| 848 |
|
| 849 |
+
function formatList(values) {
|
| 850 |
+
return `[${values.join(",")}]`;
|
| 851 |
+
}
|
| 852 |
+
|
| 853 |
function resultLines(box) {
|
| 854 |
if (!box || !state.image) {
|
| 855 |
return null;
|
|
|
|
| 865 |
const ih = imageHeight();
|
| 866 |
|
| 867 |
return {
|
| 868 |
+
absolute: formatList([x1, y1, x2, y2]),
|
| 869 |
+
size: formatList([box.x, box.y, box.width, box.height]),
|
| 870 |
+
relative: formatList([
|
| 871 |
+
formatRatio(x1 / iw),
|
| 872 |
+
formatRatio(y1 / ih),
|
| 873 |
+
formatRatio(x2 / iw),
|
| 874 |
+
formatRatio(y2 / ih)
|
| 875 |
+
]),
|
| 876 |
+
yolo: formatList([
|
| 877 |
+
formatRatio(cx / iw),
|
| 878 |
+
formatRatio(cy / ih),
|
| 879 |
+
formatRatio(box.width / iw),
|
| 880 |
+
formatRatio(box.height / ih)
|
| 881 |
+
])
|
| 882 |
};
|
| 883 |
}
|
| 884 |
|