Downloads · 30 days
343
19% of all-time downloads
deepang/adaptformer-LEVIR-CD
adaptformer-LEVIR-CD is a image segmentation model from deepang. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
AdaptFormer model fine-tuned on LEVIR-CD at resolution 512x512. It was introduced in the paper AdaptFormer: An Adaptive Hierarchical Semantic Approach for Change Detection on Remote Sensing Images by Pang et al. and f…
Downloads · 30 days
343
19% of all-time downloads
All-time downloads
1.8K
Public
Parameters
12.5M
50.2 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors50.2 MB · 100%
How the weights are stored.
F3212.5M · 100%
From the Hugging Face model README
AdaptFormer model fine-tuned on LEVIR-CD at resolution 512x512. It was introduced in the paper AdaptFormer: An Adaptive Hierarchical Semantic Approach for Change Detection on Remote Sensing Images by Pang et al. and first released in this repository.
AdaptFormer, uniquely designed to adaptively interpret hierarchical semantics. Instead of a one-size-fits-all approach, it strategizes differently across three semantic depths: employing straightforward operations for shallow semantics, assimilating spatial data for medium semantics to emphasize detailed interregional changes, and integrating cascaded depthwise attention for in-depth semantics, focusing on high-level representations
Here is how to use this model to classify an image:
from transformers import AutoImageProcessor, AutoModel
from PIL import Image
import requests
image_processor = AutoImageProcessor.from_pretrained("deepang/adaptformer-LEVIR-CD")
model = AutoModel.from_pretrained("deepang/adaptformer-LEVIR-CD")
image_A = Image.open(requests.get('https://raw.githubusercontent.com/aigzhusmart/AdaptFormer/main/figures/test_2_1_A.png', stream=True).raw)
image_B = Image.open(requests.get('https://raw.githubusercontent.com/aigzhusmart/AdaptFormer/main/figures/test_2_1_B.png', stream=True).raw)
label = Image.open(requests.get('https://raw.githubusercontent.com/aigzhusmart/AdaptFormer/main/figures/test_2_1_label.png', stream=True).raw)
inputs = preprocessor(images=(image_A, image_B), return_tensors="pt")
outputs = adaptfromer_model(**inputs)
logits = outputs.logits # shape (batch_size, num_labels, height, width)
pred = logits.argmax(dim=1)[0]
The license for this model can be found here.
@article{huang2024adaptformer,
title={AdaptFormer: An Adaptive Hierarchical Semantic Approach for Change Detection on Remote Sensing Images},
author={Huang, Teng and Hong, Yile and Pang, Yan and Liang, Jiaming and Hong, Jie and Huang, Lin and Zhang, Yuan and Jia, Yan and Savi, Patrizia},
journal={IEEE Transactions on Instrumentation and Measurement},
year={2024},
publisher={IEEE}
}