Loading image data from pandas to pytorch


I am completely new to pytorch and have previously worked on keras and fastai. Currently trying an image regression task and the challenge is I have to load the data from pandas dataframe. Data frame structure:

ID Path Score

fig1 /folder/fig1.jpg 2

fig2 /folder/fig2.jpg 3

I have previously worked on loading images to pytorch directly from folders because it was a simple classification task but kind of stuck now.

I already have created the transformations i need but stuck at this data loading part.

You could create a custom Dataset as described here.
Inside the __init__ you could store the DataFrame, and load each row in __getitem__ e.g. via self.df.iloc[idx].
Once you have the row, you could get the path and score, load and process the image, and return the data and target.

Let me know, if you get stuck somewhere.