File size: 382 Bytes
63d858e af858b4 63d858e af858b4 63d858e af858b4 |
1 2 3 4 5 6 7 8 9 10 11 12 |
import pandas as pd
import numpy as np
def get_image_data(csv_file) :
image_data_df = pd.read_csv (csv_file)
image_data_df['text_embeddings'] = image_data_df['text_embeddings'].apply(lambda x: np.fromstring(x[2:-2], sep=' ')).values
image_data_df['text_embeddings'] = image_data_df['text_embeddings'].apply(lambda x: np.reshape(x, (1, -1)))
return image_data_df
|