Skip to content

Commit 2f2ac75

Browse files
author
Adrian Chang
committed
Merge remote-tracking branch 'origin/develop' into PLT-1135
2 parents 7e88e90 + 4b17a95 commit 2f2ac75

File tree

77 files changed

+3023
-44393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3023
-44393
lines changed

.github/workflows/python-package-shared.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
integration:
3737
runs-on: ubuntu-latest
3838
concurrency:
39-
group: labelbox-python-${{ inputs.test-env }}-${{ inputs.python-version }}
39+
group: labelbox-python-${{ inputs.test-env }}-${{ inputs.python-version }}-integration
4040
cancel-in-progress: false
4141
steps:
4242
- uses: actions/checkout@v4
@@ -48,14 +48,16 @@ jobs:
4848
python-version: ${{ inputs.python-version }}
4949
- name: Integration Testing
5050
env:
51-
PYTEST_XDIST_AUTO_NUM_WORKERS: 20
5251
LABELBOX_TEST_API_KEY: ${{ secrets[inputs.api-key] }}
5352
DA_GCP_LABELBOX_API_KEY: ${{ secrets[inputs.da-test-key] }}
5453
LABELBOX_TEST_ENVIRON: ${{ inputs.test-env }}
5554
working-directory: libs/labelbox
56-
run: rye run integration
55+
run: rye run integration -n 32
5756
unit-data:
5857
runs-on: ubuntu-latest
58+
concurrency:
59+
group: labelbox-python-${{ inputs.test-env }}-${{ inputs.python-version }}-unit-data
60+
cancel-in-progress: false
5961
steps:
6062
- uses: actions/checkout@v4
6163
with:
@@ -66,12 +68,11 @@ jobs:
6668
python-version: ${{ inputs.python-version }}
6769
- name: Unit && Data Testing
6870
env:
69-
PYTEST_XDIST_AUTO_NUM_WORKERS: 20
7071
LABELBOX_TEST_API_KEY: ${{ secrets[inputs.api-key] }}
7172
DA_GCP_LABELBOX_API_KEY: ${{ secrets[inputs.da-test-key] }}
7273
LABELBOX_TEST_ENVIRON: ${{ inputs.test-env }}
7374
working-directory: libs/labelbox
7475
run: |
7576
rye sync -f --features labelbox/data
76-
rye run unit
77-
rye run data
77+
rye run unit -n 32
78+
rye run data -n 32

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ You should be set! Running the snippet above should create a dataset called `Tes
7272
## Contribution Guidelines
7373
We encourage anyone to contribute to this repository to help improve it. Please refer to [Contributing Guide](CONTRIBUTING.md) for detailed information on how to contribute. This guide also includes instructions for how to build and run the SDK locally.
7474

75-
## Develop with AI assistance
76-
### Use the codebase as context for large language models
77-
Using the [GPT repository loader](https://github.com/mpoon/gpt-repository-loader), we have created `lbx_prompt.txt` that contains data from all `.py` and `.md` files. The file has about 730k tokens. We recommend using Gemini 1.5 Pro with 1 million context length window.
78-
7975
## Documentation
8076
The SDK is well-documented to help developers get started quickly and use the SDK effectively. Here are links to that documentation:
8177

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
project = 'Python SDK reference'
1717
copyright = '2024, Labelbox'
1818
author = 'Labelbox'
19-
release = '3.72.2'
19+
release = '3.74.0'
2020

2121
# -- General configuration ---------------------------------------------------
2222

docs/labelbox/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Labelbox Python SDK Documentation
2525
identifiable
2626
identifiables
2727
label
28+
label-score
2829
labeling-frontend
2930
labeling-frontend-options
3031
labeling-parameter-override

docs/labelbox/label-score.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Label Score
2+
===============================================================================================
3+
4+
.. automodule:: labelbox.schema.label_score
5+
:members:
6+
:show-inheritance:

docs/labelbox/user-group.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
User Group
2+
===============================================================================================
3+
4+
.. automodule:: labelbox.schema.user_group
5+
:members:
6+
:show-inheritance:

examples/README.md

Lines changed: 93 additions & 88 deletions
Large diffs are not rendered by default.

examples/integrations/yolo/import_yolov8_annotations.ipynb

Lines changed: 331 additions & 0 deletions
Large diffs are not rendered by default.

examples/project_configuration/live_multimodal_chat_project.ipynb renamed to examples/project_configuration/multimodal_chat_project.ipynb

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"metadata": {},
1717
"source": [
1818
"<td>\n",
19-
"<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/project_configuration/live_multimodal_chat_project.ipynb\" target=\"_blank\"><img\n",
19+
"<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/project_configuration/multimodal_chat_project.ipynb\" target=\"_blank\"><img\n",
2020
"src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n",
2121
"</td>\n",
2222
"\n",
2323
"<td>\n",
24-
"<a href=\"https://github.com/Labelbox/labelbox-python/tree/develop/examples/project_configuration/live_multimodal_chat_project.ipynb\" target=\"_blank\"><img\n",
24+
"<a href=\"https://github.com/Labelbox/labelbox-python/tree/develop/examples/project_configuration/multimodal_chat_project.ipynb\" target=\"_blank\"><img\n",
2525
"src=\"https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\"GitHub\"></a>\n",
2626
"</td>"
2727
],
@@ -30,14 +30,16 @@
3030
{
3131
"metadata": {},
3232
"source": [
33-
"# Live Multimodal Chat project setup\n",
33+
"# Multimodal chat project setup\n",
3434
"\n",
35-
"This notebook will provide an example workflow of setting up a Live Multimodal Chat (LMC) Project with the Labelbox-Python SDK.\n",
36-
"Live Multimodal Chat Projects are set up differently than other projects with its own unique method and modifications to existing methods:\n",
35+
"This notebook will provide an example workflow of setting up a multimodal Chat (MMC) Project with the Labelbox-Python SDK.\n",
36+
"Multimodal Chat Projects are set up differently than other projects with its own unique method and modifications to existing methods:\n",
3737
"\n",
38-
"- `client.create_model_evaluation_project`: The main method used to create a Live Multimodal Chat project\n",
38+
"- `client.create_model_evaluation_project`: The main method used to create a live multimodal Chat project.\n",
39+
" \n",
40+
"- `client.create_offline_model_evaluation_project`: The main method used to create a offline multimodal Chat project.\n",
3941
"\n",
40-
"- `client.create_ontology`: Methods used to create Labelbox ontologies for LMC project this requires an `ontology_kind` parameter set to `lb.OntologyKind.ModelEvaluation`\n",
42+
"- `client.create_ontology`: Methods used to create Labelbox ontologies for LMC project this requires an `ontology_kind` parameter set to `lb.OntologyKind.ModelEvaluation`.\n",
4143
"\n",
4244
"- `client.create_ontology_from_feature_schemas`: Similar to `client.create_ontology` but from a list of `feature schema ids` designed to allow you to use existing features instead of creating new features. This also requires an `ontology_kind` set to `lb.OntologyKind.ModelEvaluation`."
4345
],
@@ -68,7 +70,7 @@
6870
"metadata": {},
6971
"source": [
7072
"## API key and client\n",
71-
"Provide a valid API key below in order to properly connect to the Labelbox client. Please review [Create API key guide](https://docs.labelbox.com/reference/create-api-key) for more information."
73+
"Please provide a valid API key below to connect to the Labelbox client properly. For more information, please review the [Create API key guide](https://docs.labelbox.com/reference/create-api-key)."
7274
],
7375
"cell_type": "markdown"
7476
},
@@ -82,18 +84,18 @@
8284
{
8385
"metadata": {},
8486
"source": [
85-
"## Example: Create Live Multimodal Chat project\n",
87+
"## Example: Create multimodal Chat project\n",
8688
"\n",
87-
"The steps to creating a Live Multimodal Chat Project through the Labelbox-Python SDK are similar to creating a regular project. However, they vary slightly, and we will showcase the different methods in this example workflow."
89+
"The steps to creating a multimodal Chat Projects through the Labelbox-Python SDK are similar to creating a regular project. However, they vary slightly, and we will showcase the different methods in this example workflow."
8890
],
8991
"cell_type": "markdown"
9092
},
9193
{
9294
"metadata": {},
9395
"source": [
94-
"### Create a Live Multimodal Chat ontology\n",
96+
"### Create a multimodal chat ontology\n",
9597
"\n",
96-
"You can create ontologies for Model Evaluation projects the same way as creating ontologies for other projects with the only requirement of passing in a `ontology_kind` parameter which needs set to `lb.OntologyKind.ModelEvaluation`. You can create ontologies with two methods: `client.create_ontology` and `client.create_ontology_from_feature_schemas`."
98+
"You can create ontologies for multimodal chat projects in the same way as other project ontologies using two methods: `client.create_ontology` and `client.create_ontology_from_feature_schemas`. The only additional requirement is to pass an ontology_kind parameter, which needs to be set to `lb.OntologyKind.ModelEvaluation`."
9799
],
98100
"cell_type": "markdown"
99101
},
@@ -102,7 +104,7 @@
102104
"source": [
103105
"#### Option A: `client.create_ontology`\n",
104106
"\n",
105-
"Typically, you create ontologies and generate the associated features at the same time. Below is an example of creating an ontology for your Live Multimodal Chat project using supported tools and classifications. For information on supported annotation types visit our [Live Multimodal Chat](https://docs.labelbox.com/docs/live-multimodal-chat#supported-annotation-types) guide."
107+
"Typically, you create ontologies and generate the associated features simultaneously. Below is an example of creating an ontology for your multimodal chat project using supported tools and classifications; for information on supported annotation types, visit our [multimodal chat evaluation guide](https://docs.labelbox.com/docs/multimodal-chat#supported-annotation-types) guide."
106108
],
107109
"cell_type": "markdown"
108110
},
@@ -128,6 +130,37 @@
128130
"outputs": [],
129131
"execution_count": null
130132
},
133+
{
134+
"metadata": {},
135+
"source": [
136+
"## Creating multimodal chat evaluation projects\n",
137+
"\n",
138+
"There are two versions of a multimodal chat evaluation projects:\n",
139+
"\n",
140+
"1. Offline multimodal chat evaluation projects: Data rows will need to be imported manually and have no live model invocation.\n",
141+
"\n",
142+
"2. Live multimodal chat evaluation projects: Empty data rows are generated on project creation and are filled out with live model invocation.\n",
143+
"\n",
144+
"We will discuss creating both types of projects with the Labelbox SDK."
145+
],
146+
"cell_type": "markdown"
147+
},
148+
{
149+
"metadata": {},
150+
"source": [
151+
"## Set up offline multimodal chat evaluation project\n",
152+
"\n",
153+
"For an offline multimodal chat evaluation project, you must import conversational version 2 data rows. For more information, please visit our [import multimodal chat evaluation data](https://docs.labelbox.com/reference/import-multimodal-chat-data) guide. Offline multimodal chat evaluation projects are created through the SDK with `client.create_offline_model_evaluation_project`. This method uses the same parameters as `client.create_project` but provides better validation to ensure the project is set up correctly."
154+
],
155+
"cell_type": "markdown"
156+
},
157+
{
158+
"metadata": {},
159+
"source": "project = client.create_offline_model_evaluation_project(\n name=\"<project_name>\",\n description=\"<project_description>\", # optional\n)",
160+
"cell_type": "code",
161+
"outputs": [],
162+
"execution_count": null
163+
},
131164
{
132165
"metadata": {},
133166
"source": [
@@ -224,10 +257,21 @@
224257
{
225258
"metadata": {},
226259
"source": [
227-
"**To finish setting up your LMC project, you will need to navigate to your project overview inside the Labelbox platform and select _Complete setup_ on the left side panel**"
260+
"### Mark project setup as completed\n",
261+
"\n",
262+
"Once you have finalized your project and set up your model configs, you must mark the project setup as completed.\n",
263+
"\n",
264+
"**Once the project is marked as \"setup complete\", a user can not add, modify, or delete existing project model configs.**"
228265
],
229266
"cell_type": "markdown"
230267
},
268+
{
269+
"metadata": {},
270+
"source": "project.set_project_model_setup_complete()",
271+
"cell_type": "code",
272+
"outputs": [],
273+
"execution_count": null
274+
},
231275
{
232276
"metadata": {},
233277
"source": [

examples/scripts/generate_readme.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,18 @@ def create_title(link: str) -> str:
6767
split_link = link.split(".")[-2].split("/")[-1].replace("_", " ").split(" ")
6868
title = []
6969

70-
# List to lower case certain words and list to keep certain acronyms capitalized
70+
# List for lower casing certain words, keep certain acronyms capitalized and special mappings
7171
lower_case_words = ["to"]
7272
acronyms = ["html", "pdf", "llm", "dicom", "sam", "csv"]
73+
special = {"yolov8": "YOLOv8"}
7374

7475
for word in split_link:
7576
if word.lower() in acronyms:
7677
title.append(word.upper())
7778
elif word.lower() in lower_case_words:
7879
title.append(word.lower())
80+
elif word in special.keys():
81+
title.append(special[word])
7982
else:
8083
title.append(word.capitalize())
8184
return " ".join(title).split(".")[0]

0 commit comments

Comments
 (0)