# AFFormer **Repository Path**: buptybx/AFFormer ## Basic Information - **Project Name**: AFFormer - **Description**: https://github.com/dongbo811/AFFormer - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-26 - **Last Updated**: 2025-08-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Head-Free Lightweight Semantic Segmentation with Linear Transformer This repository contains the official Pytorch implementation of training & evaluation code and the pretrained models for [AFFormer](https://arxiv.org/pdf/2301.04648.pdf).🔥🔥
Figure 1: Performance of AFFormer.
AFFormer is a head-free, lightweight and powerful semantic segmentation method, as shown in Figure 1. We use [MMSegmentation v0.21.1](https://github.com/open-mmlab/mmsegmentation/tree/v0.21.1) as the codebase. ## Installation For install and data preparation, please refer to the guidelines in [MMSegmentation v0.21.1](https://github.com/open-mmlab/mmsegmentation/tree/v0.21.1). An example (works for me): ```CUDA 11.3``` and ```pytorch 1.10.1``` ``` pip install mmcv-full==1.5.0 pip install torchvision pip install timm pip install opencv-python pip install einops ``` ## Evaluation Download `weights` ( [google drive](https://drive.google.com/drive/folders/1Mru24qPdta9o8aLn1RwT8EapiQCih1Sw?usp=share_link) | [alidrive](https://www.aliyundrive.com/s/Ha2xMsG9ufy) ) Example: evaluate ```AFFormer-base``` on ```ADE20K``` : ``` # Single-gpu testing bash tools/dist_test.sh ./configs/AFFormer/AFFormer_base_ade20k.py /path/to/checkpoint_file.pth 1 --eval mIoU # Multi-gpu testing bash tools/dist_test.sh ./configs/AFFormer/AFFormer_base_ade20k.py /path/to/checkpoint_file.pth