Skip to content

Using csv for images and captions with training_clip #53

Answered by rbunn80110
rbunn80110 asked this question in Q&A
Discussion options

You must be logged in to vote

I went with this for now:

df = pd.read_csv("captions.csv")

cids = df.index

def read_image(cid):
    img = PILImage.create(df.iloc[[cid]]["filename"].values[0])
    return img

def read_text(cid):
    caption = df.iloc[[cid]]["caption"].values[0]
    return caption

def dummy_targ(o): return 0 # loss func is not called without it

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rbunn80110
Comment options

Answer selected by rbunn80110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant