See Model Guide page for concepts and workflows related to Model product.

A Model is a directory where you can create, manage, and compare a set of Model Runs related to the same machine learning task.

Create a Model

Creates a Model object on the server.

import labelbox
from labelbox import Client, Model

client = Client(api_key="<YOUR_API_KEY>")

model_name = "<your_model_name>"

# get ontology_id from a project
PROJECT_ID = "<your_project_id>"
project = client.get_project(PROJECT_ID)
ontology_id = project.ontology().uid
# or, get specify ontology_id directly
ontology_id = "<your_ontology_id>"

client.create_model(name=model_name, ontology_id=ontology_id)

Get a Model

# from model id
model = client.get_model("<your_model_id>")

all_models = client.get_models() # return all models this user has access to
models = client.get_models(where=(Model.name == "<model_name>"))

Delete a model

model.delete()