This library contains code for interacting with EASIER.AI platform in Python.
Project description
EASIER SDK
Start to interact with EASIER platform by openning a session with the EasierSDK handler using your MINIO user
and password
, which are the same as your EASIER credentials if you are using an EASIER official platform.
from easierSDK.easier import EasierSDK
from easierSDK.classes.categories import Categories
easier = EasierSDK(minio_url="minio.easier-ai.eu", minio_user="", minio_password="")
In EASIER, models and datasets can be identified by their parent repository and their category. You can get an overview of the available repositories that you can interact with by using the following function. It also shows how many models and datasets are available in each repository.
easier.show_available_repos()
Set the parameter deep
to True to get more in-depth information of the content of the repositories: the name of the models and datasets that are inside each repository.
models_list, datasets_list = easier.show_available_repos(deep=True)
The function also returns a list of the models and datasets available.
print(models_list)
print(datasets_list)
Similarly, you can list the models and datasets by their category. The function behaves as the previous one.
easier.show_categories()
models_list, datasets_list = easier.show_categories(deep=True)
print(models_list)
print(datasets_list)
EASIER internal APIs: Models and Datasets
The EASIER SDK handles two internal APIs: ModelsAPI
and DatasetsAPI
. They allow you to interact seamlessly with models and datasets of the platform, respectively.
EASIER Models API
You can get an overview of the available models by using this function. It accepts two parameters: one for the parent repository of the models and one for the category of the models. Remember that there exists an enumerator for the categories to help you in identifying them. It was imported as Categories.
easier.models.show_models()
easier.models.show_models(repo_name="")
easier.models.show_models(category=Categories.MISC)
easier.models.show_models(repo_name="", category=Categories.MISC)
In addition, you can use the following to get more information about a model, which is identified by their parent repository, its category and its name (which is shown as output of the previous function).
easier.models.show_model_info(repo_name="", category=Categories.MISC, model_name="")
Similarly, you can get the information about a specific model version by using its experiment identifier.
easier.models.show_model_info(repo_name="", category=Categories.MISC, model_name="", experimentID=1)
Loading a model
Use this function to load a model directly from the repository. If you don't set the experimentID, the function will load the last version of the model. The function returns a variable of type EasierModel
, check the documentation to get more information about this class.
my_easier_model = easier.models.load_from_repository(repo_name="", category=Categories.MISC, model_name="")
# my_easier_model = easier.models.load_from_repository(repo_name="", category=Categories.MISC, model_name="", experimentID=1)
You can print the model's information enclosed in its ModelMetadata
variable. Similarly, check the documentation to get more information about this class.
my_easier_model_metadata = my_easier_model.get_metadata()
my_easier_model_metadata.pretty_print()
One important attribute of the ModelMetadata
class is the features
attribute. If your model was trained using a set of features from tabular data, you are encouraged to save the features as a list on this variable, so that future uses of this model know which features the model was trained with.
print(my_easier_model_metadata.features)
You can also load a model from a local path with this function. Remember that it should follow the EASIER file extension guide for a proper loading of all the objects. Check the documentation to get more information about it.
my_easier_model_2 = easier.models.load_from_local(path="", print_files=True)
Compilating a TF model to TF Lite
EASIER SDK has a specific function to compile your TF model to the TF Lite version. You just need to pass the variable of type Model and some calibration data (as a numpy.array
) which was used to train the model.
easier_models.compile_tflite(model=my_easier_model, calibration_data=x)
Upload Model
Once you have finished to work with your model, you can upload it to the EASIER platform. Besides, you have the possibility to make it public for other EASIER users (it will be uploaded to your public repository).
easier.models.upload(category=Categories.MISC, model=my_easier_model, public=False)
EASIER Datasets API
Similar to the Models API, you can get an overview of the available datasets by using this function. It accepts two parameters: one for the parent repository of the datasets and one for the category of the datasets. Remember that there exists an enumerator for the categories to help you in identifying them. It was imported as Categories
.
easier.datasets.show_datasets()
easier.datasets.show_datasets(repo_name="")
easier.datasets.show_datasets(category=Categories.MISC)
easier.datasets.show_datasets(repo_name="", category=Categories.MISC)
In addition, you can use the following function to get more information about a dataset, which is identified by their parent repository, its category and its name (which is shown as output of the previous function).
easier.datasets.show_dataset_info(repo_name="", category=Categories.MISC, dataset_name="")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file easierSDK-0.0.32.tar.gz
.
File metadata
- Download URL: easierSDK-0.0.32.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a0974cfd8833649a517150608162b68e8d5543c19449e89757e78750a4ea47b |
|
MD5 | 1515b1c353bf1fc42b4c32c17ffdf33a |
|
BLAKE2b-256 | 141640c5346ac9ad312e680f82eac793b5d4a79daf4013e75da477d246d36659 |
File details
Details for the file easierSDK-0.0.32-py3-none-any.whl
.
File metadata
- Download URL: easierSDK-0.0.32-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f54f7abab020a05aebc9223de019ccbb723e6ee1fe8fe000d0fab807b8ad1235 |
|
MD5 | 3308de10efb652567818625ce62962ea |
|
BLAKE2b-256 | 68041f70a885f72640a7c968b06642b1bc103616d6d9ce6e50639f9fb9d3121a |