Integrations
ImageDescription
A client to interact with the image description API. The API is used to generate short phrases that describe an image.
Methods:
Name | Description |
---|---|
summarise_image |
Image) -> str: Summarise the image using the LLaMA API. |
Source code in video_sampler/integrations/llava_chat.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
summarise_image(image)
Summarise the image Args: image (Image): The image to summarise. Returns: str: The description of the image.
Source code in video_sampler/integrations/llava_chat.py
63 64 65 66 67 68 69 70 |
|
ImageDescriptionDefault
Bases: ImageDescription
A client to interact with the LLaMA image description API. The API is used to generate short phrases that describe an image.
Methods:
Name | Description |
---|---|
summarise_image |
Image) -> str: Summarise the image using the LLaMA API. |
Source code in video_sampler/integrations/llava_chat.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
__init__(url='http://localhost:8080/completion')
Initialise the client with the base URL of the LLaMA API. Args: url (str): The base URL of the LLaMA API.
Source code in video_sampler/integrations/llava_chat.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
summarise_image(image)
Summarise the image using the LLaMA API. Args: image (Image): The image to summarise. Returns: str: The description of the image.
Source code in video_sampler/integrations/llava_chat.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
VideoSummary
A client to interact with the LLaMA video summarisation API. The API is used to generate a summary of a video based on image descriptions.
Methods:
Name | Description |
---|---|
summarise_video |
list[str]) -> str: Summarise the video using the LLaMA API. |
Source code in video_sampler/integrations/llava_chat.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
__init__(url='http://localhost:8080/v1')
Initialise the client with the base URL of the LLaMA API. Args: url (str): The base URL of the LLaMA API.
Source code in video_sampler/integrations/llava_chat.py
200 201 202 203 204 205 |
|
summarise_video(image_descriptions)
Summarise the video using the LLaMA API. Args: image_descriptions (list[str]): The descriptions of the images in the video. Returns: str: The summary of the video.
Source code in video_sampler/integrations/llava_chat.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
encode_image(image)
Convert the image to base64
Source code in video_sampler/integrations/llava_chat.py
37 38 39 40 41 42 43 44 45 46 |
|
resize_image(image, max_side=512)
Resize the image to max_side if any of the sides is greater than max_side. If max_side is None, the image is returned as is.
Source code in video_sampler/integrations/llava_chat.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|