Python implementation of the img2net algorithm proposed in:
- [1] Baptista Diego and De Bacco Caterina. 2021. Principled network extraction from images R. Soc. open sci. 8210025210025 .
If you use this tool please cite [1].
code/
:img2net-core/
: main files used to extract the networks from the images.metrics/
: scripts used to compute the metrics exhibited in [1].test/
: test files.
figures/
: README figures.
This repository uses some of the functions proposed on the repository Nextrout[2], thus, it is necessary to clone it:
That repository itself needs some dependecies coming from some GitLab repositories, so you will need an account.
Once Nextrout is cloned, the next step is to install the other python packages found in requirements.txt
:
pip install -r requirements.txt
Please locate Img2net
and Nextrout
at the same level, i.e.,
- folder
- ...
- Image2Net
- Nextrout
- ...
To test the tool, please go the folder test
inside code
folder and execute
python test_img2net.py
This will execute img2net on a test image contained in the input
folder; results will be stored in the folder runs
.
- [2] Baptista, D., Leite, D., Facca, E. et al. Network extraction by routing optimization. Sci Rep 10, 20806 (2020). https://doi.org/10.1038/s41598-020-77064-4