In This repository you can find the code for both: unsupervised Deep-ContourFlow and One shot learning Deep-ContourFlow.
if you use the the code please cite the following paper:
@misc{habis2024deepcontourflowadvancingactive,
title={Deep ContourFlow: Advancing Active Contours with Deep Learning},
author={Antoine Habis and Vannary Meas-Yedid and Elsa Angelini and Jean-Christophe Olivo-Marin},
year={2024},
eprint={2407.10696},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2407.10696},
}
To use this repository please first install torch-contour:
$pip install torch_contour>=1.3.0
To use Unsupervised DCF just add your image in images_test_unsupervised_dcf
and run the algorithm using the notebook: unsupervised_dcf.ipynb
To replicate the results in the paper ... follow the steps:
- Register to AIDPATHDB using the link https://mitel.dimi.uniud.it/aidpath-db/app/login.php
- Create a folder where data will be saved and write its path in
path_data
inside the config file. Donwload the kidney dataset of AIDPATHDB and put the images in a subfolder calledslides
.
Manual annotations are available in the github in the generate_annotations
folder.
cd ./generate_annotations
python extract_images.py
This code uses annotations.csv
and the slides downloaded in #0 in folder slides
to extract all the patches centered on each dilated tubule and "false dilated tubule".
The code will create in your data folder:
- A subfolder 'masks' with the ground truth masks of the 2 class: "False" and "True" dilated tubule.
- A subfolder 'images' with the correponding images.
- A file contour_init.npy that contains the initial contour corresponding to the detection of lumen for each patch.
cd ./scores
python compute_scores.py
This code take 10 random dilated tubule in each slide and fit the One shot learning DCF and predict for all other object in the slide. It creates a csv file containing all the scores.