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

You can access the PyPI page or install the package directly.

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-1.0.2.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-1.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for easy_unet-1.0.2.tar.gz
Algorithm Hash digest
SHA256 75b088bb79ae75bc1c32ba2daa65559f1e6651264eeb3f1a0a32b2fb305a0589
MD5 5a2304d1a8c239bd407db11f0e3293b5
BLAKE2b-256 75b0c509169e4153aefccf1971485a1004fede6e48f4e312512970e9c812713d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for easy_unet-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37fafb3b9e52dc2ea7c9b23162ebf471a1a5ce447c9eb09d00119b2f102f4d5a
MD5 e17acdf9a8a21e696ae7079d4c862171
BLAKE2b-256 465e1e811d6a16ee128db99cc186c5eaf761d380e76f1369842ebafcd4f100dc

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