Read 4000 Imgs

mail@pastecode.io avatar
unknown
julia
2 years ago
478 B
5
Indexable
Never
using FileIO, Images

const paths::Vector{String} = readdir(
    raw"<PATH>\TinyMNIST\train"; join=true
)

function ret400(paths::Vector{String})::Matrix{Float64}
    reduce(hcat, _ret400.(paths))
end

function _ret400(path::String)::Matrix{Float64}
    set1::Vector{String} = readdir(path; join=true);
    b::Vector{Matrix{Float64}} = [Float64.(x) for x=FileIO.load.(set1)]
    c::Vector{Vector{Float64}} = [vec(reshape(x, :, 1)) for x=b]
    reduce(hcat, c)
end

ret400(paths)