lorenzoh / DLPipelines.jl

Interfaces for deep learning data pipelines.
https://lorenzoh.github.io/DLPipelines.jl/dev/README.html
MIT License
6 stars 1 forks source link

usage of DLPipelines.predict #18

Closed AbhimanyuAryan closed 2 years ago

AbhimanyuAryan commented 2 years ago

hey @lorenzoh I don't understand what should go as method

DLPipelines.predict(load(FILE_PATH), "imgnet.jld2")

The source code doesn't have types as argument list which makes it little confusing

HTTP.request("GET", "http://127.0.0.1:8000/predict").body |> String
┌ Error: 2021-12-27 03:02:26 Exception while generating log record in module DetectBears at /Users/abhi/Git/stipple-fastai/DetectBears/routes.jl:55
│   exception =
│    MethodError: no method matching predict(::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}, ::String)
│    Closest candidates are:
│      predict(::Any, ::Any, ::Any; device, undevice, context) at /Users/abhi/.julia/packages/DLPipelines/HoDSq/src/inference.jl:8
lorenzoh commented 2 years ago

method is a learning method. It's what you get from constructors like ImageClassificationSingle or what you build using BlockMethod/SupervisedMethod. See the serialization tutorial for usage of predictbatch; predict is then the same but only taking in a single image, not a vector of images.

AbhimanyuAryan commented 2 years ago

thanks @lorenzoh