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.5.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for fastpredict-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6f9103ec49581eff94066ba4c81fe947f744fff014fc7e8ca01711d941c3ff9 |
|
MD5 | 2cefb022d9f53deec69a3c46e334ce0f |
|
BLAKE2b-256 | 624dce00145e2773357221bd87bf1c8e8966c50ad2140f1ea51dd23b8611298c |