using FastAI
Pkg.add("CairoMakie")
data, blocks = loaddataset("imagenette2-160", (Image, Label))
data
blocks
image, class = sample = getobs(data, 500)
@show class
image
idxs = rand(1:nobs(data), 9)
samples = [getobs(data, i) for i in idxs]
plotsamples(method, samples)
method = BlockMethod(
blocks,
(
ProjectiveTransforms((128, 128)),
ImagePreprocessing(),
OneHot()
)
)
method = ImageClassificationSingle(blocks)
method
dls = methoddataloaders(data, method)
model = methodmodel(method, Models.xresnet18())
lossfn = methodlossfn(method)
learner = Learner(model, dls, ADAM(), lossfn, ToGPU(), Metrics(accuracy))
fitonecycle!(learner, 10, 0.002)
plotpredictions(method, learner)