Developer guide for creating and managing Foundry applications.
Foundry apps help automate data labeling and enrichment. Here, we should how to use the Labelbox SDK to manage Foundry apps and how to use a Foundry app to predict and import annotations into a dataset.
A Foundry app (short for Foundry application) helps automate data labeling and enrichment. Once you’ve created a Foundry app, you can run it repeatedly against new data.
To create a Foundry app, use the Labelbox Model to create your Foundry app.
Once the app is created, you can use the Labelbox SDK to run your app and manage its results.
You can use the Labelbox Model to run Foundry apps. Results are displayed like any other model run.
When running a Foundry app, you must provide an app ID. You can find the app ID by going to the Model tab and selecting Apps. When you select a Foundry app, the app ID will appear in the top right corner of the screen.
In addition to the app ID, the method also requires a DataRowIdentifiables
object and a unique name.
When you send predictions to Annotate from Catalog, you may choose to include or exclude certain parameters.
Parameter | Required? | Description |
---|---|---|
predictions_ontology_mapping | Required | A dictionary containing the mapping of the model’s ontology feature schema IDs to the project’s ontology feature schema IDs. See Send predictions to Annotate for more information on where to access your predictions map. |
exclude_data_rows_in_project | Optional | Excludes data rows that are already in the project. |
override_existing_annotations_rule | Optional | The strategy defines how to handle conflicts in classifications between the existing data rows in the project and incoming predictions from the source model run or annotations from the source project. Options include: -ConflictResolutionStrategy.KeepExisting (DEFAULT) -ConflictResolutionStrategy.OverrideWithPredictions -ConflictResolutionStrategy.OverrideWithAnnotations |
batch_priority | Optional | Assigned priority to the batch of data rows (1-5). |
Regardless of what model you use from Foundry, the workflow through the SDK is similar. Step 6 (Map ontology through the UI) is where the process can slightly differ.
An interactive tutorial is also available as a Colab notebook; it shows shows how to run and import annotations from a Foundry app.
You will need to import these libraries to use the code examples in this section.
You must have data rows in Catalog before you can run them through Foundry. In this example, we are using an image data row.
Your project should have an ontology configured the tools and classifications supported for your model and selected data type.
To illustrate, Amazon Rekognition only supports object detection scenarios. Consequently, your ontology must include a bounding box annotation. for your ontology since it only supports object detection.
Connect the ontology to the labeling project.
To use the Labelbox app to create Foundry apps:
From the main menu, select Model and then select App from the Create menu.
Select Amazon Rekognition, name your Foundry app, and then select Proceed.
Customize your parameters and then select Save & Create.
In Model, select *Aps and then select your new Foundry app.
Use the Copy button to copy the App ID to the clipboard.
Paste the copied App ID into your code:
Foundry apps can only be created using the app; you cannot use the SDK to create Foundry apps.
This step generates annotations that can later be reused as pre-labels or ground in a project.
Predictions may not directly map to ontology features. When this happens, you need to map predictions to your ontology. To do this using the Labelbox app:
Use Catalog to select the dataset for your model run and then select the data rows Select Select all in the top right corner.
Select Manage selection > Send to Annotate.
Select your project from the Project menu.
When sending annotations for Annotate review, you typically select a workflow step. This isn’t necessary for this example.
Place a checkmark next to Include model predictions and then select Map.
Select the incoming ontology and matching ontology features for Car and Person.
When the features are mapped, select Copy ontology mapping as JSON.
Paste your copied JSON into the definition of PREDICTIONS_ONTOLOGY_MAPPING
In a production workflow, you would typically save your configuration. You can skip this step for the sake of this example.
While you cannot the SDK to map predictions to ontology features, you can use it to send predictions to Annotate.