Coach Python SDK
Coach is an end-to-end Image Recognition platform, we provide the tooling to do effective data collection, training, and on-device parsing of Image Recognition models.
See https://coach.lkuich.com for more information!
Installing
Install and update using pip:
pip install coach-ml
Usage
Coach can be initialized 2 different ways. If you are only using the offline model parsing capabilities and already have a model package on disk, you can initialize like so:
coach = CoachClient()
# We already had the `flowers` model on disk, no need to authenticate:
result = coach.get_model('flowers').predict('rose.jpg')
However, in order to download your trained models, you must authenticate with your API key:
coach = CoachClient().login('myapikey')
# Now that we're authenticated, we can cache our models for future use:
coach.cache_model('flowers')
# Evaluate with our cached model:
result = coach.get_model('flowers').predict('rose.jpg')
API Breakdown
CoachClient
__init__(is_debug=False)
Optional is_debug, if True, additional logs will be displayed
login(apiKey) -> CoachClient
Authenticates with Coach service and allows for model caching. Accepts API Key as its only parameter. Returns its own instance.
cache_model(model_name, path='.', skip_match=False, model_type='frozen')
Downloads model from Coach service to disk. Specify the name of the model, and the path to store it. This will create a new directory in the specified path and store any model related documents there.
By default, if a model already exists with the same version, in the same path, caching will be skipped. Set skip_match to False to override this behaviour.
model_type can be one of: frozen, unity, mobile, and can be useful if you're interested in caching a specific version of your model.
get_model(path='.') -> CoachModel
Loads model into memory. Specify the path of the cached models directory. Returns a CoachModel
get_model_remote(model_name, path='.') -> CoachModel
Downloads and loads model into memory. Specify the path of the cached models directory. Returns a CoachModel
CoachModel
__init__(graph, labels, base_module)
Initializes a new instance of CoachModel, accepts a loaded tf.Graph(), array of labels, and the base_module the graph was trained off of.
predict(image, input_name="input", output_name="output") -> dict
Specify the directory of an image file or the image as a byte array. Parses the specified image into memory and runs it through the loaded model. Returns a dict of its predictions in order of confidence.
If you have a pretrained frozen graph with different Tensor input/output names, you can specify them with input_name and output_name respectfully.
Metadata
Release files for coach-ml 0.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coach-ml-0.22.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coach_ml-0.22-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / coach-ml-0.22.tar.gz
| Download URL | coach-ml-0.22.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a8a213e81265629872b5d4788966c63a32a0e1027fbdf1c950c9ccdbcc7af99
|
|
BLAKE2b-256 checksum How to use checksums |
f02c9c9f3d6ffdd0ed472667d63836fe6a08c09f18014c33df91d66020fb52eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
|
Release files / coach_ml-0.22-py3-none-any.whl
| Download URL | coach_ml-0.22-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b0d7c59268642f6820c676838ad5a1164ff476f689bc5ecb18cc937e349b503
|
|
BLAKE2b-256 checksum How to use checksums |
d5ed99d2ff865359c5a98cb7a4ba2f862865c9b5f54b7dd3e0addf780ee7b632
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
|