using FastAI
using FastAI.Datasets
using CairoMakie
LoadError("string", 3, ArgumentError("Package CairoMakie not found in current path:\n- Run `import Pkg; Pkg.add(\"CairoMakie\")` to install the CairoMakie package.\n"))
taskdata = Datasets.loadtaskdata(Datasets.datasetpath("camvid_tiny"), FastAI.ImageSegmentationTask);
image, mask = getobs(taskdata, 1)
summary.((image, mask))
("96×128 PermutedDimsArray(::Array{RGB{N0f8},2}, (2, 1)) with eltype ColorTypes.RGB{FixedPointNumbers.N0f8}", "96×128 Matrix{UInt8}")
method = ImageSegmentation(Datasets.getclassessegmentation("camvid_tiny"), (96, 128));
ImageSegmentation{2}((96, 128), ["Animal", "Archway", "Bicyclist", "Bridge", "Building", "Car", "CartLuggagePram", "Child", "Column_Pole", "Fence" … "SUVPickupTruck", "TrafficCone", "TrafficLight", "Train", "Tree", "Truck_Bus", "Tunnel", "VegetationMisc", "Void", "Wall"], 1, ProjectiveTransforms((96, 128)), ImagePreprocessing())
traindl, valdl = methoddataloaders(taskdata, method);
xs, ys = batch = first(traindl)
summary.((xs, ys))
("96×128×3×16 Array{Float32, 4}", "96×128×32×16 Array{Float32, 4}")
FastAI.plotbatch(method, (xs, ys))
Figure()