A few helper utilities to make it simpler to perform fastai inference/prediction
Project description
fastpredict
Has the following benefits over using fastai directly:
- cleaner API for batch prediction
- takes care of using CPU or GPU if you specify in the constructor
How to use:
from fastpredict import FastPredictBool
f = FastPredictBool.from_path('/path/to/learner.pkl')
score = f.predict_path('/path/to/image.jpg')
scores = f.batch_predict_paths(['/path/to/image1.jpg', '/path/to/image2.jpg'])
To prune a model:
from fastpredict import FastPredict
from fastai.vision.all import load_learner
learn = load_learner('/path/to/current/learner.pkl')
new_learn = FastPredict.clean_learner(learn)
new_learn.export('/path/to/new/learner.pkl')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastpredict-0.0.3.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for fastpredict-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 502cee8c31363cc94bcce9723190a6150f65334406b10264919d2a8de6fa0f12 |
|
MD5 | 4795e7d0ec68687a67afff592a57fc8a |
|
BLAKE2b-256 | 21944c0183cdf9f618679d0fb383c77aef077f85b7d429377cfeb0e1300bc90c |