embed_images
Function
Calls the CLIP service to convert the image list provided by the user into vectors.
Prototype
def embed_images(images, batch_size)
Parameters
Parameter |
Data Type |
Required/Optional |
Description |
|---|---|---|---|
images |
List[str] |
Required |
Image list. The list length range is [1, 1000], and the string length range is [1, 10 × 1024 × 1024]. Each image is a string encoded using Base64. |
batch_size |
Integer |
Optional |
Batch size. texts of batch_size is combined for embedding each time. The value range is [1, 1024]. The default value is 32. If the value of batch_size is too large, the server may return error code 500. In this case, you need to decrease the value of batch_size. |
Return Value
Data Type |
Description |
|---|---|
List[List[float]] |
Vector array after the conversion of images. If images is an array whose length is 4 and the output of the embedding model is a 512-dimensional vector, the final output result is an array of size (4, 512). |