|
2 | 2 |
|
3 | 3 | import numpy as np |
4 | 4 |
|
| 5 | +from pydantic import Field |
| 6 | + |
5 | 7 | from docarray.base_doc import BaseDoc |
6 | 8 | from docarray.documents import AudioDoc |
7 | 9 | from docarray.typing import AnyEmbedding, AnyTensor, VideoBytes |
@@ -97,12 +99,33 @@ class MultiModalDoc(BaseDoc): |
97 | 99 | ``` |
98 | 100 | """ |
99 | 101 |
|
100 | | - url: Optional[VideoUrl] = None |
101 | | - audio: Optional[AudioDoc] = AudioDoc() |
102 | | - tensor: Optional[VideoTensor] = None |
103 | | - key_frame_indices: Optional[AnyTensor] = None |
104 | | - embedding: Optional[AnyEmbedding] = None |
105 | | - bytes_: Optional[VideoBytes] = None |
| 102 | + url: Optional[VideoUrl] = Field( |
| 103 | + description='URL to a (potentially remote) video file that needs to be loaded', |
| 104 | + example='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true', |
| 105 | + default=None, |
| 106 | + ) |
| 107 | + audio: Optional[AudioDoc] = Field( |
| 108 | + description='Audio document document associated with the video', |
| 109 | + default=None, |
| 110 | + ) |
| 111 | + tensor: Optional[VideoTensor] = Field( |
| 112 | + description='Tensor object representing the video which be specified to one of `VideoNdArray`, `VideoTorchTensor`, `VideoTensorFlowTensor`', |
| 113 | + default=None, |
| 114 | + ) |
| 115 | + key_frame_indices: Optional[AnyTensor] = Field( |
| 116 | + description='List of all the key frames in the video', |
| 117 | + example=[0, 1, 2, 3, 4], |
| 118 | + default=None, |
| 119 | + ) |
| 120 | + embedding: Optional[AnyEmbedding] = Field( |
| 121 | + description='Store an embedding: a vector representation of the video', |
| 122 | + example=[1, 0, 1], |
| 123 | + default=None, |
| 124 | + ) |
| 125 | + bytes_: Optional[VideoBytes] = Field( |
| 126 | + description='Bytes representation of the video', |
| 127 | + default=None, |
| 128 | + ) |
106 | 129 |
|
107 | 130 | @classmethod |
108 | 131 | def validate( |
|
0 commit comments