Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions libs/labelbox/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from labelbox.schema.quality_mode import QualityMode

IMG_URL = "https://picsum.photos/200/300.jpg"
MASKABLE_IMG_URL = "https://storage.googleapis.com/labelbox-datasets/image_sample_data/2560px-Kitano_Street_Kobe01s5s4110.jpeg"
SMALL_DATASET_URL = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/potato.jpeg"
DATA_ROW_PROCESSING_WAIT_TIMEOUT_SECONDS = 30
DATA_ROW_PROCESSING_WAIT_SLEEP_INTERNAL_SECONDS = 3
Expand Down Expand Up @@ -75,7 +74,7 @@ class Environ(Enum):

@pytest.fixture
def image_url() -> str:
return MASKABLE_IMG_URL
return IMG_URL


@pytest.fixture
Expand Down Expand Up @@ -880,8 +879,8 @@ def video_data(client, rand_gen, video_data_row, wait_for_data_row_processing):

def create_video_data_row(rand_gen):
return {
"row_data": "https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4",
"global_key": f"https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4-{rand_gen(str)}",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4-{rand_gen(str)}",
"media_type": "VIDEO",
}

Expand Down
39 changes: 14 additions & 25 deletions libs/labelbox/tests/data/annotation_import/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
def video_data_row_factory():
def video_data_row(global_key):
return {
"row_data": "https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4",
"global_key": f"https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4-{global_key}",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4-{global_key}",
"media_type": "VIDEO",
}

Expand All @@ -38,8 +38,8 @@ def video_data_row(global_key):
def audio_data_row_factory():
def audio_data_row(global_key):
return {
"row_data": "https://storage.googleapis.com/labelbox-datasets/audio-sample-data/sample-audio-1.mp3",
"global_key": f"https://storage.googleapis.com/labelbox-datasets/audio-sample-data/sample-audio-1.mp3-{global_key}",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/tomorrow-114848.mp3",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/tomorrow-114848.mp3-{global_key}",
"media_type": "AUDIO",
}

Expand Down Expand Up @@ -82,8 +82,8 @@ def geospatial_data_row(global_key):
def html_data_row_factory():
def html_data_row(global_key):
return {
"row_data": "https://storage.googleapis.com/labelbox-datasets/html_sample_data/sample_html_1.html",
"global_key": f"https://storage.googleapis.com/labelbox-datasets/html_sample_data/sample_html_1.html-{global_key}",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/about.html",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/about.html-{global_key}",
}

return html_data_row
Expand All @@ -106,10 +106,10 @@ def document_data_row_factory():
def document_data_row(global_key):
return {
"row_data": {
"pdf_url": "https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483.pdf",
"text_layer_url": "https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483-lb-textlayer.json",
"pdf_url": "https://storage.googleapis.com/lb-test-data/cataflow/media/test-pdf.pdf",
"text_layer_url": "https://storage.googleapis.com/lb-test-data/cataflow/media/sample-pdf-textlayer.json",
},
"global_key": f"https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483.pdf-{global_key}",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/test-pdf.pdf-{global_key}",
"media_type": "PDF",
}

Expand All @@ -120,28 +120,17 @@ def document_data_row(global_key):
def text_data_row_factory():
def text_data_row(global_key):
return {
"row_data": "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/sample-text-2.txt",
"global_key": f"https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/sample-text-2.txt-{global_key}",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/sample-text.txt",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/sample-text.txt-{global_key}",
"media_type": "TEXT",
}

return text_data_row


@pytest.fixture(scope="module", autouse=True)
def llm_human_preference_data_row_factory():
def llm_human_preference_data_row(global_key):
return {
"row_data": "https://storage.googleapis.com/labelbox-datasets/sdk_test/llm_prompt_response_conv.json",
"global_key": global_key,
}

return llm_human_preference_data_row


@pytest.fixture(scope="module")
def mmc_data_row_url():
return "https://storage.googleapis.com/labelbox-datasets/conversational_model_evaluation_sample/offline-model-chat-evaluation.json"
return "https://storage.googleapis.com/lb-test-data/cataflow/media/sample-conversational-v2-4.json"


