microsoft / Oscar

Oscar and VinVL
MIT License
1.03k stars 248 forks source link

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

Closed hasontung1999 closed 2 years ago

hasontung1999 commented 2 years ago

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!

jontooy commented 2 years ago

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!

hasontung1999 commented 2 years ago

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

hasontung1999 commented 2 years ago

@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?

yan9qu commented 2 years ago

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!