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.2.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for fastpredict-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5c4595559aa7aaa026c65f62c394a53c8c7446c8bb7918ea10789769b6f5370 |
|
MD5 | e26f0eeb368585cd2eb5ebf14fa499a3 |
|
BLAKE2b-256 | 9cb35b4fb99e0c476ac5af08a0b9d538fcc2bec8a8cbe43f8f59f899e9c1193a |