ImageDataBunch.from_df read last column as an image


I am trying to read data from kaggle source
I am reading the csv into dataframe

train_df = pd.read_csv("./kaggle/input/facial-keypoints-detection/training.csv")
test_df = pd.read_csv("./kaggle/input/facial-keypoints-detection/test.csv")
sample_submit_df = pd.read_csv("./kaggle/input/facial-keypoints-detection/SampleSubmission.csv")
lookup_df = pd.read_csv("./kaggle/input/facial-keypoints-detection/IdLookupTable.csv")

But looks like the image is part of the last column but ImageDataBunch.from_df expects a path to a image (as numpy array) in first column.

When I try the below, I get a error.

data = ImageDataBunch.from_df(Path(''), train_df, ds_tfms=tfms, size=24, label_delim = ' ')

No such file or directory: './66.0335639098'
Appreciate some pointers. I am new to fastai.

fn_col is a parameter that takes in the index of the column which is set to default vvalue as 0. You may try -1 instead. Also if the path has a prefix you may have to pass path value which denotes the base path where all images are available.

Consider passing label_col to point the index of the label

I am able to get the dataframe. Thanls