GithubHelp home page GithubHelp logo

vqa-vlsp2022's Introduction

Vietnamese Visual Question Answering at VLSP 2022

We use VIT model to encode image, and concate it with text embedding and forward it to mt5 encode decode model. Use DETR detection to get object list from image and use as prefix for text input. We use also question language detection to make prefix for text input. Example text in put for mt5 encode decode :

object: object1 object2 ... ; answer in ja: question

Prepare dataset

Download and unzip at here:

datasets
    private-test-images/
    public-test-images/
    train-images/
    evjvqa_train.json
    evjvqa_public_test.json
    prepared_evjvqa_private_test.json

If you want recreate vqa_train.json,vqa_public_test.json,vqa_private_test.json(question language detection) you can :

Edit input file path and output file path in datasets/predict_language_question.py

cd ./datasets
python predict_language_question.py

If you want recreate *_obj.json(list object from detr dection for each image). You can:

cd ./datasets
python detr_predict_obj.py

Setup ENV

docker build -t nhanv-vqa .

Inference

Download model and push it into outputs. Link download at: ./outputs/download.txt

outputs/
    vit-large-mt5-large/
    vit-large-patch16-224-in21k/

To inference on private test with  file and model is trained. you can run:

./interactive.sh python3 predict.py


Results at ./outputs/results.json

## Traning

To training you run:

./interactive.sh python3 train.py

if GPU is limited, you can set gradient_checkpoiting=True and model.config.use_cache=False in mt5_trainer.py

you can change size of model from large to base in model_params in mt5_trainer.py

vqa-vlsp2022's People

Contributors

bino282 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.