🚀 🚀 🚀 News:
- To be updated...
- ✅ Dec. 12, 2024: We release the checkpoints SEAGULL-7B and inference codes.
- ✅ Nov. 29, 2024: We release the online and offline demo for SEAGULL.
- ✅ Nov. 25, 2024: We make SEAGULL-100w publicly available at Hugging Face and Baidu Netdisk. More details can be found at Hugging Face.
- ✅ Nov. 12, 2024: We create this repository.
- Release the SEAGULL-100w dataset.
- Release the online and offline demo.
- Release the checkpoints and inference codes.
- [] Release the training codes.
- [] Release the SEAGULL-3k dataset.
TL;DR: We propose a novel network (SEAGULL) and construct two datasets (SEAGULL-100w and SEAGULL-3k) to achieve fine-grained IQA for any ROIs.
Existing Image Quality Assessment (IQA) methods achieve remarkable success in analyzing quality for overall image, but few works explore quality analysis for Regions of Interest (ROIs). The quality analysis of ROIs can provide fine-grained guidance for image quality improvement and is crucial for scenarios focusing on region-level quality. This paper proposes a novel network, SEAGULL, which can SEe and Assess ROIs quality with GUidance from a Large vision-Language model. SEAGULL incorporates a vision-language model (VLM), masks generated by Segment Anything Model (SAM) to specify ROIs, and a meticulously designed Mask-based Feature Extractor (MFE) to extract global and local tokens for specified ROIs, enabling accurate fine-grained IQA for ROIs. Moreover, this paper constructs two ROI-based IQA datasets, SEAGULL-100w and SEAGULL-3k, for training and evaluating ROI-based IQA. SEAGULL-100w comprises about 100w synthetic distortion images with 33 million ROIs for pre-training to improve the model's ability of regional quality perception, and SEAGULL-3k contains about 3k authentic distortion ROIs to enhance the model's ability to perceive real world distortions. After pre-training on SEAGULL-100w and fine-tuning on SEAGULL-3k, SEAGULL shows remarkable performance on fine-grained ROI quality assessment.
Click 👇 to try our demo. You might need to click Restart this Space
to wake our demo up 🌞
17GB
.
- Create the environment
conda create -n seagull python=3.10 -y
conda activate seagull
pip install -e .
- Install Gradio Extention for drawing boxes on images.
Tip
If the network is not accessible, try the following steps. It might work.
- Download the
gradio.zip
from Baidu Netdisk or Google Drive. - Run
unzip gradio.zip
and then gain thegradio-bbox
folder. - Run
cd gradio-bbox && pip install -e .
- Install Segment Anything Model.
pip install git+https://github.com/facebookresearch/segment-anything.git
-
Download ViT-B SAM model and CLIP-convnext, then put them into the
checkpoints
folder. -
Run demo on your device.
python app.py --model Zevin2023/SEAGULL-7B
Tip
If Hugging Face is not accessible to you, try the following command.
HF_ENDPOINT=https://hf-mirror.com python app.py --model Zevin2023/SEAGULL-7B
- You can also download SEAGULL-7B and put them into the
checkpoints
folder.
The folder structure should be:
├── checkpoints
├── SEAGULL-7B
│ ├── config.json
│ ├── pytorch_model-xxxxx-of-xxxxx.bin
│ └── xxx
├── sam_vit_b_01ec64.pth
└── open_clip_pytorch_model.bin
Then run the following command:
python app.py --model ./checkpoints/SEAGULL-7B
- Create the environment
conda create -n seagull python=3.10 -y
conda activate seagull
pip install -e .
- If you want to train SEAGULL by yourself, install the additional packages.
pip install -e ".[train]"
pip install flash-attn --no-build-isolation
- Download CLIP-convnext and SEAGULL-7B, then put them into the
checkpoints
folder.
The folder structure should be:
├── checkpoints
├── SEAGULL-7B
│ ├── config.json
│ ├── pytorch_model-xxxxx-of-xxxxx.bin
│ └── xxx
└── open_clip_pytorch_model.bin
Coming soon.
- We provide a
./demo/inference_demo.json
template for better understanding. - Run the following command for inference:
python3 inference.py \
--img_dir ./imgs/Examples \
--json_path ./demo/inference_demo.json \
--mask_type rel \ # rel or points (x, y, w, h)
--inst_type quality \ # quality, importance, distortion
--model ./checkpoints/SEAGULL-7B
- Osprey and LLaVA-v1.5: We build this repostory based on them.
- RAISE: The Dist. images in SEAGULL-100w are constructed based on this dataset.
- SAM and SEEM: The mask-based ROIs are generated using these two awesome works. And SAM are used to get the segmentation result in the demo.
- TOPIQ: The quality scores and importance scores for ROIs are generated using this great FR-IQA.
If our work is useful to your research, we will be grateful for you to cite our paper:
@misc{chen2024seagull,
title={SEAGULL: No-reference Image Quality Assessment for Regions of Interest via Vision-Language Instruction Tuning},
author={Zewen Chen and Juan Wang and Wen Wang and Sunhan Xu and Hang Xiong and Yun Zeng and Jian Guo and Shuxun Wang and Chunfeng Yuan and Bing Li and Weiming Hu},
year={2024},
eprint={2411.10161},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2411.10161},
}