Coder Social home page Coder Social logo

mitjanikolaus / clip2brain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ariaaay/clip2brain

0.0 0.0 0.0 3.62 MB

Code from paper "Natural language supervision with a large and diverse dataset builds better models of human high-level visual cortex"

License: MIT License

Shell 1.88% Python 98.12%

clip2brain's Introduction

clip2brain

DOI

Code from paper "Natural language supervision with a large and diverse dataset builds better models of human high-level visual cortex"

Step 1: Clone the code from Github and download the data

git clone https://github.com/ariaaay/clip2brain.git
cd clip2brain

You will also need to install the natural scene datasets. For downstream analysis you might also need to download coco annotations. It is optional for just running encoding models. The one used for analysis are: 2017 Train/Val annotations (241MB).

(OPTIONAL) Models in comparison to CLIP (SimCLR, SLIP) can be downloaded at: https://github.com/facebookresearch/SLIP?tab=readme-ov-file, under ViT-base structure.

(OPTIONAL) Pycortex DB for the NSD subjects can be downloaded here: https://drive.google.com/drive/folders/1YXAYggtlsfFxMtiqWs0UrMihxI125MHb?usp=sharing

Step 2: Install requirements

Requirements.txt contains the necessary package for to run the code in this project.

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Install torch and torchvision from PyTorch according to your own system setup.

Step 3: Set up paths in config.cfg

Modify config.cfg to reflect local paths to NSD data and COCO annotations. See current config.cfg for an example.

Step 4: Reproduce results!

Note: project_commands.sh by default runs all models for all subjects. If you would like to speed up the process and only test out certain model, please comment out models you don't need.

sh project_commands.sh

clip2brain's People

Contributors

ariaaay avatar

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.