# SHI-Labs/Neighborhood-Attention-Transformer

Neighborhood Attention Transformer, arxiv 2022 / CVPR 2023. Dilated Neighborhood Attention Transformer, arxiv 2022

Repository: https://github.com/SHI-Labs/Neighborhood-Attention-Transformer
Canonical: https://ross.abutalabs.com/products/neighborhood-attention-transformer
Language: Python
License: MIT
License Family: permissive
Topics: neighborhood-attention, pytorch
Last push: 2024-05-15T01:12:12+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 1602, "days_push": 841, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1184, forks 91 (observed 2026-08-28T04:03:54.627708+00:00)

## What it is
Official PyTorch implementation of the Neighborhood Attention Transformer (NAT/DiNAT), a family of efficient vision transformers with localized, sliding-window attention, published at CVPR 2023. It provides pretrained models and code for image classification, object detection, segmentation, and image generation tasks.

## Use cases
- train a vision transformer for image classification
- semantic segmentation on ADE20K or Cityscapes
- object detection and instance segmentation on COCO
- efficient attention alternative to Swin Transformer
- reproduce CVPR 2023 neighborhood attention paper results
- image generation with StyleNeT

## When to choose
- you need an efficient localized-attention vision transformer backbone
- you want pretrained models for detection or segmentation research
- you are reproducing or building on NAT/DiNAT papers

## When to avoid
- you need a general-purpose production vision model rather than research code
- you lack a CUDA GPU since the NATTEN extension is required
- you need non-PyTorch frameworks

## Facets
- artifact type: library
- maturity: stable
- function: machine-learning, deep-learning, image-processing
- domain: deep-learning, computer-vision, image-processing
- platform: python
- tags: vision-transformer, neighborhood-attention, pytorch, image-classification, semantic-segmentation, object-detection, research-code, cvpr, gpu, linux

## Member repositories
- SHI-Labs/Neighborhood-Attention-Transformer (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:54.627708+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:24:14.031515+00:00, confidence not recorded.
  - readme: https://github.com/SHI-Labs/Neighborhood-Attention-Transformer (fetched 2026-08-28T04:03:54.627708+00:00, sha 3de8e253dc59)
- Data as of 2026-08-30T08:39:29.467469+00:00.
