Skip to content

Commit 46ab7a0

Browse files
committed
Handle masks of IndirectArrays
1 parent 049cd1c commit 46ab7a0

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1010
ImageDraw = "4381153b-2b60-58ae-a1ba-fd683676385f"
1111
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795"
1212
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
13+
IndirectArrays = "9b13fd28-a010-5f03-acff-a1bbcff69959"
1314
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
1415
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1516
MosaicViews = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389"

src/DataAugmentation.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module DataAugmentation
33
using ColorBlendModes
44
using CoordinateTransformations
55
using Distributions: Sampleable, Uniform, Categorical
6+
using IndirectArrays: IndirectArray
67
using ImageDraw
78
using Images
89
using Images: Colorant, permuteddimsview

src/items/mask.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ end
3131

3232
MaskMulti(a::AbstractArray{<:Gray{T}}, args...) where T = MaskMulti(reinterpret(T, a), args...)
3333
MaskMulti(a::AbstractArray{<:Normed{T}}, args...) where T = MaskMulti(reinterpret(T, a), args...)
34+
MaskMulti(a::IndirectArray, classes = a.values, bounds = Bounds(size(a))) =
35+
MaskMulti(a.index, classes, bounds)
3436

3537
Base.show(io::IO, mask::MaskMulti{N, T}) where {N, T} =
3638
print(io, "MaskMulti{$N, $T}() with size $(size(itemdata(mask))) and $(length(mask.classes)) classes")

0 commit comments

Comments
 (0)