Generic Foreground Segmentation in Images

Overview

Pixel Objectness

The following repository contains pretrained model for pixel objectness.

Please visit our project page for the paper and visual results.

If you use this in your research, please cite the following paper:

@article{pixelobjectness,
  Author = {Jain, Suyog and Xiong, Bo and Grauman, Kristen},
  Journal = {arXiv preprint arXiv:1701.05349},
  Title = {Pixel Objectness},
  Year = {2017}
}

These models are freely available for research and academic purposes. However it's patent pending, so please contact us for any commercial use.

Using the pretrained models:

This model is trained using Deeplab-v1 caffe library. Please cite [1] and [2] if you use the code.

  • Setup: Download and install Deeplab-v1 from here

  • Refer to demo.py for step-by-step instruction on how to run the code.

  • Store the images that you want to process in the images folder.

  • Update the caffe binary path and image extension variable in demo.py

  • Running demo.py will produce three files 1) image_list.txt : contains list of of input images, 2) output_list.txt: contains names to be used to store the output of pixel objectness 3) test.protoxt: prototxt file required for loading the pretrained model.

  • Please resize your images so that the maximum side is < 513, otherwise update the crop_size value in test_template.prototxt. Bigger crop sizes require larger gpu memory.

Visualizing the results:

After execution demo.py will store pixel objectness results as matlab files.

Please refer to show_results.m to see how to visualize and extract foreground masks.

Please cite these too if you use the code:

[1] Caffe:

@article{jia2014caffe,
Author = {Jia, Yangqing and Shelhamer, Evan and Donahue, Jeff and Karayev, Sergey and Long, Jonathan and Girshick, Ross and Guadarrama, Sergio and Darrell, Trevor},
Journal = {arXiv preprint arXiv:1408.5093},
Title = {Caffe: Convolutional Architecture for Fast Feature Embedding},
Year = {2014}
}

[2] Deeplab-v1:

