@jax-data-science/sci-image-visualizer 0.2.13 → 0.2.14
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.
|
@@ -1029,9 +1029,14 @@ class YoloDetectToolService {
|
|
|
1029
1029
|
if (!ctx)
|
|
1030
1030
|
return null;
|
|
1031
1031
|
ctx.drawImage(bitmap, 0, 0);
|
|
1032
|
-
|
|
1032
|
+
// Read the dimensions BEFORE close(): closing an ImageBitmap zeroes its
|
|
1033
|
+
// width/height, so returning them afterwards yields a 0x0 image with a
|
|
1034
|
+
// full pixel buffer — inference then runs on nothing and finds nothing.
|
|
1035
|
+
const width = bitmap.width;
|
|
1036
|
+
const height = bitmap.height;
|
|
1037
|
+
const out = ctx.getImageData(0, 0, width, height);
|
|
1033
1038
|
bitmap.close?.();
|
|
1034
|
-
return { data: out.data, width
|
|
1039
|
+
return { data: out.data, width, height };
|
|
1035
1040
|
}
|
|
1036
1041
|
catch {
|
|
1037
1042
|
return null;
|
|
@@ -8369,6 +8374,9 @@ class VisualizerComponent {
|
|
|
8369
8374
|
mergeThreshold: def?.defaults.mergeThreshold ?? 0.3,
|
|
8370
8375
|
overlapX: def?.defaults.overlapX ?? 0,
|
|
8371
8376
|
overlapY: def?.defaults.overlapY ?? 0,
|
|
8377
|
+
// Exposed in the dialog, so it must be seeded — otherwise the scale
|
|
8378
|
+
// control reads as 0 and the re-crop never runs.
|
|
8379
|
+
downsamplingFactor: 5,
|
|
8372
8380
|
withMasks: true,
|
|
8373
8381
|
simplifyTolerance: 1,
|
|
8374
8382
|
minArea: 0,
|