Git Product home page Git Product logo

lavise's Introduction

Requirements

Data

  • Please follow the instructions in the COCO API README and here to download and setup the COCO2017 data. Link the dataset under data/coco. The folder data/coco should contain the folders val2017, train2017 and files annotations/instances_val2017.json, and annotations/instances_train2017.json.

Packages

PyTorch, torchvision, wandb, and torchtext. A full list can be found in requirements.txt.

Training

to train an explainer on COCO for 50 epochs on layer4 representations of a ResNet50 trained on ImageNet, run

python train_explainer.py --layer layer4 --refer coco --wandb False --epochs 50 --name run_name

set wandb to True to log using wandb. Training on a single 24gb GPU takes 1-2 days.

To visualize filters on wandb using the trained explainer, run:

python infer_filter.py --layer layer4 --name run_name --wandb True --refer coco

Line 200 in infer_filter.py can be uncommented to visualize the filters without wandb Here is the readme from the OG LaViSE repository:

OG LaViSE README

This is the official repository for paper "Explaining Deep Convolutional Neural Networks via Unsupervised Visual-Semantic Filter Attention" to appear in CVPR 2022.

Authors: Yu Yang, Seungbae Kim, Jungseock Joo

alt text

Datasets

  • Please follow the instructions in the COCO API README and here to download and setup the COCO data.
  • We load the pretrained GloVe word embeddings directly from the torchtext library.

Social Media Photographs of US Politicians (PoP)

  • The list of entities used to discover new concepts is provided in data/entities.txt.

Getting started

Requirements

Required packages can be found in requirements.txt.

Usage

Train an explainer with

python train_explainer.py

Explain a target filter of any model with

python infer_filter.py

More features will be added soon! ๐Ÿป

Citation

@inproceedings{yang2022explaining,
    author    = {Yang, Yu and Kim, Seungbae and Joo, Jungseock},
    title     = {Explaining Deep Convolutional Neural Networks via Unsupervised Visual-Semantic Filter Attention},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year      = {2022},
}

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.