@pytest.fixture(scope="module", autouse=True)
Expand Down Expand Up @@ -700,7 +689,7 @@ def llm_prompt_response_creation_dataset_with_data_row(
global_key = str(uuid.uuid4())

convo_data = {
"row_data": "https://storage.googleapis.com/labelbox-datasets/conversational-sample-data/pairwise_shopping_2.json",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/sample-conversational-v2-4.json",
"global_key": global_key,
}

Expand Down Expand Up @@ -1321,7 +1310,7 @@ def segmentation_inference(prediction_id_mapping):
segmentation.update(
{
"mask": {
"instanceURI": "https://storage.googleapis.com/labelbox-datasets/image_sample_data/raster_seg.png",
"instanceURI": "https://storage.googleapis.com/lb-test-data/cataflow/media/dog.png",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Segmentation mask replaced with regular photo image

Medium Severity

The segmentation mask instanceURI was changed from raster_seg.png (a purpose-built binary segmentation mask) to dog.png (likely a regular photograph). Segmentation masks work by using colorRGB (here (255, 255, 255)) to identify which pixels belong to the segmented region. A regular dog photo is unlikely to have meaningful pure-white pixels, resulting in an empty or nonsensical segmentation — potentially causing test failures or silently making the tests meaningless.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3b68e3a. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not sure it matters for this test - let's see what happens.

"colorRGB": (255, 255, 255),
}
}
Expand Down
4 changes: 2 additions & 2 deletions libs/labelbox/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ def video_data(client, rand_gen, video_data_row, wait_for_data_row_processing):

def create_video_data_row(rand_gen):
return {
"row_data": "https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4",
"global_key": f"https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4-{rand_gen(str)}",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4-{rand_gen(str)}",
"media_type": "VIDEO",
}

Expand Down
4 changes: 2 additions & 2 deletions libs/labelbox/tests/integration/test_data_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ def test_data_row_update(
assert data_row.row_data == image_url

# tileLayer becomes a media attribute
pdf_url = "https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483.pdf"
tileLayerUrl = "https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483-lb-textlayer.json"
pdf_url = "https://storage.googleapis.com/lb-test-data/cataflow/media/test-pdf.pdf"
tileLayerUrl = "https://storage.googleapis.com/lb-test-data/cataflow/media/sample-pdf-textlayer.json"
data_row.update(row_data={"pdfUrl": pdf_url, "tileLayerUrl": tileLayerUrl})

def custom_check(data_row):
Expand Down
6 changes: 3 additions & 3 deletions libs/labelbox/tests/integration/test_data_rows_upsert.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def all_inclusive_data_row(self, dataset, image_url):
{
"type": "PDF_URL",
"name": "att3",
"value": "https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483.pdf",
"value": "https://storage.googleapis.com/lb-test-data/cataflow/media/test-pdf.pdf",
},
],
)
Expand Down Expand Up @@ -63,7 +63,7 @@ def test_create_data_row_with_upsert(self, client, dataset, image_url):
{
"type": AttachmentType.PDF_URL,
"name": "att3",
"value": "https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483.pdf",
"value": "https://storage.googleapis.com/lb-test-data/cataflow/media/test-pdf.pdf",
},
],
"metadata": [
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_create_data_row_with_upsert(self, client, dataset, image_url):
assert attachments[2].attachment_type == AttachmentType.PDF_URL
assert (
attachments[2].attachment_value
== "https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483.pdf"
== "https://storage.googleapis.com/lb-test-data/cataflow/media/test-pdf.pdf"
)

assert len(dr.metadata_fields) == 2
Expand Down
7 changes: 3 additions & 4 deletions libs/lbox-alignerr/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from labelbox.schema.quality_mode import QualityMode

IMG_URL = "https://picsum.photos/200/300.jpg"
MASKABLE_IMG_URL = "https://storage.googleapis.com/labelbox-datasets/image_sample_data/2560px-Kitano_Street_Kobe01s5s4110.jpeg"
SMALL_DATASET_URL = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/potato.jpeg"
DATA_ROW_PROCESSING_WAIT_TIMEOUT_SECONDS = 30
DATA_ROW_PROCESSING_WAIT_SLEEP_INTERNAL_SECONDS = 3
Expand Down Expand Up @@ -72,7 +71,7 @@ class Environ(Enum):

@pytest.fixture
def image_url() -> str:
return MASKABLE_IMG_URL
return IMG_URL


@pytest.fixture
Expand Down Expand Up @@ -852,8 +851,8 @@ def video_data(client, rand_gen, video_data_row, wait_for_data_row_processing):

def create_video_data_row(rand_gen):
return {
"row_data": "https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4",
"global_key": f"https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-1.mp4-{rand_gen(str)}",
"row_data": "https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4",
"global_key": f"https://storage.googleapis.com/lb-test-data/cataflow/media/test_video_500kb.mp4-{rand_gen(str)}",
"media_type": "VIDEO",
}

Expand Down
Loading