All Projects → lucidrains → uformer-pytorch

lucidrains / uformer-pytorch

Licence: MIT License
Implementation of Uformer, Attention-based Unet, in Pytorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to uformer-pytorch

Tf.keras Commonly Used Models
基于Tensorflow的常用模型,包括分类分割、新型激活、卷积模块,可在Tensorflow2.X下运行。
Stars: ✭ 115 (+112.96%)
Mutual labels:  image-segmentation, unet
TensorFlow-Advanced-Segmentation-Models
A Python Library for High-Level Semantic Segmentation Models based on TensorFlow and Keras with pretrained backbones.
Stars: ✭ 64 (+18.52%)
Mutual labels:  image-segmentation, unet
Open Solution Salt Identification
Open solution to the TGS Salt Identification Challenge
Stars: ✭ 124 (+129.63%)
Mutual labels:  image-segmentation, unet
Unet Tensorflow
Tensorflow implement of U-Net
Stars: ✭ 50 (-7.41%)
Mutual labels:  image-segmentation, unet
ResUNetPlusPlus-with-CRF-and-TTA
ResUNet++, CRF, and TTA for segmentation of medical images (IEEE JBIHI)
Stars: ✭ 98 (+81.48%)
Mutual labels:  image-segmentation, unet
Multiclass Semantic Segmentation Camvid
Tensorflow 2 implementation of complete pipeline for multiclass image semantic segmentation using UNet, SegNet and FCN32 architectures on Cambridge-driving Labeled Video Database (CamVid) dataset.
Stars: ✭ 67 (+24.07%)
Mutual labels:  image-segmentation, unet
Keras unet plus plus
keras implementation of unet plus plus
Stars: ✭ 166 (+207.41%)
Mutual labels:  image-segmentation, unet
Segmentation models.pytorch
Segmentation models with pretrained backbones. PyTorch.
Stars: ✭ 4,584 (+8388.89%)
Mutual labels:  image-segmentation, unet
Mmsegmentation
OpenMMLab Semantic Segmentation Toolbox and Benchmark.
Stars: ✭ 2,875 (+5224.07%)
Mutual labels:  transformer, image-segmentation
Deep Unet For Satellite Image Segmentation
Satellite Imagery Feature Detection with SpaceNet dataset using deep UNet
Stars: ✭ 227 (+320.37%)
Mutual labels:  image-segmentation, unet
Segmentationcpp
A c++ trainable semantic segmentation library based on libtorch (pytorch c++). Backbone: ResNet, ResNext. Architecture: FPN, U-Net, PAN, LinkNet, PSPNet, DeepLab-V3, DeepLab-V3+ by now.
Stars: ✭ 49 (-9.26%)
Mutual labels:  image-segmentation, unet
PyTorch-Segmentation-Zoo
A PyTorch collection of semantic segmentation tools.
Stars: ✭ 33 (-38.89%)
Mutual labels:  image-segmentation, unet
Pytorch Unet
Simple PyTorch implementations of U-Net/FullyConvNet (FCN) for image segmentation
Stars: ✭ 470 (+770.37%)
Mutual labels:  image-segmentation, unet
Paddleseg
End-to-end image segmentation kit based on PaddlePaddle.
Stars: ✭ 1,244 (+2203.7%)
Mutual labels:  image-segmentation, unet
Pytorch Nested Unet
PyTorch implementation of UNet++ (Nested U-Net).
Stars: ✭ 416 (+670.37%)
Mutual labels:  image-segmentation, unet
Semantic Segmentation Of Remote Sensing Images
遥感图像的语义分割,基于深度学习,在Tensorflow框架下,利用TF.Keras,运行环境TF2.0+
Stars: ✭ 125 (+131.48%)
Mutual labels:  image-segmentation, unet
ResUNetPlusPlus
Official code for ResUNetplusplus for medical image segmentation (TensorFlow implementation) (IEEE ISM)
Stars: ✭ 69 (+27.78%)
Mutual labels:  image-segmentation, unet
Segmentation models
Segmentation models with pretrained backbones. Keras and TensorFlow Keras.
Stars: ✭ 3,575 (+6520.37%)
Mutual labels:  image-segmentation, unet
Keras Unet
Helper package with multiple U-Net implementations in Keras as well as useful utility tools helpful when working with image semantic segmentation tasks. This library and underlying tools come from multiple projects I performed working on semantic segmentation tasks
Stars: ✭ 196 (+262.96%)
Mutual labels:  image-segmentation, unet
lung-segmentation
Lung segmentation for chest X-Ray images
Stars: ✭ 74 (+37.04%)
Mutual labels:  image-segmentation, unet

Uformer - Pytorch

Implementation of Uformer, Attention-based Unet, in Pytorch. It will only offer the concat-cross-skip connection.

This repository will be geared towards use in a project for learning protein structures. Specifically, it will include the ability to condition on time steps (needed for DDPM), as well as 2d relative positional encoding using rotary embeddings (instead of the bias on the attention matrix in the paper).

Install

$ pip install uformer-pytorch

Usage

import torch
from uformer_pytorch import Uformer

model = Uformer(
    dim = 64,           # initial dimensions after input projection, which increases by 2x each stage
    stages = 4,         # number of stages
    num_blocks = 2,     # number of transformer blocks per stage
    window_size = 16,   # set window size (along one side) for which to do the attention within
    dim_head = 64,
    heads = 8,
    ff_mult = 4
)

x = torch.randn(1, 3, 256, 256)
pred = model(x) # (1, 3, 256, 256)

To condition on time for DDPM training

import torch
from uformer_pytorch import Uformer

model = Uformer(
    dim = 64,
    stages = 4,
    num_blocks = 2,
    window_size = 16,
    dim_head = 64,
    heads = 8,
    ff_mult = 4,
    time_emb = True    # set this to true
)

x = torch.randn(1, 3, 256, 256)
time = torch.arange(1)
pred = model(x, time = time) # (1, 3, 256, 256)

Citations

@misc{wang2021uformer,
    title   = {Uformer: A General U-Shaped Transformer for Image Restoration}, 
    author  = {Zhendong Wang and Xiaodong Cun and Jianmin Bao and Jianzhuang Liu},
    year    = {2021},
    eprint  = {2106.03106},
    archivePrefix = {arXiv},
    primaryClass = {cs.CV}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].