You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (width(img), height(img)) != classifier.image_wh
89
90
error("Image size ($(width(img)),$(height(img))) does not match the network input $(classifier.image_wh), and Julia does not have imresize yet........")
90
91
end
91
92
92
93
if classifier.grayscale
93
-
ifcolorspace(image) !="Gray"
94
-
image =convert(Image{Gray}, image)
94
+
if~(eltype(image) <:ColorTypes.Gray)
95
+
image =convert(Array{Gray}, image)
95
96
end
96
97
else
97
-
image =convert(Image{RGB}, image)
98
-
image =separate(image) # separate color channels
98
+
image =convert(Array{RGB}, image)
99
+
image =permutedims(channelview(image), [2,3,1]) # separate color channels
99
100
end
100
101
101
-
data =convert(Array, image)
102
+
data =convert(Array{Float32}, image)
102
103
data =reshape(data, size(data,1),size(data,2),size(data,3))
103
-
ifspatialorder(image) == ["x","y"]
104
-
# row major
105
-
elseifspatialorder(image) == ["y","x"]
106
-
data =permutedims(data, (2,1,3)) # permute to row-major
0 commit comments