FluxML / FluxML/DataAugmentation.jl

DataAugmentation error with masks

Open
#104 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
46
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Cheers,

I’m receiving an error when augmenting masks prior to training a model for semantic segmentation. Consider img as RGB image matrix. Consider mask as a matrix with integer elements from 1 to 11. Code is as follows:

```
item1 = Image(img)
item2 = MaskMulti(mask)

tfm = Maybe(FlipX{2}()) |> Rotate(15) |> Zoom((1.0, 1.2)) |>
AdjustBrightness(0.3) |> AdjustContrast(0.3) |>
CenterCrop((256,256))
img_tf = apply(tfm, (item1, item2))

```

Error message as follows:

```
ERROR: MethodError: no method matching length(::DataAugmentation.MaskMulti{2, Int64, Int64})
The function `length` exists, but no method is defined for this combination of argument types.

Closest candidates are:
length(::LLVM.ArrayType)
@ LLVM ~/.julia/packages/LLVM/iza6e/src/core/type.jl:343
length(::DataStructures.EnumerateAll)
@ DataStructures ~/.julia/packages/DataStructures/IrAJn/src/multi_dict.jl:96
length(::LLVM.ConstantArray)
@ LLVM ~/.julia/packages/LLVM/iza6e/src/core/value/constant.jl:421
...
```

The error disappears in the following conditions:

1. If the transformation is restricted to the image only.
2. If the transformation is applied to image and mask, but the command line corresponding to AdjustBrightness and AdjustContrast is commented out.

Thanks for advising.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.