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

docs: adding field descriptions to predefined video document by punndcoder28 · Pull Request #1775 · 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
35 changes: 29 additions & 6 deletions docarray/documents/video.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
Expand Up @@ -2,6 +2,8 @@

import numpy as np

from pydantic import Field

from docarray.base_doc import BaseDoc
from docarray.documents import AudioDoc
from docarray.typing import AnyEmbedding, AnyTensor, VideoBytes
Expand Down Expand Up @@ -97,12 +99,33 @@ class MultiModalDoc(BaseDoc):
```
"""

url: Optional[VideoUrl] = None
audio: Optional[AudioDoc] = AudioDoc()
tensor: Optional[VideoTensor] = None
key_frame_indices: Optional[AnyTensor] = None
embedding: Optional[AnyEmbedding] = None
bytes_: Optional[VideoBytes] = None
url: Optional[VideoUrl] = Field(
description='URL to a (potentially remote) video file that needs to be loaded',
example='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true',
default=None,
)
audio: Optional[AudioDoc] = Field(
description='Audio document associated with the video',
default=None,
)
tensor: Optional[VideoTensor] = Field(
description='Tensor object representing the video which be specified to one of `VideoNdArray`, `VideoTorchTensor`, `VideoTensorFlowTensor`',
default=None,
)
key_frame_indices: Optional[AnyTensor] = Field(
description='List of all the key frames in the video',
example=[0, 1, 2, 3, 4],
default=None,
)
embedding: Optional[AnyEmbedding] = Field(
description='Store an embedding: a vector representation of the video',
example=[1, 0, 1],
default=None,
)
bytes_: Optional[VideoBytes] = Field(
Comment thread
punndcoder28 marked this conversation as resolved.
description='Bytes representation of the video',
default=None,
)

@classmethod
def validate(
Expand Down

Back | FazBrowse Home | New Git URL