Home

Awesome

HRSAM: Efficiently Segment Anything in High-resolution Images

This repository contains the implementation for

HRSAM: Efficiently Segment Anything in High-resolution Images

Comparison of HRSAM and previous SOTA SegNext in high-precision interactive segmentation Comparison of HRSAM and previous SOTA SegNext in high-precision interactive segmentation.

Installation

To install the required dependencies, follow the detailed instructions in the Installation.

Datasets

To prepare the datasets, follow the detailed instructions in the Datasets.

Pre-trained Models

We provide pre-trained models so that you can start testing immediately. You can download the pre-trained models and the corresponding configs from the following link:

Pre-trained Models & Configs

The zip file contains the following directories:

Training the Model

To train the model, execute the following command:

e.g.

bash tools/dist_train.sh configs/hrsam/hqseg44k/hrsam_plusplus_simaug_1024x1024_bs1_40k.py 4

Evaluating the Model

After training the model, you can evaluate it using the following command:

bash tools/dist_test_no_viz.sh configs/datasets_ext/eval_hqseq44k_val.py work_dirs/hrsam/hqseg44k/hrsam_plusplus_simaug_1024x1024_bs1_40k/iter_40000.pth 4

(the input resolution is 1024x1024) or

bash tools/dist_test_no_viz.sh configs/datasets_ext/eval_hqseq44k_val.py work_dirs/hrsam/hqseg44k/hrsam_plusplus_simaug_1024x1024_bs1_40k/iter_40000.pth 4 -c configs/eval_custom/simseg_ts2048.py 

which will use 2048x2048 inputs in the evaluation.