imageqa-san icon indicating copy to clipboard operation
imageqa-san copied to clipboard

Can't get the results of yes/no, number and other question.

Open wanmeiziyoulan opened this issue 8 years ago • 6 comments

Hi, I have downloaded the vqa data (the link has been provided) and run the training. But the pkl file deserialized are some arrays, so I don't known how to distinguish the type of yes/no, number and other. How can I get the result of specific type of question?

Thank you, WeimingZhang

wanmeiziyoulan avatar Nov 30 '16 01:11 wanmeiziyoulan

Hi,

I just pushed a script data_vqa/preprocess_data.py which I used to preprocess the data. You can rerun it to get the question type information.

best, zichao

zcyang avatar Nov 30 '16 02:11 zcyang

@zcyang Thanks a lot!

wanmeiziyoulan avatar Nov 30 '16 02:11 wanmeiziyoulan

@zcyang And I find that there are some problems in preprocess_data.py(line 67-80):

for idx, q_id in enumerate(train_question_ids):
    question = vqa.loadQuestion(q_id)[0]
    question = process_sentence(question)
    question = question.split()
    for word in question:
        question_dict_count[word] = question_dict_count.get(word, 0) + 1
    answer = vqa.loadAnswer(q_id)[0]
    answer_new = [process_answer(ans) for ans in answer]
    for word in answer_new:
        answer_dict_count[word] = answer_dict_count.get(word, 0) + 1
    train_questions.append(question)
    train_answers.append(answer)
    if idx % 1000 == 0:
        print 'finished processing %d in train' %(idx)

there are no methods like vqa.loadQuestion, vqa.loadAnswer in vqa tools: https://github.com/VT-vision-lab/VQA, are there some other codes for this?

And there are 10 answers for a question in VQA dataset, so do you just select one answer randomly or get all 10 answers as labels during training process for both open-ended and multiple choice task?

Looking for your reply, thanks~

mikirui avatar Dec 24 '16 14:12 mikirui

@marielladimiccoli Sorry, I can't find the codes for it. If you just want to preprocess the VQA dataset, I think https://github.com/jiasenlu/HieCoAttenVQA/tree/master/prepro may be good for you, but the processed data may not have the same format as this project.

mikirui avatar Jan 09 '17 15:01 mikirui

Hi,

Thank you !

I actually need just to execute the preprocess_data.py of @zcyang, https://github.com/zcyang

finally could you do it?

so I need the methods loadQuestion and LoadAnswer() for that, How did you do?


Da: mikirui [email protected] Inviato: lunedì 9 gennaio 2017 16.06.48 A: zcyang/imageqa-san Cc: marielladimiccoli; Mention Oggetto: Re: [zcyang/imageqa-san] Can't get the results of yes/no, number and other question. (#6)

@marielladimiccolihttps://github.com/marielladimiccoli Sorry, I can't find the codes for it. If you just want to preprocess the VQA dataset, I think https://github.com/jiasenlu/HieCoAttenVQA/tree/master/prepro may be good for you, but the processed data may not have the same format as this project.

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/zcyang/imageqa-san/issues/6#issuecomment-271307284, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARDZ5dgq_g8GkfgoLA6c4aYCaYLQgrzhks5rQk0IgaJpZM4K_sen.

marielladimiccoli avatar Jan 09 '17 18:01 marielladimiccoli

@marielladimiccoli Sorry, I didn't run the code finally... I just want to know how they process VQA dataset. Maybe you can try to replace question = vqa.loadQuestion(q_id)[0] answer = vqa.loadAnswer(q_id)[0] by question = vqa.qqa[q_id]['question'] qa = vqa.loadQA(q_id)[0] answer = qa['multiple_choice_answer']

But I haven't try the replaced code I mentioned, if there are some mistakes, I think you can check the API in https://github.com/VT-vision-lab/VQA/blob/master/PythonHelperTools/vqaTools/vqa.py and then check the structure of VQA dataset in http://visualqa.org/download.html

mikirui avatar Jan 10 '17 05:01 mikirui