Skip to main content

This is the API client of Open Innovation Platform - Tracking

Project description

Open Innovation MLOps Client API

Welcome to the Open Innovation MLOps Client API documentation! This guide offers detailed instructions on how to install, set up, and use the client library.

Installation and Setup

To use the Open Innovation MLOps Client in your project, follow these steps:

  1. Install the client library: Use the following pip command to add the Open Innovation MLOps Client to your Python environment:

    pip install oip-tracking-client
    
  2. Import the library: Add the following import statement to your Python script to gain access to the MLOps class from the client library:

    from oip_tracking_client.tracking import TrackingClient
    

GPU Metrics support

To log the GPU metrics install the library with either AMD or nVidia extra requirements.

  • AMD: pip install oip-tracking-client[amd]
  • nVidia: pip install oip-tracking-client[nvidia]

Client Initialization and Tracking

To start using the Open Innovation TrackingClient in your application, you need to initialize it with specific details about your environment.

api_host = "api_host"
username = "your_username"
password = "your_password"
workspace_name = "target_workspace_name"
TrackingClient.connect(api_host, username, password, workspace_name)

Parameters

  • api_host (str, required): The hostname of the API server.
  • username (str, required): Your username.
  • password (str, required): Your password.
  • workspace_name (str, required): The name of the workspace you want to connect to. This workspace should already exist on the platform's user interface (UI).

OAfter initializing the client and establishing the connection, you can specify the experiment you want to track:

experiment_name = "target_experiment_name"
TrackingClient.set_experiment(experiment_name)

Parameters

  • experiment_name (str, required): The name of the experiment you want to track.

Once the target experiment is set, the API client is ready to start tracking your runs.

Compatibility with Mlflow for Tracking

The TrackingClient provides access to all the methods available through the MLflow API. For instance:

TrackingClient.autolog() is equivalent to mlflow.autolog().

For more information about the available methods, refer to the MLflow official documentation.

Advanced Artifacts Tracking

In addition to all the features offered by MLflow, our solution also enables tracking of specific types of artifacts like images, audio, video, figures, text, JSON, etc., for specific machine learning training tasks analysis. This allows for sophisticated and advanced analytics and visualizations through our platform UI.

Image Tracking

The log_image_at_step method accepts an image as a numpy.ndarray or rom PIL.Image.Image:

from PIL import Image

# Load or create your image as numpy.ndarray or PIL.Image
image_data = Image.open("test_image.jpg")

# Log image at specific step
extra = {"description": "test image"}
TrackingClient.log_image_at_step(image_data, 'image_file.jpg', 1, extra)

Please note that for images, you can directly pass the path to the image file.

Audio Tracking

The log_audio_at_step method accepts audio data as a numpy.ndarray:

import numpy as np

# Create or load your audio data as a numpy array
audio_data = np.random.random(1000)

# Log audio at specific step
TrackingClient.log_audio_at_step(audio_data, 'audio_file.wav', 1, rate=44100)

The audio_data should be a numpy array. If the audio is stereo, the array should be 2-dimensional.

Text Tracking

The log_text_at_step method accepts text as a str:

# Log text at specific step
text_data = "This is a sample text."
TrackingClient.log_text_at_step(text_data, 'text_file.txt', 1)

Figure Tracking

The log_figure_at_step method accepts a figure as a matplotlib.figure.Figure or plotly.graph_objects.Figure:

import matplotlib.pyplot as plt

# Create a figure
fig, ax = plt.subplots()
ax.plot([1, 2, 3, 4], [1, 4, 2, 3])

# Log figure at specific step
TrackingClient.log_figure_at_step(fig, 'figure_file.jpg', 1)

The fig should be a matplotlib.figure.Figure object.

JSON Tracking

The log_dict_at_step method accepts a dictionary or list to be logged as JSON:

# Log dictionary at specific step
dict_data = {"key1": "value1", "key2": "value2"}
TrackingClient.log_dict_at_step(dict_data, 'dict_file.json', 1)

The dictionary or list will be saved as a JSON file.

Extra Parameters

Note: All log_*_at_step methods accept an optional extra parameter (of type dict) which can be used to log additional metadata about the artifact, and a file_name (of type str) that specifies the name of the artifact file. For log_audio_at_step, there is also a rate parameter (of type int) to specify the sample rate of the audio data.

The extra parameter should be a dictionary with string keys. The values can be of types int, float, str, bool, list, or None.

extra = {"description": "This is a description of the artifact."}

In the case of log_audio_at_step, there's also a rate parameter to specify the sample rate of the audio data.

TrackingClient.log_audio_at_step(audio_data, 'audio_file', 1, rate=44100, extra=extra)

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

oip-tracking-client-0.0.18.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oip_tracking_client-0.0.18-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file oip-tracking-client-0.0.18.tar.gz.

File metadata

  • Download URL: oip-tracking-client-0.0.18.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for oip-tracking-client-0.0.18.tar.gz
Algorithm Hash digest
SHA256 2e225e4e465df5b1533c2a035d60abb899a07d987288d643d722c03d4449af7f
MD5 80939798f956d091d427674e9eb16811
BLAKE2b-256 a6d5ff49c0010b89cdfaa6e8bed1983efbe2965464c75f58fcfc84d7b9d17056

See more details on using hashes here.

File details

Details for the file oip_tracking_client-0.0.18-py3-none-any.whl.

File metadata

File hashes

Hashes for oip_tracking_client-0.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 c0294131c95420517e5cc5173fa5206f9b9f5e7edd333ca8b02673d4ead89810
MD5 2d39b7a39605fc26f7ffa92cb219c06a
BLAKE2b-256 7f9be5d2982c3837d87b7fd5e6bf82e6c3488e51d445f06a97acacd1f0a07015

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page