Skip to content

docs: adding field descriptions to predefined video document #1775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
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
Next Next commit
docs: adding field descriptions to predefined video document
Signed-off-by: punndcoder28 <puneethk.2899@gmail.com>
  • Loading branch information
punndcoder28 committed Sep 14, 2023
commit e9812913045883b600352ed5c72ac686ee279c32
35 changes: 29 additions & 6 deletions docarray/documents/video.py
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 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(
description='Bytes representation of the video',
default=None,
)

@classmethod
def validate(
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy