Skip to content

MinaGhadimiAtigh/HyperbolicImageSegmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperbolic Image Segmentation, CVPR 2022

This is the implementation of paper Hyperbolic Image Segmentation (CVPR 2022).

Figure 1

Repository structure

  • assets : images and stuff
  • datasets : contains integer to class dictionaries, and JSON files that contain the hierarchies used.
  • hesp : the actual code containing layers, models, losses, etc.
  • samples : helper files, bash scripts, and train.py

Code is not complete yet.

How to use the code?

For installation, first run pip install -e . to register the package.

Then, run sh requirements.sh to install the requirements.

The code needs Tensorflow 1, the experiments are performed using Tensorflow 1.14. The tensorflow installed by the script is tensorflow-cpu. Change the commands to install tensorflow on GPU.

To train a model, use this code in samples directory.

python train.py --mode segmenter --batch_size 5 --dataset coco --geometry hyperbolic --dim 256 --c 0.1 --freeze_bn --train --test --backbone_init Path_to_resnet/resnet_v2_101_2017_04_14/resnet_v2_101.ckpt --output_stride 16 --segmenter_ident check

The code will train and test a hyperbolic model using coco stuff dataset, with batch size 5, curvature 0.1, freeze batch normalization, output stride 16. The result will be saved in a folder named poincare-hesp/save/segmenter/hierarchical_coco_d256_hyperbolic_c0.1_os16_resnet_v2_101_bs5_lr0.001_fbnTrue_fbbFalse_check in the samples directory.

To get the dataset tfrecord files and resnet pretrained weights, use this link.

Citation

Please consider citing this work using this BibTex entry,

@article{ghadimiatigh2022hyperbolic,
  title={Hyperbolic Image Segmentation},
  author={GhadimiAtigh, Mina and Schoep, Julian and Acar, Erman and van Noord, Nanne and Mettes, Pascal},
  journal={arXiv preprint arXiv:2203.05898},
  year={2022}
}