Note
Currently only Linux System is supported.
Framework
- jax==0.4.26[cuda12_pip]
- tensorflow==2.8.4 (Nvidia-GPU version)
pip
- dm-haiku
- learned optimizer (lopt)
- optax
- ipywidgets
- tifffile
- opencv-python
- matplotlib
- pandas
- learned-optimization
- clone this repository:
git clone https://github.com/daviddaiiiii/INIF.git
- Create the conda environment and activate:
conda deactivate conda create -n INIF python=3.10 conda activate INIF
- Run the
setup.sh
file to install automatically:These codes would:chmod +x setup.sh ./setup.sh
- Give the script execution permissions
- Install the dependencies via
pip
Tip
In case of issues when downloading the weight of learned optimizers automatically from Google Cloud, below are some workaround:
Some workaround:
-
We provide the default weight and continue trained weight in '../INIF/Learned_optimizer_weight'
-
go to '../anaconda3/envs/INIF/lib/pythonX.XX/site-packages/learned_optimization/research/general_lopt/pretrained_optimizers.py'
💡
ctrl
+click
on 'from learned_optimization.research.general_lopt import pretrained_optimizers' to jump to the file -
replace the path in line143 to '../INIF/Learned_optimizer_weight
_pretrain_no_config_root = 'gs://gresearch/learned_optimization/pretrained_lopts/no_config/'
- Install docker if you don't have it: get-docker
Important
To utilize GPU, nvidia-docker package is also required.
-
retrieve the docker image from the dockerhub:
docker pull pkuhmi/inif_env:latest
-
start a container:
docker run --gpus all -it --rm --shm-size 16G --ulimit memlock=-1 -v ./INIF:/INIF/ --name inif pkuhmi/inif_env:latest
where:
--gpus
: use the gpu-it
: interact with the container--rm
: remove the container after exit--shm-size
: set the shared memory size to avoid memory issues--ulimit memlock=-1
: remove mem lock limit-v
: mount the current directory to the container--name
: name the container
Tip
We recommend to use the VSCode Docker extension to attach the container to the VSCode workspace and run the tutorial.
Please cite our work if you find it useful.
@article{dai2024implicit,
title={Implicit Neural Image Field for Biological Microscopy Image Compression},
author={Dai, Gaole and Tseng, Cheng-Ching and Wuwu, Qingpo and Zhang, Rongyu and Wang, Shaokang and Lu, Ming and Huang, Tiejun and Zhou, Yu and Tuz, Ali Ata and Gunzer, Matthias and others},
journal={arXiv preprint arXiv:2405.19012},
year={2024}
}
We provide a google colab notebook that demonstrates how to use INIF for the general image compression:
You can also try it out locally by following the tutorial.