Create a Foundry app
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.Run a Foundry app
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.
DataRowIdentifiables
object and a unique name.
Send Foundry annotations to Annotate
When you send predictions to Annotate from Catalog, you may choose to include or exclude certain parameters.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). |
Sample script
Example: Run and import annotations from a Foundry app
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.Before you start
You will need to import these libraries to use the code examples in this section.Replace with your API key
Step 1: Import data rows into Catalog
You must have data rows in Catalog before you can run them through Foundry. In this example, we are using an image data row.Step 2: Set up ontology
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.Step 3: Create a labeling project
Connect the ontology to the labeling project.Step 4: Create new Foundry app & copy App ID
To use the Labelbox app to create Foundry apps:1
From the main menu, select Model and then select App from the Create menu.
2
Select Amazon Rekognition, name your Foundry app, and then select Proceed.
3
Customize your parameters and then select Save & Create.
4
In Model, select *Aps and then select your new Foundry app.
5
Use the Copy button to copy the App ID to the clipboard.
6
Paste the copied App ID into your code:
Step 5: Run Foundry app on data rows
This step generates annotations that can later be reused as pre-labels or ground in a project.Step 6: Map ontology through the UI
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:1
Use Catalog to select the dataset for your model run and then select the data rows Select Select all in the top right corner.
2
Select Manage selection > Send to Annotate.
3
Select your project from the Project menu.
4
When sending annotations for Annotate review, you typically select a workflow step. This isn’t necessary for this example.
5
Place a checkmark next to Include model predictions and then select Map.
6
Select the incoming ontology and matching ontology features for Car and Person.
7
When the features are mapped, select Copy ontology mapping as JSON.
8
Paste your copied JSON into the definition of
PREDICTIONS_ONTOLOGY_MAPPING
9
In a production workflow, you would typically save your configuration. You can skip this step for the sake of this example.