Git Product home page Git Product logo

iccv21_relational_direction's Introduction

Interaction Compass: Multi-Label Zero-Shot Learning of Human-Object Interactions via Spatial Relations

Overview

This repository contains the implementation of Multi-Label Zero-Shot Learning of Human-Object Interactions via Spatial Relations.

In this work, we develope a compositional model to recognize unseen human interactions based on spatial relations between human and objects.

Image


Prerequisites

To install all the dependency packages, please run:

pip install -r requirements.txt

Data Preparation

  1. Please download and extract information into the ./data folder. We include details about download links as well as what are they used for in each folder within `./data' folder.

  2. Please run feature extraction scripts in ./extract_feature folder to extract features from the last convolution layers of ResNet as region features for the attention mechanism:

python ./extract_feature/hico_det/hico_det_extract_feature_map_ResNet_152_padding.py				                                    #create ./data/DeepFashion/feature_map_ResNet_101_DeepFashion_sep_seen_samples.hdf5
python ./extract_feature/visual_genome/visual_genome_extract_feature_map_ResNet_152_padding.py						            #create ./data/AWA2/feature_map_ResNet_101_AWA2.hdf5

as well as word embedding for zero-shot learning:

python ./extract_feature/hico_det/hico_extract_action_object_w2v.py						                                                                  #create ./data/CUB/feature_map_ResNet_101_CUB.hdf5
python ./extract_feature/visual_genome/visual_genome_extract_action_object_w2v.py						                                       #create ./data/SUN/feature_map_ResNet_101_SUN.hdf5

Experiments

  1. To train cross attention on HICO/VG datasets under different training splits (1A/1A2B), please run the following commands:
# HICO experiments
python ./experiments/hico_det/hico_det_pad_CrossAttention.py --partition train_1A --idx_GPU 1 --save_folder ./results/HICO_1A --mll_k_3 7 --mll_k_5 10 --loc_k 10             #1A setting
python ./experiments/hico_det/hico_det_pad_CrossAttention.py --partition train_1A2B --idx_GPU 2 --save_folder ./results/HICO_1A2B --mll_k_3 7 --mll_k_5 10 --loc_k 10     #1A2B setting

# Visual Genome experiments
python ./experiments/visual_genome_pad/VG_pad_CrossAttention.py --partition train_1A --idx_GPU 4 --save_folder ./results/VG_1A --mll_k_3 7 --mll_k_5 10               #1A setting
python ./experiments/visual_genome_pad/VG_pad_CrossAttention.py --partition train_1A2B --idx_GPU 5 --save_folder ./results/VG_1A2B --mll_k_3 7 --mll_k_5 10       #1A2B setting

Pretrained Models

For ease of reproducing the results, we provided the pretrained models for:

Dataset Setting Model
HICO 1A2B download
HICO 1A download
VisualGenome 1A2B download
VisualGenome 1A download

To evaluate pretrained model, please run:

python ./experiments/hico_det/hico_det_pad_CrossAttention.py --partition train_1A2B --idx_GPU 0 --save_folder ./results/HICO_1A2B --mll_k_3 7 --mll_k_5 10 --loc_k  --load_model ./pretrained_model/model_final_HICO_1A2B.pt

where ./pretrained_model/model_final_HICO_1A2B.pt is the path of the corresponding pretrained model.


Citation

If you find the project helpful, we would appreciate if you cite the works:

@article{Huynh:ICCV21,
  author = {D.~Huynh and E.~Elhamifar},
  title = {Interaction Compass: Multi-Label Zero-Shot Learning of Human-Object Interactions via Spatial Relations},
  journal = {International Conference on Computer Vision},
  year = {2021}}

iccv21_relational_direction's People

Contributors

hbdat avatar

Stargazers

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

Watchers

 avatar

iccv21_relational_direction's Issues

the performance gap between mine and yours

Hello, hbdat:
Recently, I reproduce your work, but i encounter some problem, the chart is shown as below, the "fuxian" means my reproduced results and "paper" means the performance you reported in paper. The parameters I used are: epochs=10, batch_size=32, label_type='interaction', --partition train_1A, --mll_k_3 7, --mll_k_5 10, ----loc_k 10, and other parameters i don't change it. Looking forward to your reply, thanks!

image

image

Tentative Timeline

Hello, thanks for your nice work. Is there any timeline to release the code?

File missing

Hello! I was running the hico dataset and following the data preparation instruction. But the code cannot run and it reports missing the /data/hico_20160224_det/json/hoi_list.json file. I cannot find this file from the oringinal tar.gz file of hico dataset. Looking forward for your help, thx.

About the experimental reproduction results

Hi hdbat:
thanks for your nice work and I am very interested in this paper. However, after the code is finished trained, I get the following results.
In 1A setting.
"detail_human.csv & model_final.pt & partition_F1_3.csv & ranking_k_10.csv & stats.csv detail_hoi.csv & detail_object.csv & partition_AP.csv & partition_F1_5.csv & ranking_k_7.csv"
image
image

This is inconsistent with the results reported in the paper. Can you tell me how to reproduce it
Best

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.