{"id":19184189,"url":"https://github.com/princeton-vl/think_visually","last_synced_at":"2025-05-08T00:03:03.887Z","repository":{"id":39740484,"uuid":"133092521","full_name":"princeton-vl/think_visually","owner":"princeton-vl","description":"Code for ACL 2018 paper 'Think Visually: Question Answering through Virtual Imagery'","archived":false,"fork":false,"pushed_at":"2023-03-24T22:22:57.000Z","size":23,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T05:32:07.126Z","etag":null,"topics":["acl","dataset","memory-network","pretrained-models","question-answering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/princeton-vl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-11T22:00:53.000Z","updated_at":"2025-01-20T10:45:20.000Z","dependencies_parsed_at":"2025-04-20T05:40:52.307Z","dependency_job_id":null,"html_url":"https://github.com/princeton-vl/think_visually","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princeton-vl%2Fthink_visually","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princeton-vl%2Fthink_visually/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princeton-vl%2Fthink_visually/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princeton-vl%2Fthink_visually/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/princeton-vl","download_url":"https://codeload.github.com/princeton-vl/think_visually/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973678,"owners_count":21834107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acl","dataset","memory-network","pretrained-models","question-answering"],"created_at":"2024-11-09T11:06:40.298Z","updated_at":"2025-05-08T00:03:03.744Z","avatar_url":"https://github.com/princeton-vl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Training and Evaluation Code \n\n[**Think Visually: Question Answering through Virtual Imagery**](http://bit.ly/think_visually_paper)  \n[Ankit Goyal](http://imankgoyal.github.io), [Jian Wang](http://jianwang.me/), [Jia Deng](https://www.cs.princeton.edu/~jiadeng/)  \n*Annual Meeting of the Association for Computational Linguistics (ACL), 2018*\n\n## Getting Started\n\nFirst download/clone the repository. We would refer to the directory containing the code as `\u003cthink_visually dir\u003e`.\n\n```\ngit clone git@github.com:umich-vl/think_visually.git\n```\n\n#### Requirements\nOur current implementation only supports GPU so you need a GPU and need to have CUDA installed on your machine. We used Python version **3.5.3**, CUDA version **8.0.44** and cuDNN version **8.0-v5**.\n\n#### Install Libraries\nWe recommend to first install [Anaconda](https://anaconda.org/) and create a virtual environment.\n```\nconda create --name think_visually python=3.5\n```\n\nActivate the virtual environment and install the libraries. Make sure you are in `\u003cthink_visually dir\u003e`.\n```\nsource activate think_visually\npip install -r requirements.txt\n```\n\n#### Download Datasets and Pre-trained Models\nDownload all the folders [here](http://bit.ly/think_visually_acl_2018). Unzip them and put them in `\u003cthink_visually dir\u003e`.\n\n## Code Organization\n\n- `\u003cthink_visally dir\u003e/model.py`: The main python script for creating model graph, training and testing.\n\n- `\u003cthink_visally dir\u003e/configs`: It contains various sample config files. `model.py` uses a config file to decide the model (`DSMN`/`DMN+`), the dataset used (`FloorPlanQA`/```ShapeIntersection```), various model parameters (like learning rate) etc. More information about the configuration files is present in `\u003cthink_visually dir\u003e/configs/README.md`. \n\n- `\u003cthink_visally dir\u003e/results`: It contains all the pretrained models as well as training curves for the pre-trained models.\n\n- `\u003cthink_visally dir\u003e/utils`: It contains various utility files for data loading, preprecessing and common neural-net layers.  \n\n- `\u003cthink_visally dir\u003e/data_FloorPlanQA`: It contains all the FloorPlanQA dataset. More information about various files in that folder is in `\u003cthink_visually dir\u003e/data_FloorPlanQA/README.md`.\n\n- `\u003cthink_visally dir\u003e/data_ShapeIntersection`: It contains all the ShapeIntesection dataset. More information about various files in that folder is in `\u003cthink_visually dir\u003e/data_ShapeIntesection/README.md`.\n\n## Running Experiments\n\nTo train and evaluate a model use the `model.py` script with a config file.\n```\npython model.py \u003crelative path to config file\u003e\n```\n\nFor example, to load the pretrained `DSMN` model on the `FloorPlanQA` dataset and evaluate it, use the following command.\n```\npython model.py configs/DSMN_FloorPlanQA.yml\n```\n\nSimilarly to load the pretrained `DSMN` model on the `FloorPlanQA` dataset with 0.78125% partial suprevision, use the following command.\n```\npython model.py configs/DSMN_FloorPlanQA_sup_0.0078125.yml\n```\n\nNote that in order to train from scratch you need to set the `pretrained` flag in the config file to 0. More information about how to set up a config file is in `\u003cthink_visually dir\u003e/configs/README.md`.\n\n**ADVICE**: As mentioned in the paper we found the `DMN+`/`DSMN` models to be unstable across runs. For consistent results, we recommend running the same model (with random initialization) atleast 10 / 20 times (you can use the run flag in the config file). The `DSMN#` model (i.e. `DSMN` with intermediate supervision) is relatively stable and requires less runs.\n\n**UPDATE**: We reran all models on ShapeInterection so the results of the pretrained models are `+- 2%` of reported in the paper.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinceton-vl%2Fthink_visually","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprinceton-vl%2Fthink_visually","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinceton-vl%2Fthink_visually/lists"}