Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wanmeiziyoulan opened this issue Nov 30, 2016 · 6 comments
Open

Comments

@wanmeiziyoulan
Copy link

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

@zcyang
Copy link
Owner

zcyang commented Nov 30, 2016

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

@wanmeiziyoulan
Copy link
Author

@zcyang Thanks a lot!

@mikirui
Copy link

mikirui commented Dec 24, 2016

@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
Copy link

mikirui commented Jan 9, 2017

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

@marielladimiccoli
Copy link

marielladimiccoli commented Jan 9, 2017 via email

@mikirui
Copy link

mikirui commented Jan 10, 2017

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants