microsoft / Oscar

Oscar and VinVL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to create train_caption.json on Flickr8k dataset? [Image Captioning task]

hasontung1999 opened this issue · comments

Hello everyone!
I want to run Oscar on Flickr8k. I've already created all the other files like: feature.lineidx , label.lineidx, feature.tsv, label.tsv,...
but I don't know how to create train_caption.json from the captioning annotation of Flickr8k (because I see that train_caption.json of COCO uses attributes: image_id, id, caption; meanwhile, the annotation of Flickr8k uses attributes: image_name, caption).
Anyone knows how to do it? Please help me!
Thanks a lot!

Hi @hasontung1999,

I created a test_caption.json from the Flickr8k dataset but the same code should also work for a train_caption.json

I uploaded my notebook here.

The main idea is to get the flickr8k captions in coco format. For this I created my own indexing (flickr8k:id) and used coco:image_id = flickr8k:image_name.

Hope this was helpful!

@jontooy
Thank you so much!
I'll try and confirm whether it works in my case.
Again, no matter what, thank you a lot 💯

@jontooy It works in my case, too.
Thank you !
But I have another question that how to visuallize learning curve from log.txt (loss, acc, ...).
Is there any func that can do it?

Hi @hasontung1999,

I created a test_caption.json from the Flickr8k dataset but the same code should also work for a train_caption.json

I uploaded my notebook here.

The main idea is to get the flickr8k captions in coco format. For this I created my own indexing (flickr8k:id) and used coco:image_id = flickr8k:image_name.

Hope this was helpful!

Can I have your connection way? I have some troubles want to ask. Thank you!