Git Product home page Git Product logo

sgvl's Introduction

Incorporating Structured Representations into Pretrained Vision & Language Models Using Scene Graphs

This is an official pytorch implementation of the paper Incorporating Structured Representations into Pretrained Vision & Language Models Using Scene Graphs. In this repository, we provide the PyTorch code we used to train and test our proposed SGVL model.

If you find SGVL useful in your research, please use the following BibTeX entry for citation.

@inproceedings{
herzig2023incorporating,
title={Incorporating Structured Representations into Pretrained Vision {\textbackslash}\& Language Models Using Scene Graphs},
author={Roei Herzig and Alon Mendelson and Leonid Karlinsky and Assaf Arbelle and Rogerio Feris and Trevor Darrell and Amir Globerson},
booktitle={The 2023 Conference on Empirical Methods in Natural Language Processing},
year={2023},
url={https://openreview.net/forum?id=7DueCuvmgM}
}

Data Preparation

If you wish to train the model:
(1) Follow the instructions on the official Visual Genome Website and download the images
(2) Download the LAION 400M dataset from LAION

Evaluation Datasets

Follow the instructions for the datasets you wish to evaluate the model on

VL-Checklist

Prepare VL-Checklist datasets as described in https://github.com/om-ai-lab/VL-CheckList/blob/main/DATASETS.md
Run the VL-Checklist setup code

python setup_vlc --VG PATH_TO_VG --Hake PATH_TO_HAKE --Swig PATH_TO_SWIG

Winoground

Fill in your HF authentication token in this file

VSR

Follow the instructions in the VSR repository to download the images
Fill in the path to the images folder here

Installation

Create a conda environment with all packages from yaml file and activate:

conda env create -f environment.yml
conda activate SGVL

Clone the repository

git clone https://github.com/AlonMendelson/SGVL
cd SGVL

Run the code setup file

python setup_code.py

Inference

Download the BLIP-SGVL pretrained weights from this link

Run the evaluation code

bash eval.sh

Training

Download the data and annotations directory

gdown --fuzzy https://drive.google.com/drive/folders/1exie6ivcRb_RR1Lulcm2-Kdsky4JQgV6?usp=drive_link --folder

Download the BLIP model base checkpoint

mkdir BLIP/pretrained_checkpoints
wget https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base.pth -P BLIP/pretrained_checkpoints

Run the train code

bash train.sh

sgvl's People

Contributors

alonmendelson avatar

Stargazers

Keyi Wang avatar SDU-liuyuan avatar  avatar Kwan Ho Ryan Chan avatar Jeff Carpenter avatar  avatar mori yuichiro avatar  avatar Youngtaek Oh avatar lizhaoliu avatar  avatar yahooo avatar  avatar Vishaal Udandarao avatar

Watchers

Youngtaek Oh avatar  avatar

sgvl's Issues

How to obtain the results shown in the paper

Hi, thanks for you great work! Any config files or bash files can used for evaluate the VLMs for obtaining the results shown in the paper? Or how can I train & eval it? Thanks!

Release of pre-trained models

Hey, a very interesting work -- enjoyed reading it. May I please know if you have any plan to release the trained model weights?
Thanks a lot!

Code release?

Hey, thanks for your great work -- it was an enjoyable read, do you have a timeline for when you are planning to release your code and models?
Thanks!

ARO Evaluation

Hi, really nice work! I have a question about the ARO results of LLava and miniGPT4 reported in the paper. Since these model are generative VLMs and obtain really high scores, I wonder how are the scores calculated? Moreover, is the reported score top1acc or top5acc.

Release of fine-tuned CLIP checkpoint

It's really insightful interesting work!
It seems that the fine-tuned SGVL-BLIP can be found on the repository, but do you have any plan to also release the fine-tuned CLIP counterpart (i.g., SGVL-CLIP) and its corresponding code?
At this point, I think the inference part would be enough for me!

Thanks,

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.