Giter Site home page Giter Site logo

libra's Introduction

Model-Agnostic Gender Debiased Image Captioning (CVPR 2023)

This repository contains source code for the paper titled: "Model-Agnostic Gender Debiased Image Captioning" (Accepted to CVPR 2023). [paper]

Installation

To set up your environment to run the project, follow these steps:

  • Requirements:

    • PyTorch 1.11.0
    • Torchvision 0.12.0
    • CUDA 11.3
  • Install Dependencies: Run the following command to install the necessary packages:

    pip install -r requirements.txt
    python3 -m spacy download en_core_web_sm

Usage

Data preparation

  • Download COCO 2014 (train and validation sets) from https://cocodataset.org/.
  • Place .pkl file of the output captions of an image captioning model in Data. Please refer to oscar_preds.pkl in Data for the format.

Model preparation

Download the trained model from here and place it in Models.

Generate Debiased Captions

To generate debiased captions, run the following command:

python gpt2_generate_debiased_cap.py \
--pred_cap_path Data/oscar_preds.pkl \
--model_path Models/libra_final.pth \
--image_dir path/to/coco/val2014/directory \
--rand_test_ipt_mask True
--rand_mask_rate 0.2

Citation

If you use this project in your research or wish to refer to the baseline results published in the paper, please use the following .bib entry.

@inproceedings{hirota2023model,
  title={Model-Agnostic Gender Debiased Image Captioning},
  author={Hirota, Yusuke and Nakashima, Yuta and Garcia, Noa},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={15191--15200},
  year={2023}
}

TODOs

  • Debiased Caption Generation
  • Training (Upcoming feature)

Feel free to contribute to this project or suggest improvements. Your feedback and contributions are greatly appreciated!

libra's People

Contributors

rebnej avatar

Stargazers

Huy Lê avatar Hankyeol Lee avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

hk1ee

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.