Skip to main content

A lightweight and flexible PyTorch library providing a modular UNet implementation with advanced attention and normalization blocks for fast image processing and deep learning development.

Project description

easy-unet: Modular UNet Backbone in PyTorch

A lightweight and flexible PyTorch library providing a modular UNet implementation with advanced attention and normalization blocks. Designed for fast experimentation and development across diverse image processing and deep learning tasks.

🚀 Features

  • 🧱 UNet backbone with residual blocks and flexible channel multipliers
  • 🎯 Advanced attention modules including linear and flash attention for improved feature modeling
  • ⚙️ Configurable architecture for dropout, channels, and dimensions
  • 🧪 Modular and clean PyTorch codebase suitable for research and production
  • 🔄 Supports easy integration with diffusion models, segmentation, or any custom pipeline

📦 Installation

pip install easy-unet

📁 Project Structure

easy-unet/
├── easy_unet/
│   ├── __init__.py
│   ├── module.py        # All architecture classes and logic
├── pyproject.toml
├── LICENSE
└── README.md

🚀 Quick Start

Import and create the model

import torch
from easy_unet import UNet

model = UNet(
    dim=64,
    dim_mults=(1, 2, 4, 8),
    channels=3,
    out_channels=1,
    dropout=0.1
)

x = torch.randn(1, 3, 256, 256)    # sample input
output = model(x)
print(output.shape)  # e.g., torch.Size([1, 3, 256, 256])

⚙️ Configuration Options

Argument Type Default Description
dim int 64 Base number of feature channels
dim_mults tuple (1, 2, 4, 8) Channel multipliers per U-Net stage
channels int 3 Number of input channels (e.g., 3 for RGB)
out_channels int 1 Number of output channels (e.g., 1 for binary and 2 or more for multi-class)
dropout float 0.0 Dropout rate for regularization.

🙋‍♂️ Author

Developed by Mehran Bazrafkan

Created for general-purpose use cases and research requiring flexible UNet architectures in PyTorch.

⭐️ Support & Contribute

If you find this project useful, please:

  • ⭐️ Star the repo

  • 🐛 Report issues

  • 📦 Suggest features or improvements

🔗 Related Projects

📜 License

This project is licensed under the terms of the MIT LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_unet-0.1.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_unet-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file easy_unet-0.1.1.tar.gz.

File metadata

  • Download URL: easy_unet-0.1.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for easy_unet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ab69c529f33f1ecf0bc19ba0e76371a7d9c04b4a8f8884b068b707f9d2a79671
MD5 751d69428ca02a9d10e729405304a224
BLAKE2b-256 218ed35857f3d2c7402ed6775ed1bafdaf26b205d2b3f1dfd7177b2c1109c454

See more details on using hashes here.

File details

Details for the file easy_unet-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: easy_unet-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for easy_unet-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92b051465d3be472fec92c22ba79b924e0700c5a4016167952d11f6af6a76e6b
MD5 965d0b58227e4d5ee835d5e4a458d745
BLAKE2b-256 25b7bf780e8ea2a6cc194e1fa15eab98e5ecbd3b0faf111342483141178d8a98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page