@inproceedings{chen14semantic,
title={Semantic Image Segmentation with Deep Convolutional Nets and Fully Connected CRFs},
author={Liang-Chieh Chen and George Papandreou and Iasonas Kokkinos and Kevin Murphy and Alan L Yuille},
booktitle={ICLR},
url={http://arxiv.org/abs/1412.7062},
year={2015}
}
You might also like...
Open-source code for Generic Grouping Network (GGN, CVPR 2022)
Open-source code for Generic Grouping Network (GGN, CVPR 2022)

Open-World Instance Segmentation: Exploiting Pseudo Ground Truth From Learned Pairwise Affinity Pytorch implementation for "Open-World Instance Segmen

Script that receives an Image (original) and a set of images to be used as
Script that receives an Image (original) and a set of images to be used as "pixels" in reconstruction of the Original image using the set of images as "pixels"

picinpics Script that receives an Image (original) and a set of images to be used as "pixels" in reconstruction of the Original image using the set of

the code used for the preprint Embedding-based Instance Segmentation of Microscopy Images.
the code used for the preprint Embedding-based Instance Segmentation of Microscopy Images.

EmbedSeg Introduction This repository hosts the version of the code used for the preprint Embedding-based Instance Segmentation of Microscopy Images.

Shape-aware Semi-supervised 3D Semantic Segmentation for Medical Images

SASSnet Code for paper: Shape-aware Semi-supervised 3D Semantic Segmentation for Medical Images(MICCAI 2020) Our code is origin from UA-MT You can fin

This repository allows you to anonymize sensitive information in images/videos. The solution is fully compatible with the DL-based training/inference solutions that we already published/will publish for Object Detection and Semantic Segmentation. Semantic Segmentation of images using PixelLib with help of Pascalvoc dataset trained with Deeplabv3+ framework.
Semantic Segmentation of images using PixelLib with help of Pascalvoc dataset trained with Deeplabv3+ framework.

CARscan- Approach 1 - Segmentation of images by detecting contours. It failed because in images with elements along with cars were also getting detect

[MedIA2021]MIDeepSeg: Minimally Interactive Segmentation of Unseen Objects from Medical Images Using Deep Learning
[MedIA2021]MIDeepSeg: Minimally Interactive Segmentation of Unseen Objects from Medical Images Using Deep Learning

MIDeepSeg: Minimally Interactive Segmentation of Unseen Objects from Medical Images Using Deep Learning [MedIA or Arxiv] and [Demo] This repository pr

Deep Multi-Magnification Network for multi-class tissue segmentation of whole slide images
Deep Multi-Magnification Network for multi-class tissue segmentation of whole slide images

Deep Multi-Magnification Network This repository provides training and inference codes for Deep Multi-Magnification Network published here. Deep Multi

M2MRF: Many-to-Many Reassembly of Features for Tiny Lesion Segmentation in Fundus Images

M2MRF: Many-to-Many Reassembly of Features for Tiny Lesion Segmentation in Fundus Images This repo is the official implementation of paper "M2MRF: Man

Comments
  • how can I run network in python?

    how can I run network in python?

    I tried to run pixelobjectness network in python. following code is the code.

    The output of following code is not the expected result.

    I want to know what is the wrong code.

    ` import numpy as np from PIL import Image as PILImage import caffe _FOLDER = '/opt/pixelobjectness/' MODEL_FILE = _FOLDER+'test.prototxt' PRETRAINED = _FOLDER+'pixel_objectness.caffemodel' net = caffe.Net(MODEL_FILE, PRETRAINED)

    net.set_mode_gpu() net.set_device(0) net.set_phase_test()

    mean_vec = np.array([104.008, 116.669, 122.675], dtype=np.float32) reshaped_mean_vec = mean_vec.reshape(1, 1, 3);

    net.set_raw_scale('data',255) net.set_mean('data', reshaped_mean_vec) net.set_channel_swap('data', (2, 1, 0))

    IMAGE_FILE = '/opt/pixelobjectness/images/n01736375_3996.JPEG' im = caffe.io.load_image(IMAGE_FILE) im2 = net.preprocess('data',im)

    net.blobs['data'].data[...] = im2

    output = net.forward() d = output['fc8_interp'].reshape(513,513,2,1)

    import cPickle as pickle with file("/root/workspace/images/a2.mat","w") as fout: pickle.dump(output['fc8_interp'], fout)

    `

    opened by justinbuzzni 1
  • Trouble replicating the results

    Trouble replicating the results

    Hi, I was trying to replicate the results presented in your paper and ran into some problems. As far as I understand, you more or less follow the training procedure for DeepLab_LargeFOV network outlined here but with 2 classes instead of the original 21 and without the final CRF refinement layer (correct me if this is wrong). I am training on the 10,582 images from the augmented PASCAL dataset, initialize the weights with VGG trained on ImageNet and use learning parameters as specified in the paper, however the results are not nearly as good. I haven't run the full set of tests yet, but on the example images results produced by my network are far worse than the published pixelobjectness model. Also suspiciously, the loss fluctuates significantly and training for 10000 iterations takes about 3 hours on NVIDIA Titan X instead of 8 hours stated in the paper. Below is the solver I've been using, could you please let me know if I'm missing something?

    `lr_policy: "step" gamma: 0.1 stepsize: 2000 base_lr: 0.001

    display: 10 max_iter: 10000 momentum: 0.9 weight_decay: 0.0005`

    opened by ykotseruba 0
  • After run demo.py, there are 4-dimensional .mat files generated?

    After run demo.py, there are 4-dimensional .mat files generated?

    Hi, I use this codes and run demo.py, there are 4-dimensional .mat files generated. But show_result.m just process 3-dimensional .mat files, what is wrong with me??

    thanks!!

    When I run show_result.m file, there is a error:

    Error using permute ORDER must have at least N elements for an N-D array.

    Error in show_results (line 23) raw_result = permute(raw_result, [2 1 3]);

    opened by luluerry 5
Owner
Suyog Jain
PhD in Computer Vision, Research Scientist at PathAI
Suyog Jain
An image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testingAn image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testing

SVM Données Une base d’images contient 490 images pour l’apprentissage (400 voitures et 90 bateaux), et encore 21 images pour fait des tests. Prétrait

Achraf Rahouti 3 Nov 30, 2021
The first dataset on shadow generation for the foreground object in real-world scenes.

Object-Shadow-Generation-Dataset-DESOBA Object Shadow Generation is to deal with the shadow inconsistency between the foreground object and the backgr

BCMI 105 Dec 30, 2022
Commonality in Natural Images Rescues GANs: Pretraining GANs with Generic and Privacy-free Synthetic Data - Official PyTorch Implementation (CVPR 2022)

Commonality in Natural Images Rescues GANs: Pretraining GANs with Generic and Privacy-free Synthetic Data (CVPR 2022) Potentials of primitive shapes f

null 31 Sep 27, 2022
Generic Event Boundary Detection: A Benchmark for Event Segmentation

Generic Event Boundary Detection: A Benchmark for Event Segmentation We release our data annotation & baseline codes for detecting generic event bound

null 47 Nov 22, 2022
a generic C++ library for image analysis

VIGRA Computer Vision Library Copyright 1998-2013 by Ullrich Koethe This file is part of the VIGRA computer vision library. You may use,

Ullrich Koethe 378 Dec 30, 2022
Generic template to bootstrap your PyTorch project with PyTorch Lightning, Hydra, W&B, and DVC.

NN Template Generic template to bootstrap your PyTorch project. Click on Use this Template and avoid writing boilerplate code for: PyTorch Lightning,

Luca Moschella 520 Dec 30, 2022
Official PyTorch implementation for Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers, a novel method to visualize any Transformer-based network. Including examples for DETR, VQA.

PyTorch Implementation of Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers 1 Using Colab Please notic

Hila Chefer 489 Jan 7, 2023
PyTorch implementation of EGVSR: Efficcient & Generic Video Super-Resolution (VSR)

This is a PyTorch implementation of EGVSR: Efficcient & Generic Video Super-Resolution (VSR), using subpixel convolution to optimize the inference speed of TecoGAN VSR model. Please refer to the official implementation ESPCN and TecoGAN for more information.

null 789 Jan 4, 2023
[ICCV2021] IICNet: A Generic Framework for Reversible Image Conversion

IICNet - Invertible Image Conversion Net Official PyTorch Implementation for IICNet: A Generic Framework for Reversible Image Conversion (ICCV2021). D

felixcheng97 55 Dec 6, 2022
The Generic Manipulation Driver Package - Implements a ROS Interface over the robotics toolbox for Python

Armer Driver Armer aims to provide an interface layer between the hardware drivers of a robotic arm giving the user control in several ways: Joint vel

QUT Centre for Robotics (QCR) 13 Nov 26, 2022