Views
No views yet
RSCCM) is presented in the paper RSCC: A Large-Scale Remote Sensing Change Caption Dataset for Disaster Events.1pip install transformers accelerate # the latest stable version already integrate Qwen2.5-VL
2pip install qwen-vl-utils[decord]==0.0.81from transformers import (
2 Qwen2_5_VLForConditionalGeneration,
3 AutoProcessor
4)
5import torch
6model_id = "BiliSakura/RSCCM"
7model_path = model_id # download from huggingface.co automatically or you can specify as path/to/your/model/folder
8model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
9 model_path,
10 torch_dtype=torch.bfloat16,
11 attn_implementation="flash_attention_2",
12).to("cuda")
13processor = AutoProcessor.from_pretrained(model_path)1from PIL import Image
2pre_img_path = "path/to/pre/event/image"
3post_img_path = "path/to/post/event/image"
4text_prompt ="""
5Give change description between two satellite images.
6Output answer in a news style with a few sentences using precise phrases separated by commas.
7"""
8pre_image = Image.open(pre_img_path)
9post_image = Image.open(post_img_path)1from qwen_vl_utils import process_vision_info
2import torch
3messages = [
4 {
5 "role": "user",
6 "content": [
7 {"type": "image", "image": pre_image},
8 {"type": "image", "image": post_image},
9 {
10 "type": "text",
11 "text": text_prompt,
12 },
13 ],
14 }
15]
16
17text = processor.apply_chat_template(
18 messages, tokenize=False, add_generation_prompt=True
19)
20image_inputs, _ = process_vision_info(messages)
21inputs = processor(
22 text=[text], images=image_inputs, padding=True, return_tensors="pt"
23).to("cuda", torch.bfloat16)
24# Generate captions for the input image pair
25generated_ids = model.generate(
26 **inputs,
27 max_new_tokens=512,
28 # temperature=TEMPERATURE
29)
30generated_ids_trimmed = [
31 out_ids[len(in_ids) :]
32 for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
33]
34captions = processor.batch_decode(
35 generated_ids_trimmed,
36 skip_special_tokens=True,
37 clean_up_tokenization_spaces=False,
38)
39change_caption = captions[0]1@misc{chen2025rscclargescaleremotesensing,
2 title={RSCC: A Large-Scale Remote Sensing Change Caption Dataset for Disaster Events},
3 author={Zhenyuan Chen and Chenxi Wang and Ningyu Zhang and Feng Zhang},
4 year={2025},
5 eprint={2509.01907},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2509.01907},
9}
10@article{qwen2.5vl,
11title={Qwen2.5-VL Technical Report},
12url={http://arxiv.org/abs/2502.13923},
13DOI={10.48550/arXiv.2502.13923},
14author={Bai, Shuai and Chen, Keqin and Liu, Xuejing and Wang, Jialin and Ge, Wenbin and Song, Sibo and Dang, Kai and Wang, Peng and Wang, Shijie and Tang, Jun and Zhong, Humen and Zhu, Yuanzhi and Yang, Mingkun and Li, Zhaohai and Wan, Jianqiang and Wang, Pengfei and Ding, Wei and Fu, Zheren and Xu, Yiheng and Ye, Jiabo and Zhang, Xi and Xie, Tianbao and Cheng, Zesen and Zhang, Hang and Yang, Zhibo and Xu, Haiyang and Lin, Junyang},
15year={2025},
16month=feb
17}
18