A Benchmark for Virus Infection Reporter Virtual Staining in Fluorescence and Brightfield Microscopy
This code implements the code for A Benchmark for Virus Infection Reporter Virtual Staining in Fluorescence and Brightfield Microscopy paper.
The datasets that we are using are available online. They can be downloaded following the instructions in the papers publishing them, which are referenced in our paper.
After downloading the data, run the data processing scripts that are located in scripts/data_processing
directory, first modifying the paths in them:
- for HAdV data:
preprocess_hadv.py
- for VACV data:
stitch_vacv.py
+preprocess_vacv.py
- for the rest of the viruses:
preprocess_other.py
- to prepare Cellpose predictions:
prepare_cellpose_preds.py
(for cells) andprepare_cellpose_preds_nuc.py
(for nuclei)
Run the following code:
conda create -n myenv python=3.10
conda activate myenv
pip install -r requirements.txt
pip install -e .
- Download the data.
- Modify the config in
configs/
directory with the path to the data you want to use and the directory for outputs. - Run the code from the root directory:
python scripts/training/train_pix2pix.py --config-path $PATH_TO_CONFIG --neptune-token $NEPTUNE_TOKEN
orpython scripts/training/train_unet.py --config-path $PATH_TO_CONFIG --neptune-token $NEPTUNE_TOKEN
.
--neptune-token
argument is optional.
There are multiple scripts available for evaluation:
- testing/evalute.py - to calculate basic metrics such as MSE for all the models and datasets
- testing/evalute_hadv.py - to calculate IoU, F1 etc for HAdV datasets
- testing/evalute_other.py - to calculate IoU, F1 etc for the rest of datasets
- Modify the
scripts/testing/evalute.py
with the correct paths. - Run the code from the root directory:
scripts/testing/evalute.py
.
This repository is released under the MIT License (refer to the LICENSE file for details).