Metadata-Version: 2.4
Name: cryovit
Version: 0.1.3
Summary: Deep learning automated segmentation models using high-level features from foundation ViT models.
Author-email: Vivian Li <vdl21@cantab.ac.uk>, Sanket Rajan Gupte <sanketg@stanford.edu>
License: MIT License
        
        Copyright (c) 2023 Sanket Gupte
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy==2.2.6
Requires-Dist: scipy==1.15.2
Requires-Dist: pandas==2.3.1
Requires-Dist: scikit-learn==1.3.2
Requires-Dist: h5py==3.14.0
Requires-Dist: mrcfile==1.5.4
Requires-Dist: tifffile==2025.5.10
Requires-Dist: rich==14.0.0
Requires-Dist: torch==2.7.1
Requires-Dist: torchvision==0.22.0
Requires-Dist: torchmetrics==1.8.0
Requires-Dist: pytorch-lightning==2.5.2
Requires-Dist: xformers==0.0.31
Requires-Dist: sam2==1.0.0
Requires-Dist: tensordict==0.9.1
Requires-Dist: hydra-core==1.3.2
Requires-Dist: mkl==2024.2.0
Requires-Dist: typer
Provides-Extra: dev
Requires-Dist: wandb>=0.21.0; extra == "dev"
Requires-Dist: huggingface_hub>=0.34.3; extra == "dev"
Requires-Dist: opencv>=4.12.0; extra == "dev"
Requires-Dist: scikit-learn>=1.3.2; extra == "dev"
Requires-Dist: umap-learn>=0.5.9; extra == "dev"
Requires-Dist: matplotlib>=3.10.5; extra == "dev"
Requires-Dist: seaborn>=0.13.2; extra == "dev"
Requires-Dist: mypy>=1.17.0; extra == "dev"
Dynamic: license-file

# CryoVIT: Efficient Segmentation of Cryo-electron Tomograms with Vision Foundation Models

## Installation Instructions

CryoVIT uses Mamba to manage python packages and dependencies and can be downloaded [here](https://github.com/conda-forge/miniforge). You should also be able to use Conda instead of Mamba but setting up the environment may take an unreasonably long time.

1. Clone the CryoVIT github repository: `git clone https://github.com/VivianDLi/CryoVIT.git`
2. Setup the mamba environment: `mamba env create -f CryoVIT/env.yml`
3. Activate the mamba environment: `mamba activate cryovit_env`

## Usage Instructions

For more details, check out the [documentation](https://cryovit.readthedocs.io/en/latest/).

## Replicating Experiments

All experiments are managed using Hydra, with their configurations stored in `src/cryovit/configs`.

Before running experiments, make sure to change the relevant entries in `src/cryovit/configs/paths/default.yaml`.

You can run a specific experiment using the scripts in the `cryovit.training` module.

For example:

```console
$ mamba activate cryovit_env
$ python -m cryovit.training.dino_features
$ python -m cryovit.training.train_model +experiment=<experiment_config_name>
$ python -m cryovit.training.eval_model +experiment=<experiment_config_name>
```

These commands assume your data is setup in the following format:

```
dataset/
├── sample_1/
│   ├── tomogram1.hdf
│   ├── tomogram2.hdf
│   └── ...
├── sample_2/
│   ├── tomogram1.hdf
│   ├── tomogram2.hdf
│   └── ...
├── sample_3/
│   └── ...
├── sample_4/
│   └── ...
│   ...
```

where each tomogram has a `data` key, with labels saved in `labels/<label_name>` keys.

All figures in the paper were produced using the `cryovit.training.visualize_results` command.
