Giter VIP home page Giter VIP logo

causal_comp's Introduction

A causal view of compositional zero-shot recognition

This repository hosts the dataset and source code for the paper "A causal view of compositional zero-shot recognition". Yuval Atzmon, Felix Kreuk, Uri Shalit, Gal Chechik, NeurIPS 2020 (Spotlight)

Code

Setup

Build docker image:

cd docker_cfg
docker build --network=host -t causal_comp -f Dockerfile .
cd ..

Prepare UT Zappos50KUT with TMN split:

To reproduce Zappos50KUT results according to TMN evaluation split, you should prepare the dataset according to taskmodularnets: https://github.com/facebookresearch/taskmodularnets

The Zappos50KUT dataset is for academic, non-commercial use only, released by:

  • A. Yu and K. Grauman. "Fine-Grained Visual Comparisons with Local Learning". In CVPR, 2014.
  • A. Yu and K. Grauman. "Semantic Jitter: Dense Supervision for Visual Comparisons via Synthetic Images". In ICCV, 2017.

Reproduce Zappos experiment.

Notes:

  1. Set DATA_DIR to the directory containing the data.
  2. Set SEED to [0..4]
  3. Set SOURCE_CODE_DIR to the current project workdir
  4. Set OUTPUT_DIR to the directory to save the result
SEED=0  # set seed \in [0..4]
SOURCE_CODE_DIR=$HOME/git/causal_comp_prep/
DATA_DIR=/local_data/zap_tmn # SET HERE THE DATA DIR
DATASET=zap_tmn
OUTPUT_DIR=/tmp/output/causal_comp_${DATASET}__seed${SEED}

# prepare output directory
mkdir -p ${OUTPUT_DIR} 
rm -r ${OUTPUT_DIR}/* 
# run experiment
docker run --net=host -v ${SOURCE_CODE_DIR}:/workspace/causal_comp -v ${DATA_DIR}:/data/zap_tmn -v ${OUTPUT_DIR}:/output --user $(id -u):$(id -g)  --shm-size=1g --ulimit memlock=-1 --ulimit stack=6710886  --rm -it causal_comp /bin/bash -c "cd /workspace/causal_comp/; python experiment_zappos_TMNsplit.py --seed=${SEED} --output_dir=/output --data_dir=/data/zap_tmn --use_wandb=0"

Reproduce AO-CLEVr experiments.

Hyperparams for reproducing the results will be published soon

AO-CLEVr Dataset

AO-CLEVr is a new synthetic-images dataset containing images of "easy" Attribute-Object categories, based on the CLEVr framework (Johnson et al. CVPR 2017). AO-CLEVr has attribute-object pairs created from 8 attributes: { red, purple, yellow, blue, green, cyan, gray, brown } and 3 object shapes {sphere, cube, cylinder}, yielding 24 attribute-object pairs. Each pair consists of 7500 images. Each image has a single object that consists of the attribute-object pair. The object is randomly assigned one of two sizes (small/large), one of two materials (rubber/metallic), a random position, and random lightning according to CLEVr defaults.

Examples of AO-CLEVr images

The dataset can be accessed from the following url.

Cite the paper

If you use the contents of this project, please cite our paper.

@inproceedings{neurips2020_causal_comp_atzmon,
 author = {Atzmon, Yuval and Kreuk, Felix and Shalit, Uri and Chechik, Gal},
 booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
 title = {A causal view of compositional zero-shot recognition},
 year = {2020}
}

For business inquiries, please contact [email protected]
For press and other inquiries, please contact Hector Marinez at [email protected]

causal_comp's People

Contributors

yuvalatzmon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ozziko zhazhat

causal_comp's Issues

problem of building docker

hi, when I build docker image, I meet this problem:

Sending build context to Docker daemon 3.072kB Step 1/20 : FROM nvcr.io/nvidia/pytorch:20.01-py3 Get "https://nvcr.io/v2/": x509: certificate is valid for staging.cbt-s.net, not nvcr.io

This is my first use docker, may be this problem means the problem of Docker Registry?

Looking forward to your help, thank you!

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.