Views
No views yet
ImageEncodingResult dataclass and how it is serialized into a dictionary. The ImageEncodingResult dataclass contains two fields: image_encoded and image_encoded_average. When the results are returned, they are converted into a list of dictionaries, where each dictionary represents the serialized form of an ImageEncodingResult object.1{
2 "results": [
3 {
4 "image_encoded": [
5 [float, float, ...], // List of lists of floats representing the full encoded embeddings
6 [float, float, ...],
7 ...
8 ],
9 "image_encoded_average": [float, float, ...] // List of floats representing the average of the embeddings
10 },
11 {
12 "image_encoded": [
13 [float, float, ...],
14 [float, float, ...],
15 ...
16 ],
17 "image_encoded_average": [float, float, ...]
18 },
19 ...
20 ]
21}results: This is a list where each element corresponds to the encoding result of an image.
image_encoded: A list of lists of floats. Each inner list represents the full encoded embeddings for a specific part of the image (e.g., patches or regions).image_encoded_average: A list of floats representing the average of the embeddings across all parts of the image.1{
2 "results": [
3 {
4 "image_encoded": [
5 [0.12, 0.34, 0.56, ...],
6 [0.23, 0.45, 0.67, ...],
7 ...
8 ],
9 "image_encoded_average": [0.18, 0.39, 0.61, ...]
10 },
11 {
12 "image_encoded": [
13 [0.45, 0.67, 0.89, ...],
14 [0.56, 0.78, 0.90, ...],
15 ...
16 ],
17 "image_encoded_average": [0.50, 0.72, 0.89, ...]
18 }
19 ]
20}1{
2 "error": "Invalid image data: <error_message>"
3}