Skip to main content

Neuro vision-language models.

Project description

NeuroVLM

NeuroVLM maps between neuroimaging activation maps and neuroscience text.

model

Install

Minimal, inference-only installation:

pip install neurovlm

With optional dependencies needed to train and reproduce analyses:

pip install "neurovlm[full]"

Quickstart

Fetch NeuroVLM's datasets:

from neurovlm.data import fetch_data
fetch_data()

Use the NeuroVLM object for text-to-brain and brain-to-text:

from neurovlm import NeuroVLM
from neurovlm.data import load_latent

# Text-to-brain: generation
nvlm = NeuroVLM()
result = nvlm.text(["vision", "default mode network"]).to_brain(head="mse")
result.to_nifti() # returns list of nib.Nifti1Image
result.plot(0, threshold=0.25) # plot image for vision
result.plot(1, threshold=0.15) # plot image for DMN

# Text-to-brain: ranking and retrieval
nvlm = NeuroVLM()
result = nvlm.text("motor").to_brain(head='infonce')
top = result.top_k(2) # each row pairs to a neuorimage that is similar to the text query
top.plot_row(1, threshold=0.1) # WashU atlas
top.plot_row(2, threshold=2.5) # NeuroVault
top.plot_row(4, threshold=0.1) # PubMed

# Brain-to-text: ranking and retrieval
nvlm = NeuroVLM()
result = nvlm.brain(load_latent("networks_neuro")["Du"]["AUD"]).to_text()
result.top_k(5).query("cosine_similarity > 0.4") # return up to 5 examples per dataset

Documentation

See the docs for the API and tutorials.

License

Apache-2.0 (LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neurovlm-0.0.3.tar.gz (79.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurovlm-0.0.3-py3-none-any.whl (87.4 kB view details)

Uploaded Python 3

File details

Details for the file neurovlm-0.0.3.tar.gz.

File metadata

  • Download URL: neurovlm-0.0.3.tar.gz
  • Upload date:
  • Size: 79.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for neurovlm-0.0.3.tar.gz
Algorithm Hash digest
SHA256 184cd8df610a721a56fbee3eb87704b7c2b1b65ac7ea71f9c24db285edffa298
MD5 5d065ccfee8279ef15edbeb2c0af7b24
BLAKE2b-256 d2d2aeae22de60d41e0da9345560836f9a8d3622621a6405cf67e51518034ccc

See more details on using hashes here.

File details

Details for the file neurovlm-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: neurovlm-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 87.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for neurovlm-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3babbf226e9179ffafc074cf1c8e30b90eed40ebe3d3cdc105d936c3c0344e61
MD5 4dd54aa88b3d5639b0f1a4d18cb58220
BLAKE2b-256 2861ba0333cbe8a5450619e918298f989aa200621b5e1ff9303f34d5090d7ea4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page