Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

Add PSPNet model #388

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0ee2a76
Add PSPNet model
mitmul Aug 10, 2017
d31b837
Update PSPNet model
mitmul Aug 14, 2017
8c835e3
Fix convert.py
mitmul Aug 14, 2017
005c0ae
Fix URLs
mitmul Aug 15, 2017
97f3340
Merge branch 'add-cityscapes' into add-pspnet-infer
mitmul Aug 15, 2017
7787729
Revert model around auxiliary loss branch
mitmul Aug 15, 2017
163ea83
Update demo.py
mitmul Aug 15, 2017
13a5ace
Update demo.py
mitmul Aug 15, 2017
7489085
Merge branch 'master' of github.com:chainer/chainercv into add-pspnet…
mitmul Sep 25, 2017
4017ba7
Add predict.py
mitmul Oct 4, 2017
55a4f0d
update readme
mitmul Oct 4, 2017
dbe3c2b
Remove download.sh
mitmul Oct 4, 2017
07c8594
Update readme
mitmul Oct 4, 2017
e4b5ea0
Merge branch 'cityscapes-label-variable-names' of https://github.com/…
mitmul Oct 4, 2017
d40e24f
Merge branch 'add-ade20k' of https://github.com/mitmul/chainercv into…
mitmul Oct 4, 2017
78ad097
Fix
mitmul Oct 4, 2017
fbb8606
Fix import
mitmul Oct 4, 2017
891c68d
flake8
mitmul Oct 4, 2017
f567ebc
Add setup.cfg
mitmul Oct 4, 2017
1f1c382
Fix conver.py
mitmul Oct 4, 2017
0278ce5
Fix flake8
mitmul Oct 4, 2017
3f4a0b0
Merge branch 'master' of github.com:chainer/chainercv into add-pspnet…
mitmul Oct 8, 2017
d104b06
Use conv1, conv2, ... for the attribute name of ConvBNReLU link
mitmul Nov 16, 2017
09e196f
Merge DilatedResBlock and ResBlock
mitmul Nov 16, 2017
9dd625b
Always return h1 and h2 in DilatedFCN's __call__
mitmul Nov 16, 2017
a941993
Follow conventions
mitmul Dec 10, 2017
9a8d630
Merge branch 'master' of github.com:chainer/chainercv into add-pspnet…
mitmul May 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use conv1, conv2, ... for the attribute name of ConvBNReLU link
mitmul committed Nov 16, 2017
commit d104b0614ab84fa385c2a20239ab32538820a4ba
86 changes: 86 additions & 0 deletions .vscode/.ropeproject/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# The default ``config.py``


def set_prefs(prefs):
"""This function is called before opening the project"""

# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_files()`.
# Note that ``?`` and ``*`` match all characters but slashes.
# '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
# 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
# '.svn': matches 'pkg/.svn' and all of its children
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
'.hg', '.svn', '_svn', '.git',
'__pycache__']

# Specifies which files should be considered python files. It is
# useful when you have scripts inside your project. Only files
# ending with ``.py`` are considered to be python files by
# default.
#prefs['python_files'] = ['*.py']

# Custom source folders: By default rope searches the project
# for finding source folders (folders that should be searched
# for finding modules). You can add paths to that list. Note
# that rope guesses project source folders correctly most of the
# time; use this if you have any problems.
# The folders should be relative to project root and use '/' for
# separating folders regardless of the platform rope is running on.
# 'src/my_source_folder' for instance.
#prefs.add('source_folders', 'src')

# You can extend python path for looking up modules
#prefs.add('python_path', '~/python/')

# Should rope save object information or not.
prefs['save_objectdb'] = True
prefs['compress_objectdb'] = False

# If `True`, rope analyzes each module when it is being saved.
prefs['automatic_soa'] = True
# The depth of calls to follow in static object analysis
prefs['soa_followed_calls'] = 0

# If `False` when running modules or unit tests "dynamic object
# analysis" is turned off. This makes them much faster.
prefs['perform_doa'] = True

# Rope can check the validity of its object DB when running.
prefs['validate_objectdb'] = True

# How many undos to hold?
prefs['max_history_items'] = 32

# Shows whether to save history across sessions.
prefs['save_history'] = True
prefs['compress_history'] = False

# Set the number spaces used for indenting. According to
# :PEP:`8`, it is best to use 4 spaces. Since most of rope's
# unit-tests use 4 spaces it is more reliable, too.
prefs['indent_size'] = 4

# Builtin and c-extension modules that are allowed to be imported
# and inspected by rope.
prefs['extension_modules'] = []

# Add all standard c-extensions to extension_modules list.
prefs['import_dynload_stdmods'] = True

# If `True` modules with syntax errors are considered to be empty.
# The default value is `False`; When `False` syntax errors raise
# `rope.base.exceptions.ModuleSyntaxError` exception.
prefs['ignore_syntax_errors'] = False

# If `True`, rope ignores unresolvable imports. Otherwise, they
# appear in the importing namespace.
prefs['ignore_bad_imports'] = False


def project_opened(project):
"""This function is called after opening the project"""
# Do whatever you like here!
18 changes: 9 additions & 9 deletions chainercv/links/model/pspnet/pspnet.py
Original file line number Diff line number Diff line change
@@ -76,21 +76,21 @@ def __init__(self, in_ch, mid_ch, out_ch, stride=2, dilate=False):
mid_stride = chainer.config.mid_stride
super(BottleneckConv, self).__init__()
with self.init_scope():
self.cbr1 = ConvBNReLU(
self.conv1 = ConvBNReLU(
in_ch, mid_ch, 1, 1 if mid_stride else stride, 0)
if dilate:
self.cbr2 = ConvBNReLU(mid_ch, mid_ch, 3, 1, dilate, dilate)
self.conv2 = ConvBNReLU(mid_ch, mid_ch, 3, 1, dilate, dilate)
else:
self.cbr2 = ConvBNReLU(
self.conv2 = ConvBNReLU(
mid_ch, mid_ch, 3, stride if mid_stride else 1, 1)
self.cbr3 = ConvBNReLU(mid_ch, out_ch, 1, 1, 0)
self.cbr4 = ConvBNReLU(in_ch, out_ch, 1, stride, 0)
self.conv3 = ConvBNReLU(mid_ch, out_ch, 1, 1, 0)
self.conv4 = ConvBNReLU(in_ch, out_ch, 1, stride, 0)

def __call__(self, x):
h = self.cbr1(x)
h = self.cbr2(h)
h1 = self.cbr3(h, relu=False)
h2 = self.cbr4(x, relu=False)
h = self.conv1(x)
h = self.conv2(h)
h1 = self.conv3(h, relu=False)
h2 = self.conv4(x, relu=False)
return F.relu(h1 + h2)