Neuro vision-language models.
Project description
NeuroVLM
NeuroVLM maps between neuroimaging activation maps and neuroscience text.
Install
pip install -e .
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
Release history Release notifications | RSS feed
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.1.tar.gz
(5.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neurovlm-0.0.1.tar.gz.
File metadata
- Download URL: neurovlm-0.0.1.tar.gz
- Upload date:
- Size: 5.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
438d77a8944293342d5bd8995ef636abe6b60815be4a138295f088a221faf133
|
|
| MD5 |
47897d24ac39e994a9471eebec987c1e
|
|
| BLAKE2b-256 |
a1487f0bfd2da9407596d8322d26057e3def75830ad0800d2fbae743e73e4aed
|
File details
Details for the file neurovlm-0.0.1-py3-none-any.whl.
File metadata
- Download URL: neurovlm-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00450cd2fc317a4daf18528ab787ccaab53507bbafceb672091ce4290a5b99fa
|
|
| MD5 |
d8f03a8d2eb89216c2daa615505d495c
|
|
| BLAKE2b-256 |
aab80a8506a41ebb1caf3195798e5a5baaab243be596f98d65d5b70fe2e01cb0
|