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.4.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for fastpredict-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53c43e1811c11208c5a1f74f7d06711a234229948a922db7293358ac3b7c13f7 |
|
MD5 | f027912527f9a056d62195bd9342ee99 |
|
BLAKE2b-256 | 78c1094763a5b286c11e1897309d3da2c99adceff406d9ab04e3a9a71f72189a |