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, brain-to-text, text-to-text, and brain-to-brain:

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

Data and API

  • Data/model fetch and loaders: neurovlm.data
  • Full API reference: docs/api.rst

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.2.tar.gz (52.0 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.2-py3-none-any.whl (59.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: neurovlm-0.0.2.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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.2.tar.gz
Algorithm Hash digest
SHA256 40bc1ae723382ca12ec37ceb0f6a1f8fa779832402e8a6b1f1d7b4156d8f51f7
MD5 79dae423bcc55e2bf618231b0a546d4c
BLAKE2b-256 fe4da6f7c67009e3a229626d5a022d413cafb363bd3f5b0714572d610d363996

See more details on using hashes here.

File details

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

File metadata

  • Download URL: neurovlm-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 59.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f811667bdde215e8ca7715df682f00a59301ca1a9f664ec1e1cf480ddef6fd3d
MD5 fa8f414ffe3b8acecf00f5d95491fdbe
BLAKE2b-256 f5ec959ea53497a19b8ebe6f0604321fc0ec978deb44f657a809af0ad01584ac

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