FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: adding field descriptions to predefined mesh 3D document by punndcoder28 · Pull Request #1789 · docarray/docarray · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
25 changes: 21 additions & 4 deletions docarray/documents/mesh/mesh_3d.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from typing import Any, Optional, Type, TypeVar, Union

from pydantic import Field

from docarray.base_doc import BaseDoc
from docarray.documents.mesh.vertices_and_faces import VerticesAndFaces
from docarray.typing.tensor.embedding import AnyEmbedding
from docarray.typing.url.url_3d.mesh_url import Mesh3DUrl


T = TypeVar('T', bound='Mesh3D')


Expand Down Expand Up @@ -103,10 +106,24 @@ class MultiModalDoc(BaseDoc):

"""

url: Optional[Mesh3DUrl] = None
tensors: Optional[VerticesAndFaces] = None
embedding: Optional[AnyEmbedding] = None
bytes_: Optional[bytes] = None
url: Optional[Mesh3DUrl] = Field(
description='URL to a file containing 3D mesh information. Can be remote (web) URL, or a local file path.',
example='https://people.sc.fsu.edu/~jburkardt/data/obj/al.obj',
default=None,
)
tensors: Optional[VerticesAndFaces] = Field(
description='A tensor object of 3D mesh of type `VerticesAndFaces`.',
example=[[0, 1, 1], [1, 0, 1], [1, 1, 0]],
default=None,
)
embedding: Optional[AnyEmbedding] = Field(
description='Store an embedding: a vector representation of the 3D mesh.',
default=[1, 0, 1],
)
bytes_: Optional[bytes] = Field(
description='Bytes representation of 3D mesh.',
default=None,
)

@classmethod
def validate(
Expand Down

Back | FazBrowse Home | New Git URL