A scalable framework for fMRI dataset aggregation and modeling of human vision
Project description
mosaic-dataset
python module to load the mosaic dataset (Lahner et al.)
pip install git+https://github.com/Mayukhdeb/mosaic-dataset.git
import mosaic
dataset = mosaic.load(
names_and_subjects={
"nsd": [2,3],
"deep_recon": "all",
},
folder="/research/datasets/mosaic-dataset"
)
print(dataset[0])
Visualization
import mosaic
from mosaic.utils import visualize
from IPython.display import IFrame
dataset = mosaic.load(
names_and_subjects={
"bold_moments": [1],
},
folder="/research/datasets/mosaic-dataset"
)
visualize(
betas=dataset[0]["betas"],
## set rois to None if you want to visualize all of the rois
rois=[
"L_FFC",
"R_FFC",
],
## other modes are: 'white', 'midthickness', 'pial', 'inflated', 'very_inflated', 'flat', 'sphere'
mode = "midthickness",
save_as = "plot.html",
)
Loading pre-trained models
import mosaic
model = mosaic.from_pretrained(
backbone_name="resnet18",
vertices="visual",
framework="multihead",
subjects="all"
)
Running inference with pre-trained models:
from mosaic.utils.inference import MosaicInference
from PIL import Image
inference = MosaicInference(
model=model,
batch_size=32,
device="cuda:0"
)
results = inference.run(
images = [
Image.open("cat.jpg"),
Image.open("cat.jpg")
]
)
## (2, num_voxels)
print(results.shape)
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
mosaic_dataset-0.0.0.tar.gz
(32.3 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 mosaic_dataset-0.0.0.tar.gz.
File metadata
- Download URL: mosaic_dataset-0.0.0.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2176854aba6f889d5695fbf7cc5a22b2512f0f96e3e1ff3c61a72904f91149c6
|
|
| MD5 |
887acbe8d9865f30185193ae37471c34
|
|
| BLAKE2b-256 |
fac00fa2c54f32b14589960e8446d9281c53efe1942ee315c937eebe0237dbf2
|
File details
Details for the file mosaic_dataset-0.0.0-py3-none-any.whl.
File metadata
- Download URL: mosaic_dataset-0.0.0-py3-none-any.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a356b78f47738ca607adad290938ed4c4552742179ee9cecb347cd024faee203
|
|
| MD5 |
2cb15a2167e94a318f0473d2333f57cd
|
|
| BLAKE2b-256 |
0058bb182eb91bde1bbdaf6ae58dbe64693561faca85698e5844f045e2e916ce
|