This is our official implementation of HyRo!
[Project Page] [Colab]
HyRo refines semantic alignment by rotating embeddings in hyperbolic space, reducing the angle between visual and textual features (from
We tackle semantic misalignment in open-vocabulary semantic segmentation by proposing (1) HyRo, a hyperbolic rotation module for angular refinement, and (2) a hyperbolic fine-tuning framework that decouples semantic alignment (angle) from hierarchical alignment (radius).
Please follow installation.
Please follow dataset preperation, or download the complete dataset from this Kaggle Dataset.
You can download the model weights, install the required dependencies, and run the demo using the following command:
python demo/demo.py --config-file configs/vitb_384_hyperbolic.yaml --input path/to/input --output path/to/output --opts MODEL.WEIGHTS path/to/weightsAlternatively, you can run the demo directly in Colab: .
We provide shell scripts for training and evaluation. run.sh trains the model in default configuration and evaluates the model after training.
To train or evaluate the model in different environments, modify the given shell script and config files accordingly.
sh run.sh [CONFIG] [NUM_GPUS] [OUTPUT_DIR] [OPTS]
# For ViT-B variant
sh run.sh configs/vitb_384.yaml 4 output/
# For ViT-L variant
sh run.sh configs/vitl_336.yaml 4 output/eval.sh automatically evaluates the model following our evaluation protocol, with weights in the output directory if not specified.
To individually run the model in different datasets, please refer to the commands in eval.sh.
sh run.sh [CONFIG] [NUM_GPUS] [OUTPUT_DIR] [OPTS]
sh eval.sh configs/vitb_384_hyperbolic.yaml 4 output/ MODEL.WEIGHTS path/to/weights.pthYou can launch the entire training and evaluation pipeline using:
bash run_train_test.shWe provide pretrained weights for our models reported in the paper. All of the models were evaluated with 8 NVIDIA A100 GPUs, and can be reproduced with the evaluation script above.
| Model | CLIP | A-847 | PC-459 | A-150 | PC-59 | PAS-20 | PAS-20b | Download |
|---|---|---|---|---|---|---|---|---|
| HyRo (B) | ViT-B/16 | 12.0 | 18.9 | 31.2 | 57.3 | 95.0 | 76.7 | ckpt |
Thanks to the excellent works and their codebases of CAT-Seg and HyperCLIP.

