All Projects → petko-nikolov → pysemseg

petko-nikolov / pysemseg

Licence: GPL-3.0 license
Semantic Segmentation Models in Pytorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pysemseg

Segmentation
TensorFlow implementation of ENet, trained on the Cityscapes dataset.
Stars: ✭ 243 (+683.87%)
Mutual labels:  semantic-segmentation
Semantic Segmentation
Semantic Segmentation using Fully Convolutional Neural Network.
Stars: ✭ 60 (+93.55%)
Mutual labels:  semantic-segmentation
tf-semantic-segmentation-FCN-VGG16
Semantic segmentation for classifying road. "Fully Convolutional Networks for Semantic Segmentation (2015)" implemented using TF
Stars: ✭ 30 (-3.23%)
Mutual labels:  semantic-segmentation
Clan
( CVPR2019 Oral ) Taking A Closer Look at Domain Shift: Category-level Adversaries for Semantics Consistent Domain Adaptation
Stars: ✭ 248 (+700%)
Mutual labels:  semantic-segmentation
PixelPick
[ICCVW'21] All you need are a few pixels: semantic segmentation with PixelPick
Stars: ✭ 59 (+90.32%)
Mutual labels:  semantic-segmentation
multiclass-semantic-segmentation
Experiments with UNET/FPN models and cityscapes/kitti datasets [Pytorch]
Stars: ✭ 96 (+209.68%)
Mutual labels:  semantic-segmentation
Fast Scnn Pytorch
A PyTorch Implementation of Fast-SCNN: Fast Semantic Segmentation Network
Stars: ✭ 239 (+670.97%)
Mutual labels:  semantic-segmentation
3D-UNet-PyTorch-Implementation
The implementation of 3D-UNet using PyTorch
Stars: ✭ 78 (+151.61%)
Mutual labels:  semantic-segmentation
nobrainer
A framework for developing neural network models for 3D image processing.
Stars: ✭ 123 (+296.77%)
Mutual labels:  semantic-segmentation
RGBD-semantic-segmentation
A paper list of RGBD semantic segmentation (processing)
Stars: ✭ 264 (+751.61%)
Mutual labels:  semantic-segmentation
VT-UNet
[MICCAI2022] This is an official PyTorch implementation for A Robust Volumetric Transformer for Accurate 3D Tumor Segmentation
Stars: ✭ 151 (+387.1%)
Mutual labels:  semantic-segmentation
ResUNetPlusPlus-with-CRF-and-TTA
ResUNet++, CRF, and TTA for segmentation of medical images (IEEE JBIHI)
Stars: ✭ 98 (+216.13%)
Mutual labels:  semantic-segmentation
etos-deepcut
Deep Extreme Cut http://www.vision.ee.ethz.ch/~cvlsegmentation/dextr . a tool to do automatically object segmentation from extreme points.
Stars: ✭ 24 (-22.58%)
Mutual labels:  semantic-segmentation
Cocostuff10k
The official homepage of the (outdated) COCO-Stuff 10K dataset.
Stars: ✭ 248 (+700%)
Mutual labels:  semantic-segmentation
ssgan
Semi Supervised Semantic Segmentation Using Generative Adversarial Network ; Pytorch
Stars: ✭ 25 (-19.35%)
Mutual labels:  semantic-segmentation
Adaptive affinity fields
Adaptive Affinity Fields for Semantic Segmentation
Stars: ✭ 240 (+674.19%)
Mutual labels:  semantic-segmentation
MCIS wsss
Code for ECCV 2020 paper (oral): Mining Cross-Image Semantics for Weakly Supervised Semantic Segmentation
Stars: ✭ 151 (+387.1%)
Mutual labels:  semantic-segmentation
Xtreme-Vision
A High Level Python Library to empower students, developers to build applications and systems enabled with computer vision capabilities.
Stars: ✭ 77 (+148.39%)
Mutual labels:  semantic-segmentation
ScasNet
Semantic Labeling in VHR Images via A Self-Cascaded CNN (ISPRS JPRS, IF=6.942)
Stars: ✭ 24 (-22.58%)
Mutual labels:  semantic-segmentation
K-Net
[NeurIPS2021] Code Release of K-Net: Towards Unified Image Segmentation
Stars: ✭ 434 (+1300%)
Mutual labels:  semantic-segmentation

PySemSeg

PySemSeg is a library for training Deep Learning Models for Semantic Segmentation in Pytorch. The goal of the library is to provide implementations of SOTA segmentation models, with pretrained versions on popular datasets, as well as an easy-to-use training loop for new models and datasets. Most Semantic Segmentation datasets with fine-grained annotations are small, so Transfer Learning is crucial for success and is a core capability of the library. PySemSeg can use visdom or tensorboardX for training summary visualialization.

Installation

Using pip:

pip install git+https://github.com/petko-nikolov/pysemseg

Models

  • FCN [paper] - FCN32, FCN16, FCN8 with pre-trained VGG16
  • UNet [paper]
  • Tiramisu (FC DenseNets)[paper] - FC DenseNet 56, FC DenseNet 67, FC DensetNet 103 with efficient checkpointing
  • DeepLab V3 [paper] - Multi-grid, ASPP and BatchNorm fine-tuning with pre-trained resnets backbone
  • DeepLab V3+ [paper]
  • RefineNet [paper] - [Upcoming ...]
  • PSPNet [paper] - [Upcoming ...]

Datasets

Train a model from command line

The following is an example command to train a VGGFCN8 model on the Pascal VOC 2012 dataset. In addition to the dataset and the model, a transformer class should be passed (PascalVOCTransform in this case) - a callable where all input image and mask augmentations and tensor transforms are implemented. Run pysemseg-train -h for a full list of options.

pysemseg-train \
   --model VGGFCN8 \
   --model-dir ~/models/vgg8_pascal_model/ \
   --dataset PascalVOCSegmentation \
   --data-dir ~/datasets/PascalVOC/ \
   --batch-size 4 \
   --test-batch-size 1 \
   --epochs 40 \
   --lr 0.001 \
   -- optimizer SGD \
   -- optimizer-args '{"weight_decay": 0.0005, "momentum": 0.9}' \
   --transformer PascalVOCTransform \
   --lr-scheduler PolyLR \
   --lr-scheduler_args '{"max_epochs": 40, "gamma": 0.8}'

or pass a YAML config

pysemseg-train --config config.yaml
model: VGGFCN32
model-dir: models/vgg8_pascal_model/
dataset: PascalVOCSegmentation
data-dir: datasets/PascalVOC/
batch-size: 4
test-batch-size: 1
epochs: 40
lr: 0.001
optimizer: SGD
optimizer-args:
    weight_decay: 0.0005
    momentum: 0.9
transformer: PascalVOCTransform
no-cuda: true
lr-scheduler: PolyLR
lr-scheduler-args:
    max_epochs: 40
    gamma: 0.8

Load and predict with a trained model

To use a checkpoint for inference you have to call load_model with a checkpoint, the model class and the transformer class used during training.

import torch.nn.functional as F
from pysemseg.transforms import CV2ImageLoader
from pysemseg.utils import load_model
from pysemseg.models import VGGFCN32
from pysemseg.datasets import PascalVOCTransform

model = load_model(
    './checkpoint_path',
    VGGFCN32,
    PascalVOCTransform
)

image = CV2ImageLoader()('./image_path')
logits = model(image)
probabilities = F.softmax(logits, dim=1)
predictions = torch.argmax(logits, dim=1)
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].