Skip to content

Commit 4c20d30

Browse files
committed
fix: backwards rows/cols on image sample transform
1 parent e5ad488 commit 4c20d30

File tree

1 file changed

+7
-7
lines changed
  • src/components/TransformImageSamplesIntoSegmentsDialog

1 file changed

+7
-7
lines changed

src/components/TransformImageSamplesIntoSegmentsDialog/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ export default ({ open, onChangeDataset, onClose, dataset }) => {
3737
{
3838
text: "Convert Image Samples into Segments",
3939
onClick: async () => {
40-
const [w, h] = splitType.split("x").map((v) => parseInt(v))
40+
const [rows, cols] = splitType.split("x").map((v) => parseInt(v))
4141

4242
try {
4343
onChangeDataset(
4444
setIn(
4545
dataset,
4646
["samples"],
47-
range(h).flatMap((y) =>
48-
range(w).flatMap((x) =>
47+
range(rows).flatMap((y) =>
48+
range(cols).flatMap((x) =>
4949
dataset.samples.map((s) => {
5050
return setIn(s, ["allowedArea"], {
51-
x: x / w,
52-
y: y / h,
53-
width: 1 / w,
54-
height: 1 / h,
51+
x: x / cols,
52+
y: y / rows,
53+
width: 1 / cols,
54+
height: 1 / rows,
5555
})
5656
})
5757
)

0 commit comments

Comments
 (0)