Giter Site home page Giter Site logo

delse's Introduction

Deep Extreme Level Set Evolution (DELSE)

This is the PyTorch implementation of DELSE model for object instance segmentation. This repository provides code to train and evaluate with DELSE. For details, please refer to:

Object Instance Annotation with Deep Extreme Level Set Evolution
Zian Wang, David Acuna*, Huan Ling*, Amlan Kar, Sanja Fidler

[Project Page][Paper] [Poster][bibtex]

CVPR 2019

Where is the code?

To get the code, please sign up here. We will be using GitHub to keep track of issues with the code and to update on availability of newer versions (also available on website and through e-mail to signed up users).

If you find this code helpful, please consider citing

@inproceedings{DELSE2019,
title={Object Instance Annotation with Deep Extreme Level Set Evolution},
author={Zian Wang and David Acuna and Huan Ling and Amlan Kar and Sanja Fidler},
booktitle={CVPR},
year={2019}
}

Installation

The code was tested with Anaconda (Python 3.6) and PyTorch 0.4.1.

  1. Install dependencies:

    conda install pytorch torchvision -c pytorch
    conda install matplotlib opencv pillow scikit-image
    pip install tensorboard tensorboardx
    
  2. Download the pre-trained PSPNet model.

    cd models/
    chmod +x download_pretrained_psp_model.sh
    ./download_pretrained_psp_model.sh
  3. Set the paths in mypath.py, so that they point to the appropriate locations of PASCAL/SBD/DAVIS/CityScapes dataset.

Data

Cityscapes

  • Download the Cityscapes dataset (leftImg8bit_trainvaltest.zip) from the official website [11 GB]
  • Download our processed annotation files from here [68 MB]
  • From the root directory, run the following command with appropriate paths to get the annotation files ready for your machine
python dataloaders/change_paths.py --city_dir <path_to_downloaded_leftImg8bit_folder> --json_dir <path_to_downloaded_annotation_file> --output_dir <output_dir>
  • Set the path in mypath.py to the location of CityScapes dataset.

Scripts

Project Structure

.
├── networks        				# backend CNN modules
|   └── ...       		
├── layers           			# loss and level set evolution mechanism
|   └── ...
├── dataloaders           			# thank DEXTR and PolyRNN for loaders
|   ├── cityscapes.py       		
|   ├── davis.py        			
|   ├── pascal.py    				
|   ├── sbd.py    					
|   ├── custom_transforms.py    	# transforms for data
|   ├── helpers.py    			# helper functions used in data processing
|   └── ...
├── models				# deeplab pretrained model
|   └── ...
├── evaluation						
|   └── eval.py				# function for eval
|
├── DELSE.py       			# model
├── mypath.py     			# path for datasets
├── eval_multi.py     			# run multi evaluation 
└── main.py        			# training and testing

Training

Run python main.py for training. The default argparse parameters is for Cityscapes. The parameters of settings are in main.py.

Evaluation

Set the index of experiments and evaluation settings in eval_multi.py (Line 14-18 in function param_generateor). Run python eval_multi.py for evaluation on your predicted results.

The model ckeckpoint on Cityscapes dataset can be found here. If the intermediate outputs are not saved, please get the inference outputs first with the test function in DELSE.py.


If you have questions with this code, please contact [email protected]. We would like to thank DEXTR for releasing their code.

delse's People

Contributors

amlankar avatar zian-w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

delse's Issues

Code request

I have already submit the request list, but I still have no access to the code. Could you please share the code if possible. Thanks.

Motion Field Editing Code

Where can we find the code for motion field editing and interactive click simulation during training, as detailed in section 4.4 of the paper?

code request

Hi:
I have sign up ,and what I shoud do next to get the code

problem: execution of eval_multi.py

Hi~ When I run python eval_multi.py, I get the output as follows:

Mask_TH = -6
Mask_TH = -4
Mask_TH = -2
Evaluating: 0 of 9784 objects
Evaluating: 0 of 9784 objects
Mask_TH = -1
Evaluating: 0 of 9784 objects
Mask_TH = 0
Evaluating: 0 of 9784 objects
Mask_TH = 1
Evaluating: 0 of 9784 objects
Mask_TH = 2
Mask_TH = 4
Evaluating: 0 of 9784 objects
Evaluating: 0 of 9784 objects
Evaluating: 0 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 500 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1000 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 1500 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2000 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 2500 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3000 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 3500 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4000 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 4500 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5000 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 5500 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6000 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 6500 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7000 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 7500 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8000 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 8500 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9000 of 9784 objects
Evaluating: 9500 of 9784 objects
Evaluating: 9500 of 9784 objects
Evaluating: 9500 of 9784 objects
Evaluating: 9500 of 9784 objects
Evaluating: 9500 of 9784 objects
Evaluating: 9500 of 9784 objects
Evaluating: 9500 of 9784 objects
Evaluating: 9500 of 9784 objects
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=2)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=-1)
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=-2)
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=-6)
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=4)
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=0)
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=-4)
/home/tzq-zyy/code/delse-master/code/delse-release/evaluation/eval.py:38: RuntimeWarning: Mean of empty slice.
  all_apr[ii] = per_cat_recall.mean()
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/home/tzq-zyy/usr/local/anaconda3/envs/pytorch-delse/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3257: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
Result for ./exp/run_0004/results_ep40: 0.0000 (MASK_TH=1)

and I get json file:

run_0004_ep40_TH2.json
run_0004_ep40_TH-2.json
run_0004_ep40_TH4.json
run_0004_ep40_TH-4.json
run_0004_ep40_TH-6.json
run_0004_ep40_TH0.json
run_0004_ep40_TH1.json
run_0004_ep40_TH-1.json

but the content of those json file is:

{
    "all_jaccards": "[0. 0. 0. ... 0. 0. 0.]",
    "per_categ_jaccard": "{}",
    "per_categ_mean_jaccard": "{}",
    "all_F": "{1: array([0., 0., 0., ..., 0., 0., 0.]), 2: array([0., 0., 0., ..., 0., 0., 0.])}",
    "per_categ_F": "{1: {}, 2: {}}",
    "per_categ_mean_F": "{1: {}, 2: {}}",
    "J mAPr0.5": "nan",
    "J mAPr0.7": "nan",
    "J mAPr-vol": "nan",
    "mIoU": "nan",
    "F mAPr0.5 TH1": "nan",
    "F mAPr0.7 TH1": "nan",
    "F mean TH1": "nan",
    "F mAPr0.5 TH2": "nan",
    "F mAPr0.7 TH2": "nan",
    "F mean TH2": "nan",
    "mean_jaccards": "0.0",
    "folder": "./exp/run_0004/results_ep40",
    "mask_thres": "2"
}

I think some thing is wrong, can someone tell me what happened?
(I use the CityScapes dataset and training process is OK.)

Thanks a lot~

Code requested

Hi, I have requested access to the code-base using the form you provided, but do not have access yet. Is it possible to share the code? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.