diff --git a/Project.toml b/Project.toml index 4465f00..669c245 100644 --- a/Project.toml +++ b/Project.toml @@ -7,9 +7,9 @@ version = "0.2.6" ColorBlendModes = "60508b50-96e1-4007-9d6c-f475c410f16b" CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534" ImageDraw = "4381153b-2b60-58ae-a1ba-fd683676385f" ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795" -Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" IndirectArrays = "9b13fd28-a010-5f03-acff-a1bbcff69959" Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -27,17 +27,17 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" ColorBlendModes = "0.2" CoordinateTransformations = "0.6" Distributions = "0.24, 0.25" +ImageCore = "0.8, 0.9" ImageDraw = "0.2" ImageTransformations = "0.8" -Images = "0.23, 0.24, 0.25" IndirectArrays = "0.5, 1" Interpolations = "0.13" MosaicViews = "0.2, 0.3" -OffsetArrays = "1.6.2" +OffsetArrays = "1" Parameters = "0.12" -Rotations = "1.0" +Rotations = "1" Setfield = "0.7, 0.8" -StaticArrays = "1.0" +StaticArrays = "1" julia = "1.3, 1.4, 1.5" [publish] diff --git a/src/DataAugmentation.jl b/src/DataAugmentation.jl index d698e6a..d2df407 100644 --- a/src/DataAugmentation.jl +++ b/src/DataAugmentation.jl @@ -5,8 +5,7 @@ using CoordinateTransformations using Distributions: Sampleable, Uniform, Categorical using IndirectArrays: IndirectArray using ImageDraw -using Images -using Images: Colorant, permuteddimsview +using ImageCore using ImageTransformations using ImageTransformations: center, _center, box_extrapolation, warp! using Interpolations diff --git a/src/preprocessing.jl b/src/preprocessing.jl index 58820bc..c24e27f 100644 --- a/src/preprocessing.jl +++ b/src/preprocessing.jl @@ -166,7 +166,7 @@ function apply!(buf, ::ImageToTensor, image::Image; randstate = nothing) end function imagetotensor(image::AbstractArray{C, N}, T = Float32) where {C<:Color, N} - T.(permuteddimsview(_channelview(image), ((i for i in 2:N+1)..., 1))) + T.(PermutedDimsArray(_channelview(image), ((i for i in 2:N+1)..., 1))) end #= @@ -199,7 +199,7 @@ end function tensortoimage(C::Type{<:Color}, a::AbstractArray{T, N}) where {T, N} perm = (N, 1:N-1...) - return _colorview(C, permuteddimsview(a, perm)) + return _colorview(C, PermutedDimsArray(a, perm)) end diff --git a/src/visualization.jl b/src/visualization.jl index 3b7a614..c4171f6 100644 --- a/src/visualization.jl +++ b/src/visualization.jl @@ -59,7 +59,7 @@ end function showkeypoint!(img, point::SVector{N}, C; sz = 3) where N I = CartesianIndex(Tuple(round.(Int, point))) offset = sz รท 2 - Is = I-offset*one(CartesianIndex{N}):I+offset*one(CartesianIndex{N}) + Is = I-offset*oneunit(CartesianIndex{N}):I+offset*oneunit(CartesianIndex{N}) img[Is[[checkbounds(Bool, img, I) for I in Is]]] .= C end