Skip to content

Commit 729988d

Browse files
[PLT-385] Add point cloud media override support to exports v2 (already supported in graphql).
1 parent 857fcac commit 729988d

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
lines changed

libs/labelbox/src/labelbox/data/annotation_types/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@
3939
from .data import DocumentData
4040
from .data import HTMLData
4141
from .data import ImageData
42-
from .data import MaskData
43-
from .data import TextData
44-
from .data import VideoData
4542
from .data import LlmPromptResponseCreationData
4643
from .data import LlmPromptCreationData
4744
from .data import LlmResponseCreationData
45+
from .data import MaskData
46+
from .data import PointCloudData
47+
from .data import TextData
48+
from .data import VideoData
4849

4950
from .label import Label
5051
from .collection import LabelList

libs/labelbox/src/labelbox/data/annotation_types/data/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from .dicom import DicomData
44
from .document import DocumentData
55
from .html import HTMLData
6+
from .llm_prompt_response_creation import LlmPromptResponseCreationData
7+
from .llm_prompt_creation import LlmPromptCreationData
8+
from .llm_response_creation import LlmResponseCreationData
9+
from .point_cloud import PointCloudData
610
from .raster import ImageData
711
from .raster import MaskData
812
from .text import TextData
913
from .video import VideoData
10-
from .llm_prompt_response_creation import LlmPromptResponseCreationData
11-
from .llm_prompt_creation import LlmPromptCreationData
12-
from .llm_response_creation import LlmResponseCreationData
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from labelbox.typing_imports import Literal
2+
from labelbox.utils import _NoCoercionMixin
3+
from .base_data import BaseData
4+
5+
6+
class PointCloudData(BaseData, _NoCoercionMixin):
7+
class_name: Literal["PointCloudData"] = "PointCloudData"

libs/labelbox/src/labelbox/schema/media_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class MediaType(Enum):
1313
LLMPromptCreation = "LLM_PROMPT_CREATION"
1414
LLMPromptResponseCreation = "LLM_PROMPT_RESPONSE_CREATION"
1515
Pdf = "PDF"
16+
PointCloud = "POINT_CLOUD"
1617
Simple_Tile = "TMS_SIMPLE"
1718
Text = "TEXT"
1819
Tms_Geo = "TMS_GEO"

libs/labelbox/tests/data/annotation_import/conftest.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,17 +1921,9 @@ def rename_cuid_key_recursive(d):
19211921
@staticmethod
19221922
def set_project_media_type_from_data_type(project, data_type_class):
19231923

1924-
def to_pascal_case(name: str) -> str:
1925-
return "".join([word.capitalize() for word in name.split("_")])
1926-
1927-
data_type_string = data_type_class.__name__[:-4].lower()
1928-
media_type = to_pascal_case(data_type_string)
1924+
media_type = data_type_class.__name__[:-4]
19291925
if media_type == "Conversation":
19301926
media_type = "Conversational"
1931-
elif media_type == "Llmpromptcreation":
1932-
media_type = "LLMPromptCreation"
1933-
elif media_type == "Llmpromptresponsecreation":
1934-
media_type = "LLMPromptResponseCreation"
19351927
elif media_type == "Llmresponsecreation":
19361928
media_type = "Text"
19371929
elif media_type == "Genericdatarow":

libs/labelbox/tests/data/annotation_import/test_data_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
DicomData,
1414
DocumentData,
1515
HTMLData,
16+
PointCloud,
1617
ImageData,
1718
TextData,
1819
LlmPromptCreationData,
@@ -154,6 +155,7 @@ def create_data_row_for_project(project, dataset, data_row_ndjson, batch_name):
154155
DocumentData,
155156
HTMLData,
156157
ImageData,
158+
PointCloud,
157159
TextData,
158160
LlmPromptCreationData,
159161
LlmPromptResponseCreationData,

libs/labelbox/tests/data/annotation_import/test_generic_data_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
DocumentData,
1414
HTMLData,
1515
ImageData,
16+
PointCloudData,
1617
TextData,
1718
LlmPromptCreationData,
1819
LlmPromptResponseCreationData,
@@ -154,6 +155,7 @@ def validate_iso_format(date_string: str):
154155
ConversationData,
155156
DocumentData,
156157
DicomData,
158+
PointCloudData,
157159
LlmPromptCreationData,
158160
LlmPromptResponseCreationData,
159161
LlmResponseCreationData,

0 commit comments

Comments
 (0)