PyTorch implementation of a convolutional neural network (U-Net)
Project description
unet-pytorch
PyTorch implementation of a convolutional neural network (U-Net) for semantic segmentation of biomedical images.
Overview
This repository contains a PyTorch implementation of the U-Net architecture for semantic segmentation tasks.
U-Net is a convolutional neural network architecture that was originally designed for biomedical image segmentation.
Installation
You can install the U-Net model using pip.
pip install unet-pytorch
We recommend using Python 3.11 or later and PyTorch 2.6 or later.
You can also clone the repository and install it in local development mode using poetry.
git clone https://github.com/giansimone/unet-pytorch.git
cd unet-pytorch
pip install poetry
poetry install
Usage
To use the U-Net model, you can import the UNet class from the unet_pytorch.model module and create an instance of the model.
import torch
from unet_pytorch.model import UNet
model = UNet(in_channels=1, out_channels=2)
input_tensor = torch.randn(1, 1, 512, 512)
output_tensor = model(input_tensor)
print(output_tensor.shape) # Should be (1, 2, 512, 512)
Training
To train the U-Net model, you can use the unet_pytorch.train module.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unet_pytorch-0.4.3.tar.gz.
File metadata
- Download URL: unet_pytorch-0.4.3.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.2 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36b7123c977a96a30be6eec50fe38ee69726684ac479cb11aaabb350c23a4913
|
|
| MD5 |
8c4d38cb66c45b744b2727d56e171b33
|
|
| BLAKE2b-256 |
03860d4fc5c3804b1c0c00b450173f35da541e6349f20e170ddf1e6b879ce306
|
File details
Details for the file unet_pytorch-0.4.3-py3-none-any.whl.
File metadata
- Download URL: unet_pytorch-0.4.3-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.2 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1671582cc36c27a3738f36691bfb180446dd04fbd15854305e2bf8dc1a36ecf3
|
|
| MD5 |
d0e5d474c1ac2ef38629d4b786e5dbad
|
|
| BLAKE2b-256 |
ef3423724a25521d77c5145cad58a9938fd8b15ece55e02838cf85b8b1fac36d
|