diff options
-rw-r--r-- | README.rst | 11 | ||||
-rwxr-xr-x | fhost.py | 78 | ||||
-rw-r--r-- | migrations/versions/7e246705da6a_.py | 26 | ||||
-rwxr-xr-x | nsfw_detect.py | 62 | ||||
-rw-r--r-- | nsfw_model/LICENSE.md | 11 | ||||
-rw-r--r-- | nsfw_model/deploy.prototxt | 3488 | ||||
-rw-r--r-- | nsfw_model/resnet_50_1by2_nsfw.caffemodel | bin | 0 -> 23815355 bytes |
7 files changed, 3666 insertions, 10 deletions
@@ -25,6 +25,17 @@ now and then. Before running the service for the first time, run ``./fhost.py db upgrade``. +NSFW Detection +-------------- + +0x0 supports classification of NSFW content via Yahoo’s open_nsfw Caffe +neural network model. This works for images and video files and requires +the following: + +* Caffe Python module (built for Python 3) +* ``ffmpegthumbnailer`` executable in ``$PATH`` + + FAQ --- @@ -44,6 +44,13 @@ app.config["FHOST_MIME_BLACKLIST"] = [ app.config["FHOST_UPLOAD_BLACKLIST"] = "tornodes.txt" +app.config["NSFW_DETECT"] = True +app.config["NSFW_THRESHOLD"] = 0.7 + +if app.config["NSFW_DETECT"]: + from nsfw_detect import NSFWDetector + nsfw = NSFWDetector() + try: mimedetect = Magic(mime=True, mime_encoding=False) except: @@ -72,6 +79,9 @@ class URL(db.Model): def getname(self): return su.enbase(self.id, 1) + def geturl(self): + return url_for("get", path=self.getname(), _external=True) + "\n" + class File(db.Model): id = db.Column(db.Integer, primary_key = True) sha256 = db.Column(db.String, unique = True) @@ -79,23 +89,29 @@ class File(db.Model): mime = db.Column(db.UnicodeText) addr = db.Column(db.UnicodeText) removed = db.Column(db.Boolean, default=False) + nsfw_score = db.Column(db.Float) - def __init__(self, sha256, ext, mime, addr): + def __init__(self, sha256, ext, mime, addr, nsfw_score): self.sha256 = sha256 self.ext = ext self.mime = mime self.addr = addr + self.nsfw_score = nsfw_score def getname(self): return u"{0}{1}".format(su.enbase(self.id, 1), self.ext) + def geturl(self): + n = self.getname() + + if self.nsfw_score and self.nsfw_score > app.config["NSFW_THRESHOLD"]: + return url_for("get", path=n, _external=True, _anchor="nsfw") + "\n" + else: + return url_for("get", path=n, _external=True) + "\n" def getpath(fn): return os.path.join(app.config["FHOST_STORAGE_PATH"], fn) -def geturl(p): - return url_for("get", path=p, _external=True) + "\n" - def fhost_url(scheme=None): if not scheme: return url_for(".fhost", _external=True).rstrip("/") @@ -115,13 +131,13 @@ def shorten(url): existing = URL.query.filter_by(url=url).first() if existing: - return geturl(existing.getname()) + return existing.geturl() else: u = URL(url) db.session.add(u) db.session.commit() - return geturl(u.getname()) + return u.geturl() def in_upload_bl(addr): if os.path.isfile(app.config["FHOST_UPLOAD_BLACKLIST"]): @@ -152,11 +168,15 @@ def store_file(f, addr): with open(epath, "wb") as of: of.write(data) + if existing.nsfw_score == None: + if app.config["NSFW_DETECT"]: + existing.nsfw_score = nsfw.detect(epath) + os.utime(epath, None) existing.addr = addr db.session.commit() - return geturl(existing.getname()) + return existing.geturl() else: guessmime = mimedetect.from_buffer(data) @@ -186,14 +206,21 @@ def store_file(f, addr): if not ext: ext = ".bin" - with open(getpath(digest), "wb") as of: + spath = getpath(digest) + + with open(spath, "wb") as of: of.write(data) - sf = File(digest, ext, mime, addr) + if app.config["NSFW_DETECT"]: + nsfw_score = nsfw.detect(spath) + else: + nsfw_score = None + + sf = File(digest, ext, mime, addr, nsfw_score) db.session.add(sf) db.session.commit() - return geturl(sf.getname()) + return sf.geturl() def store_url(url, addr): if is_fhost_url(url): @@ -438,6 +465,37 @@ def queryaddr(a): for f in res: query(su.enbase(f.id, 1)) +def nsfw_detect(f): + try: + open(f["path"], 'r').close() + f["nsfw_score"] = nsfw.detect(f["path"]) + return f + except: + return None + +@manager.command +def update_nsfw(): + if not app.config["NSFW_DETECT"]: + print("NSFW detection is disabled in app config") + return 1 + + from multiprocessing import Pool + import tqdm + + res = File.query.filter_by(nsfw_score=None, removed=False) + + with Pool() as p: + results = [] + work = [{ "path" : getpath(f.sha256), "id" : f.id} for f in res] + + for r in tqdm.tqdm(p.imap_unordered(nsfw_detect, work), total=len(work)): + if r: + results.append({"id": r["id"], "nsfw_score" : r["nsfw_score"]}) + + db.session.bulk_update_mappings(File, results) + db.session.commit() + + @manager.command def querybl(): if os.path.isfile(app.config["FHOST_UPLOAD_BLACKLIST"]): diff --git a/migrations/versions/7e246705da6a_.py b/migrations/versions/7e246705da6a_.py new file mode 100644 index 0000000..33dbf79 --- /dev/null +++ b/migrations/versions/7e246705da6a_.py @@ -0,0 +1,26 @@ +"""add NSFW score + +Revision ID: 7e246705da6a +Revises: 0cd36ecdd937 +Create Date: 2017-10-27 03:07:48.179290 + +""" + +# revision identifiers, used by Alembic. +revision = '7e246705da6a' +down_revision = '0cd36ecdd937' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('file', sa.Column('nsfw_score', sa.Float(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('file', 'nsfw_score') + # ### end Alembic commands ### diff --git a/nsfw_detect.py b/nsfw_detect.py new file mode 100755 index 0000000..fc9a7dd --- /dev/null +++ b/nsfw_detect.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +import numpy as np +import os +import sys +from io import BytesIO +from subprocess import run, PIPE, DEVNULL + +os.environ["GLOG_minloglevel"] = "2" # seriously :| +import caffe + +class NSFWDetector: + def __init__(self): + + npath = os.path.join(os.path.dirname(__file__), "nsfw_model") + self.nsfw_net = caffe.Net(os.path.join(npath, "deploy.prototxt"), + os.path.join(npath, "resnet_50_1by2_nsfw.caffemodel"), + caffe.TEST) + self.caffe_transformer = caffe.io.Transformer({'data': self.nsfw_net.blobs['data'].data.shape}) + self.caffe_transformer.set_transpose('data', (2, 0, 1)) # move image channels to outermost + self.caffe_transformer.set_mean('data', np.array([104, 117, 123])) # subtract the dataset-mean value in each channel + self.caffe_transformer.set_raw_scale('data', 255) # rescale from [0, 1] to [0, 255] + self.caffe_transformer.set_channel_swap('data', (2, 1, 0)) # swap channels from RGB to BGR + + def _compute(self, img): + image = caffe.io.load_image(BytesIO(img)) + + H, W, _ = image.shape + _, _, h, w = self.nsfw_net.blobs["data"].data.shape + h_off = int(max((H - h) / 2, 0)) + w_off = int(max((W - w) / 2, 0)) + crop = image[h_off:h_off + h, w_off:w_off + w, :] + + transformed_image = self.caffe_transformer.preprocess('data', crop) + transformed_image.shape = (1,) + transformed_image.shape + + input_name = self.nsfw_net.inputs[0] + output_layers = ["prob"] + all_outputs = self.nsfw_net.forward_all(blobs=output_layers, + **{input_name: transformed_image}) + + outputs = all_outputs[output_layers[0]][0].astype(float) + + return outputs + + def detect(self, fpath): + try: + ff = run(["ffmpegthumbnailer", "-m", "-o-", "-s256", "-t50%", "-a", "-cpng", "-i", fpath], stdout=PIPE, stderr=DEVNULL, check=True) + image_data = ff.stdout + except: + return -1.0 + + scores = self._compute(image_data) + + return scores[1] + +if __name__ == "__main__": + n = NSFWDetector() + + for inf in sys.argv[1:]: + score = n.detect(inf) + print(inf, score) diff --git a/nsfw_model/LICENSE.md b/nsfw_model/LICENSE.md new file mode 100644 index 0000000..d1124b0 --- /dev/null +++ b/nsfw_model/LICENSE.md @@ -0,0 +1,11 @@ + +Copyright 2016, Yahoo Inc. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/nsfw_model/deploy.prototxt b/nsfw_model/deploy.prototxt new file mode 100644 index 0000000..16fb53e --- /dev/null +++ b/nsfw_model/deploy.prototxt @@ -0,0 +1,3488 @@ +name: "ResNet_50_1by2_nsfw" +layer { + name: "data" + type: "Input" + top: "data" + input_param { shape: { dim: 1 dim: 3 dim: 224 dim: 224 } } +} +layer { + name: "conv_1" + type: "Convolution" + bottom: "data" + top: "conv_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 3 + kernel_size: 7 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_1" + type: "BatchNorm" + bottom: "conv_1" + top: "conv_1" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_1" + type: "Scale" + bottom: "conv_1" + top: "conv_1" + scale_param { + bias_term: true + } +} +layer { + name: "relu_1" + type: "ReLU" + bottom: "conv_1" + top: "conv_1" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv_1" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "conv_stage0_block0_proj_shortcut" + type: "Convolution" + bottom: "pool1" + top: "conv_stage0_block0_proj_shortcut" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block0_proj_shortcut" + type: "BatchNorm" + bottom: "conv_stage0_block0_proj_shortcut" + top: "conv_stage0_block0_proj_shortcut" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block0_proj_shortcut" + type: "Scale" + bottom: "conv_stage0_block0_proj_shortcut" + top: "conv_stage0_block0_proj_shortcut" + scale_param { + bias_term: true + } +} +layer { + name: "conv_stage0_block0_branch2a" + type: "Convolution" + bottom: "pool1" + top: "conv_stage0_block0_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block0_branch2a" + type: "BatchNorm" + bottom: "conv_stage0_block0_branch2a" + top: "conv_stage0_block0_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block0_branch2a" + type: "Scale" + bottom: "conv_stage0_block0_branch2a" + top: "conv_stage0_block0_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage0_block0_branch2a" + type: "ReLU" + bottom: "conv_stage0_block0_branch2a" + top: "conv_stage0_block0_branch2a" +} +layer { + name: "conv_stage0_block0_branch2b" + type: "Convolution" + bottom: "conv_stage0_block0_branch2a" + top: "conv_stage0_block0_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block0_branch2b" + type: "BatchNorm" + bottom: "conv_stage0_block0_branch2b" + top: "conv_stage0_block0_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block0_branch2b" + type: "Scale" + bottom: "conv_stage0_block0_branch2b" + top: "conv_stage0_block0_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage0_block0_branch2b" + type: "ReLU" + bottom: "conv_stage0_block0_branch2b" + top: "conv_stage0_block0_branch2b" +} +layer { + name: "conv_stage0_block0_branch2c" + type: "Convolution" + bottom: "conv_stage0_block0_branch2b" + top: "conv_stage0_block0_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block0_branch2c" + type: "BatchNorm" + bottom: "conv_stage0_block0_branch2c" + top: "conv_stage0_block0_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block0_branch2c" + type: "Scale" + bottom: "conv_stage0_block0_branch2c" + top: "conv_stage0_block0_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage0_block0" + type: "Eltwise" + bottom: "conv_stage0_block0_proj_shortcut" + bottom: "conv_stage0_block0_branch2c" + top: "eltwise_stage0_block0" +} +layer { + name: "relu_stage0_block0" + type: "ReLU" + bottom: "eltwise_stage0_block0" + top: "eltwise_stage0_block0" +} +layer { + name: "conv_stage0_block1_branch2a" + type: "Convolution" + bottom: "eltwise_stage0_block0" + top: "conv_stage0_block1_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block1_branch2a" + type: "BatchNorm" + bottom: "conv_stage0_block1_branch2a" + top: "conv_stage0_block1_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block1_branch2a" + type: "Scale" + bottom: "conv_stage0_block1_branch2a" + top: "conv_stage0_block1_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage0_block1_branch2a" + type: "ReLU" + bottom: "conv_stage0_block1_branch2a" + top: "conv_stage0_block1_branch2a" +} +layer { + name: "conv_stage0_block1_branch2b" + type: "Convolution" + bottom: "conv_stage0_block1_branch2a" + top: "conv_stage0_block1_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block1_branch2b" + type: "BatchNorm" + bottom: "conv_stage0_block1_branch2b" + top: "conv_stage0_block1_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block1_branch2b" + type: "Scale" + bottom: "conv_stage0_block1_branch2b" + top: "conv_stage0_block1_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage0_block1_branch2b" + type: "ReLU" + bottom: "conv_stage0_block1_branch2b" + top: "conv_stage0_block1_branch2b" +} +layer { + name: "conv_stage0_block1_branch2c" + type: "Convolution" + bottom: "conv_stage0_block1_branch2b" + top: "conv_stage0_block1_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block1_branch2c" + type: "BatchNorm" + bottom: "conv_stage0_block1_branch2c" + top: "conv_stage0_block1_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block1_branch2c" + type: "Scale" + bottom: "conv_stage0_block1_branch2c" + top: "conv_stage0_block1_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage0_block1" + type: "Eltwise" + bottom: "eltwise_stage0_block0" + bottom: "conv_stage0_block1_branch2c" + top: "eltwise_stage0_block1" +} +layer { + name: "relu_stage0_block1" + type: "ReLU" + bottom: "eltwise_stage0_block1" + top: "eltwise_stage0_block1" +} +layer { + name: "conv_stage0_block2_branch2a" + type: "Convolution" + bottom: "eltwise_stage0_block1" + top: "conv_stage0_block2_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block2_branch2a" + type: "BatchNorm" + bottom: "conv_stage0_block2_branch2a" + top: "conv_stage0_block2_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block2_branch2a" + type: "Scale" + bottom: "conv_stage0_block2_branch2a" + top: "conv_stage0_block2_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage0_block2_branch2a" + type: "ReLU" + bottom: "conv_stage0_block2_branch2a" + top: "conv_stage0_block2_branch2a" +} +layer { + name: "conv_stage0_block2_branch2b" + type: "Convolution" + bottom: "conv_stage0_block2_branch2a" + top: "conv_stage0_block2_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block2_branch2b" + type: "BatchNorm" + bottom: "conv_stage0_block2_branch2b" + top: "conv_stage0_block2_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block2_branch2b" + type: "Scale" + bottom: "conv_stage0_block2_branch2b" + top: "conv_stage0_block2_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage0_block2_branch2b" + type: "ReLU" + bottom: "conv_stage0_block2_branch2b" + top: "conv_stage0_block2_branch2b" +} +layer { + name: "conv_stage0_block2_branch2c" + type: "Convolution" + bottom: "conv_stage0_block2_branch2b" + top: "conv_stage0_block2_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage0_block2_branch2c" + type: "BatchNorm" + bottom: "conv_stage0_block2_branch2c" + top: "conv_stage0_block2_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage0_block2_branch2c" + type: "Scale" + bottom: "conv_stage0_block2_branch2c" + top: "conv_stage0_block2_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage0_block2" + type: "Eltwise" + bottom: "eltwise_stage0_block1" + bottom: "conv_stage0_block2_branch2c" + top: "eltwise_stage0_block2" +} +layer { + name: "relu_stage0_block2" + type: "ReLU" + bottom: "eltwise_stage0_block2" + top: "eltwise_stage0_block2" +} +layer { + name: "conv_stage1_block0_proj_shortcut" + type: "Convolution" + bottom: "eltwise_stage0_block2" + top: "conv_stage1_block0_proj_shortcut" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block0_proj_shortcut" + type: "BatchNorm" + bottom: "conv_stage1_block0_proj_shortcut" + top: "conv_stage1_block0_proj_shortcut" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block0_proj_shortcut" + type: "Scale" + bottom: "conv_stage1_block0_proj_shortcut" + top: "conv_stage1_block0_proj_shortcut" + scale_param { + bias_term: true + } +} +layer { + name: "conv_stage1_block0_branch2a" + type: "Convolution" + bottom: "eltwise_stage0_block2" + top: "conv_stage1_block0_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block0_branch2a" + type: "BatchNorm" + bottom: "conv_stage1_block0_branch2a" + top: "conv_stage1_block0_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block0_branch2a" + type: "Scale" + bottom: "conv_stage1_block0_branch2a" + top: "conv_stage1_block0_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block0_branch2a" + type: "ReLU" + bottom: "conv_stage1_block0_branch2a" + top: "conv_stage1_block0_branch2a" +} +layer { + name: "conv_stage1_block0_branch2b" + type: "Convolution" + bottom: "conv_stage1_block0_branch2a" + top: "conv_stage1_block0_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block0_branch2b" + type: "BatchNorm" + bottom: "conv_stage1_block0_branch2b" + top: "conv_stage1_block0_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block0_branch2b" + type: "Scale" + bottom: "conv_stage1_block0_branch2b" + top: "conv_stage1_block0_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block0_branch2b" + type: "ReLU" + bottom: "conv_stage1_block0_branch2b" + top: "conv_stage1_block0_branch2b" +} +layer { + name: "conv_stage1_block0_branch2c" + type: "Convolution" + bottom: "conv_stage1_block0_branch2b" + top: "conv_stage1_block0_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block0_branch2c" + type: "BatchNorm" + bottom: "conv_stage1_block0_branch2c" + top: "conv_stage1_block0_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block0_branch2c" + type: "Scale" + bottom: "conv_stage1_block0_branch2c" + top: "conv_stage1_block0_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage1_block0" + type: "Eltwise" + bottom: "conv_stage1_block0_proj_shortcut" + bottom: "conv_stage1_block0_branch2c" + top: "eltwise_stage1_block0" +} +layer { + name: "relu_stage1_block0" + type: "ReLU" + bottom: "eltwise_stage1_block0" + top: "eltwise_stage1_block0" +} +layer { + name: "conv_stage1_block1_branch2a" + type: "Convolution" + bottom: "eltwise_stage1_block0" + top: "conv_stage1_block1_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block1_branch2a" + type: "BatchNorm" + bottom: "conv_stage1_block1_branch2a" + top: "conv_stage1_block1_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block1_branch2a" + type: "Scale" + bottom: "conv_stage1_block1_branch2a" + top: "conv_stage1_block1_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block1_branch2a" + type: "ReLU" + bottom: "conv_stage1_block1_branch2a" + top: "conv_stage1_block1_branch2a" +} +layer { + name: "conv_stage1_block1_branch2b" + type: "Convolution" + bottom: "conv_stage1_block1_branch2a" + top: "conv_stage1_block1_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block1_branch2b" + type: "BatchNorm" + bottom: "conv_stage1_block1_branch2b" + top: "conv_stage1_block1_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block1_branch2b" + type: "Scale" + bottom: "conv_stage1_block1_branch2b" + top: "conv_stage1_block1_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block1_branch2b" + type: "ReLU" + bottom: "conv_stage1_block1_branch2b" + top: "conv_stage1_block1_branch2b" +} +layer { + name: "conv_stage1_block1_branch2c" + type: "Convolution" + bottom: "conv_stage1_block1_branch2b" + top: "conv_stage1_block1_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block1_branch2c" + type: "BatchNorm" + bottom: "conv_stage1_block1_branch2c" + top: "conv_stage1_block1_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block1_branch2c" + type: "Scale" + bottom: "conv_stage1_block1_branch2c" + top: "conv_stage1_block1_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage1_block1" + type: "Eltwise" + bottom: "eltwise_stage1_block0" + bottom: "conv_stage1_block1_branch2c" + top: "eltwise_stage1_block1" +} +layer { + name: "relu_stage1_block1" + type: "ReLU" + bottom: "eltwise_stage1_block1" + top: "eltwise_stage1_block1" +} +layer { + name: "conv_stage1_block2_branch2a" + type: "Convolution" + bottom: "eltwise_stage1_block1" + top: "conv_stage1_block2_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block2_branch2a" + type: "BatchNorm" + bottom: "conv_stage1_block2_branch2a" + top: "conv_stage1_block2_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block2_branch2a" + type: "Scale" + bottom: "conv_stage1_block2_branch2a" + top: "conv_stage1_block2_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block2_branch2a" + type: "ReLU" + bottom: "conv_stage1_block2_branch2a" + top: "conv_stage1_block2_branch2a" +} +layer { + name: "conv_stage1_block2_branch2b" + type: "Convolution" + bottom: "conv_stage1_block2_branch2a" + top: "conv_stage1_block2_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block2_branch2b" + type: "BatchNorm" + bottom: "conv_stage1_block2_branch2b" + top: "conv_stage1_block2_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block2_branch2b" + type: "Scale" + bottom: "conv_stage1_block2_branch2b" + top: "conv_stage1_block2_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block2_branch2b" + type: "ReLU" + bottom: "conv_stage1_block2_branch2b" + top: "conv_stage1_block2_branch2b" +} +layer { + name: "conv_stage1_block2_branch2c" + type: "Convolution" + bottom: "conv_stage1_block2_branch2b" + top: "conv_stage1_block2_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block2_branch2c" + type: "BatchNorm" + bottom: "conv_stage1_block2_branch2c" + top: "conv_stage1_block2_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block2_branch2c" + type: "Scale" + bottom: "conv_stage1_block2_branch2c" + top: "conv_stage1_block2_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage1_block2" + type: "Eltwise" + bottom: "eltwise_stage1_block1" + bottom: "conv_stage1_block2_branch2c" + top: "eltwise_stage1_block2" +} +layer { + name: "relu_stage1_block2" + type: "ReLU" + bottom: "eltwise_stage1_block2" + top: "eltwise_stage1_block2" +} +layer { + name: "conv_stage1_block3_branch2a" + type: "Convolution" + bottom: "eltwise_stage1_block2" + top: "conv_stage1_block3_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block3_branch2a" + type: "BatchNorm" + bottom: "conv_stage1_block3_branch2a" + top: "conv_stage1_block3_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block3_branch2a" + type: "Scale" + bottom: "conv_stage1_block3_branch2a" + top: "conv_stage1_block3_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block3_branch2a" + type: "ReLU" + bottom: "conv_stage1_block3_branch2a" + top: "conv_stage1_block3_branch2a" +} +layer { + name: "conv_stage1_block3_branch2b" + type: "Convolution" + bottom: "conv_stage1_block3_branch2a" + top: "conv_stage1_block3_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block3_branch2b" + type: "BatchNorm" + bottom: "conv_stage1_block3_branch2b" + top: "conv_stage1_block3_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block3_branch2b" + type: "Scale" + bottom: "conv_stage1_block3_branch2b" + top: "conv_stage1_block3_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage1_block3_branch2b" + type: "ReLU" + bottom: "conv_stage1_block3_branch2b" + top: "conv_stage1_block3_branch2b" +} +layer { + name: "conv_stage1_block3_branch2c" + type: "Convolution" + bottom: "conv_stage1_block3_branch2b" + top: "conv_stage1_block3_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage1_block3_branch2c" + type: "BatchNorm" + bottom: "conv_stage1_block3_branch2c" + top: "conv_stage1_block3_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage1_block3_branch2c" + type: "Scale" + bottom: "conv_stage1_block3_branch2c" + top: "conv_stage1_block3_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage1_block3" + type: "Eltwise" + bottom: "eltwise_stage1_block2" + bottom: "conv_stage1_block3_branch2c" + top: "eltwise_stage1_block3" +} +layer { + name: "relu_stage1_block3" + type: "ReLU" + bottom: "eltwise_stage1_block3" + top: "eltwise_stage1_block3" +} +layer { + name: "conv_stage2_block0_proj_shortcut" + type: "Convolution" + bottom: "eltwise_stage1_block3" + top: "conv_stage2_block0_proj_shortcut" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block0_proj_shortcut" + type: "BatchNorm" + bottom: "conv_stage2_block0_proj_shortcut" + top: "conv_stage2_block0_proj_shortcut" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block0_proj_shortcut" + type: "Scale" + bottom: "conv_stage2_block0_proj_shortcut" + top: "conv_stage2_block0_proj_shortcut" + scale_param { + bias_term: true + } +} +layer { + name: "conv_stage2_block0_branch2a" + type: "Convolution" + bottom: "eltwise_stage1_block3" + top: "conv_stage2_block0_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block0_branch2a" + type: "BatchNorm" + bottom: "conv_stage2_block0_branch2a" + top: "conv_stage2_block0_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block0_branch2a" + type: "Scale" + bottom: "conv_stage2_block0_branch2a" + top: "conv_stage2_block0_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block0_branch2a" + type: "ReLU" + bottom: "conv_stage2_block0_branch2a" + top: "conv_stage2_block0_branch2a" +} +layer { + name: "conv_stage2_block0_branch2b" + type: "Convolution" + bottom: "conv_stage2_block0_branch2a" + top: "conv_stage2_block0_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block0_branch2b" + type: "BatchNorm" + bottom: "conv_stage2_block0_branch2b" + top: "conv_stage2_block0_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block0_branch2b" + type: "Scale" + bottom: "conv_stage2_block0_branch2b" + top: "conv_stage2_block0_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block0_branch2b" + type: "ReLU" + bottom: "conv_stage2_block0_branch2b" + top: "conv_stage2_block0_branch2b" +} +layer { + name: "conv_stage2_block0_branch2c" + type: "Convolution" + bottom: "conv_stage2_block0_branch2b" + top: "conv_stage2_block0_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block0_branch2c" + type: "BatchNorm" + bottom: "conv_stage2_block0_branch2c" + top: "conv_stage2_block0_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block0_branch2c" + type: "Scale" + bottom: "conv_stage2_block0_branch2c" + top: "conv_stage2_block0_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage2_block0" + type: "Eltwise" + bottom: "conv_stage2_block0_proj_shortcut" + bottom: "conv_stage2_block0_branch2c" + top: "eltwise_stage2_block0" +} +layer { + name: "relu_stage2_block0" + type: "ReLU" + bottom: "eltwise_stage2_block0" + top: "eltwise_stage2_block0" +} +layer { + name: "conv_stage2_block1_branch2a" + type: "Convolution" + bottom: "eltwise_stage2_block0" + top: "conv_stage2_block1_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block1_branch2a" + type: "BatchNorm" + bottom: "conv_stage2_block1_branch2a" + top: "conv_stage2_block1_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block1_branch2a" + type: "Scale" + bottom: "conv_stage2_block1_branch2a" + top: "conv_stage2_block1_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block1_branch2a" + type: "ReLU" + bottom: "conv_stage2_block1_branch2a" + top: "conv_stage2_block1_branch2a" +} +layer { + name: "conv_stage2_block1_branch2b" + type: "Convolution" + bottom: "conv_stage2_block1_branch2a" + top: "conv_stage2_block1_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block1_branch2b" + type: "BatchNorm" + bottom: "conv_stage2_block1_branch2b" + top: "conv_stage2_block1_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block1_branch2b" + type: "Scale" + bottom: "conv_stage2_block1_branch2b" + top: "conv_stage2_block1_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block1_branch2b" + type: "ReLU" + bottom: "conv_stage2_block1_branch2b" + top: "conv_stage2_block1_branch2b" +} +layer { + name: "conv_stage2_block1_branch2c" + type: "Convolution" + bottom: "conv_stage2_block1_branch2b" + top: "conv_stage2_block1_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block1_branch2c" + type: "BatchNorm" + bottom: "conv_stage2_block1_branch2c" + top: "conv_stage2_block1_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block1_branch2c" + type: "Scale" + bottom: "conv_stage2_block1_branch2c" + top: "conv_stage2_block1_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage2_block1" + type: "Eltwise" + bottom: "eltwise_stage2_block0" + bottom: "conv_stage2_block1_branch2c" + top: "eltwise_stage2_block1" +} +layer { + name: "relu_stage2_block1" + type: "ReLU" + bottom: "eltwise_stage2_block1" + top: "eltwise_stage2_block1" +} +layer { + name: "conv_stage2_block2_branch2a" + type: "Convolution" + bottom: "eltwise_stage2_block1" + top: "conv_stage2_block2_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block2_branch2a" + type: "BatchNorm" + bottom: "conv_stage2_block2_branch2a" + top: "conv_stage2_block2_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block2_branch2a" + type: "Scale" + bottom: "conv_stage2_block2_branch2a" + top: "conv_stage2_block2_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block2_branch2a" + type: "ReLU" + bottom: "conv_stage2_block2_branch2a" + top: "conv_stage2_block2_branch2a" +} +layer { + name: "conv_stage2_block2_branch2b" + type: "Convolution" + bottom: "conv_stage2_block2_branch2a" + top: "conv_stage2_block2_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block2_branch2b" + type: "BatchNorm" + bottom: "conv_stage2_block2_branch2b" + top: "conv_stage2_block2_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block2_branch2b" + type: "Scale" + bottom: "conv_stage2_block2_branch2b" + top: "conv_stage2_block2_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block2_branch2b" + type: "ReLU" + bottom: "conv_stage2_block2_branch2b" + top: "conv_stage2_block2_branch2b" +} +layer { + name: "conv_stage2_block2_branch2c" + type: "Convolution" + bottom: "conv_stage2_block2_branch2b" + top: "conv_stage2_block2_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block2_branch2c" + type: "BatchNorm" + bottom: "conv_stage2_block2_branch2c" + top: "conv_stage2_block2_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block2_branch2c" + type: "Scale" + bottom: "conv_stage2_block2_branch2c" + top: "conv_stage2_block2_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage2_block2" + type: "Eltwise" + bottom: "eltwise_stage2_block1" + bottom: "conv_stage2_block2_branch2c" + top: "eltwise_stage2_block2" +} +layer { + name: "relu_stage2_block2" + type: "ReLU" + bottom: "eltwise_stage2_block2" + top: "eltwise_stage2_block2" +} +layer { + name: "conv_stage2_block3_branch2a" + type: "Convolution" + bottom: "eltwise_stage2_block2" + top: "conv_stage2_block3_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block3_branch2a" + type: "BatchNorm" + bottom: "conv_stage2_block3_branch2a" + top: "conv_stage2_block3_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block3_branch2a" + type: "Scale" + bottom: "conv_stage2_block3_branch2a" + top: "conv_stage2_block3_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block3_branch2a" + type: "ReLU" + bottom: "conv_stage2_block3_branch2a" + top: "conv_stage2_block3_branch2a" +} +layer { + name: "conv_stage2_block3_branch2b" + type: "Convolution" + bottom: "conv_stage2_block3_branch2a" + top: "conv_stage2_block3_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block3_branch2b" + type: "BatchNorm" + bottom: "conv_stage2_block3_branch2b" + top: "conv_stage2_block3_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block3_branch2b" + type: "Scale" + bottom: "conv_stage2_block3_branch2b" + top: "conv_stage2_block3_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block3_branch2b" + type: "ReLU" + bottom: "conv_stage2_block3_branch2b" + top: "conv_stage2_block3_branch2b" +} +layer { + name: "conv_stage2_block3_branch2c" + type: "Convolution" + bottom: "conv_stage2_block3_branch2b" + top: "conv_stage2_block3_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block3_branch2c" + type: "BatchNorm" + bottom: "conv_stage2_block3_branch2c" + top: "conv_stage2_block3_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block3_branch2c" + type: "Scale" + bottom: "conv_stage2_block3_branch2c" + top: "conv_stage2_block3_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage2_block3" + type: "Eltwise" + bottom: "eltwise_stage2_block2" + bottom: "conv_stage2_block3_branch2c" + top: "eltwise_stage2_block3" +} +layer { + name: "relu_stage2_block3" + type: "ReLU" + bottom: "eltwise_stage2_block3" + top: "eltwise_stage2_block3" +} +layer { + name: "conv_stage2_block4_branch2a" + type: "Convolution" + bottom: "eltwise_stage2_block3" + top: "conv_stage2_block4_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block4_branch2a" + type: "BatchNorm" + bottom: "conv_stage2_block4_branch2a" + top: "conv_stage2_block4_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block4_branch2a" + type: "Scale" + bottom: "conv_stage2_block4_branch2a" + top: "conv_stage2_block4_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block4_branch2a" + type: "ReLU" + bottom: "conv_stage2_block4_branch2a" + top: "conv_stage2_block4_branch2a" +} +layer { + name: "conv_stage2_block4_branch2b" + type: "Convolution" + bottom: "conv_stage2_block4_branch2a" + top: "conv_stage2_block4_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block4_branch2b" + type: "BatchNorm" + bottom: "conv_stage2_block4_branch2b" + top: "conv_stage2_block4_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block4_branch2b" + type: "Scale" + bottom: "conv_stage2_block4_branch2b" + top: "conv_stage2_block4_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block4_branch2b" + type: "ReLU" + bottom: "conv_stage2_block4_branch2b" + top: "conv_stage2_block4_branch2b" +} +layer { + name: "conv_stage2_block4_branch2c" + type: "Convolution" + bottom: "conv_stage2_block4_branch2b" + top: "conv_stage2_block4_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block4_branch2c" + type: "BatchNorm" + bottom: "conv_stage2_block4_branch2c" + top: "conv_stage2_block4_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block4_branch2c" + type: "Scale" + bottom: "conv_stage2_block4_branch2c" + top: "conv_stage2_block4_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage2_block4" + type: "Eltwise" + bottom: "eltwise_stage2_block3" + bottom: "conv_stage2_block4_branch2c" + top: "eltwise_stage2_block4" +} +layer { + name: "relu_stage2_block4" + type: "ReLU" + bottom: "eltwise_stage2_block4" + top: "eltwise_stage2_block4" +} +layer { + name: "conv_stage2_block5_branch2a" + type: "Convolution" + bottom: "eltwise_stage2_block4" + top: "conv_stage2_block5_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block5_branch2a" + type: "BatchNorm" + bottom: "conv_stage2_block5_branch2a" + top: "conv_stage2_block5_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block5_branch2a" + type: "Scale" + bottom: "conv_stage2_block5_branch2a" + top: "conv_stage2_block5_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block5_branch2a" + type: "ReLU" + bottom: "conv_stage2_block5_branch2a" + top: "conv_stage2_block5_branch2a" +} +layer { + name: "conv_stage2_block5_branch2b" + type: "Convolution" + bottom: "conv_stage2_block5_branch2a" + top: "conv_stage2_block5_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block5_branch2b" + type: "BatchNorm" + bottom: "conv_stage2_block5_branch2b" + top: "conv_stage2_block5_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block5_branch2b" + type: "Scale" + bottom: "conv_stage2_block5_branch2b" + top: "conv_stage2_block5_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage2_block5_branch2b" + type: "ReLU" + bottom: "conv_stage2_block5_branch2b" + top: "conv_stage2_block5_branch2b" +} +layer { + name: "conv_stage2_block5_branch2c" + type: "Convolution" + bottom: "conv_stage2_block5_branch2b" + top: "conv_stage2_block5_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage2_block5_branch2c" + type: "BatchNorm" + bottom: "conv_stage2_block5_branch2c" + top: "conv_stage2_block5_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage2_block5_branch2c" + type: "Scale" + bottom: "conv_stage2_block5_branch2c" + top: "conv_stage2_block5_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage2_block5" + type: "Eltwise" + bottom: "eltwise_stage2_block4" + bottom: "conv_stage2_block5_branch2c" + top: "eltwise_stage2_block5" +} +layer { + name: "relu_stage2_block5" + type: "ReLU" + bottom: "eltwise_stage2_block5" + top: "eltwise_stage2_block5" +} +layer { + name: "conv_stage3_block0_proj_shortcut" + type: "Convolution" + bottom: "eltwise_stage2_block5" + top: "conv_stage3_block0_proj_shortcut" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 1024 + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block0_proj_shortcut" + type: "BatchNorm" + bottom: "conv_stage3_block0_proj_shortcut" + top: "conv_stage3_block0_proj_shortcut" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block0_proj_shortcut" + type: "Scale" + bottom: "conv_stage3_block0_proj_shortcut" + top: "conv_stage3_block0_proj_shortcut" + scale_param { + bias_term: true + } +} +layer { + name: "conv_stage3_block0_branch2a" + type: "Convolution" + bottom: "eltwise_stage2_block5" + top: "conv_stage3_block0_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block0_branch2a" + type: "BatchNorm" + bottom: "conv_stage3_block0_branch2a" + top: "conv_stage3_block0_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block0_branch2a" + type: "Scale" + bottom: "conv_stage3_block0_branch2a" + top: "conv_stage3_block0_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage3_block0_branch2a" + type: "ReLU" + bottom: "conv_stage3_block0_branch2a" + top: "conv_stage3_block0_branch2a" +} +layer { + name: "conv_stage3_block0_branch2b" + type: "Convolution" + bottom: "conv_stage3_block0_branch2a" + top: "conv_stage3_block0_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block0_branch2b" + type: "BatchNorm" + bottom: "conv_stage3_block0_branch2b" + top: "conv_stage3_block0_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block0_branch2b" + type: "Scale" + bottom: "conv_stage3_block0_branch2b" + top: "conv_stage3_block0_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage3_block0_branch2b" + type: "ReLU" + bottom: "conv_stage3_block0_branch2b" + top: "conv_stage3_block0_branch2b" +} +layer { + name: "conv_stage3_block0_branch2c" + type: "Convolution" + bottom: "conv_stage3_block0_branch2b" + top: "conv_stage3_block0_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 1024 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block0_branch2c" + type: "BatchNorm" + bottom: "conv_stage3_block0_branch2c" + top: "conv_stage3_block0_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block0_branch2c" + type: "Scale" + bottom: "conv_stage3_block0_branch2c" + top: "conv_stage3_block0_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage3_block0" + type: "Eltwise" + bottom: "conv_stage3_block0_proj_shortcut" + bottom: "conv_stage3_block0_branch2c" + top: "eltwise_stage3_block0" +} +layer { + name: "relu_stage3_block0" + type: "ReLU" + bottom: "eltwise_stage3_block0" + top: "eltwise_stage3_block0" +} +layer { + name: "conv_stage3_block1_branch2a" + type: "Convolution" + bottom: "eltwise_stage3_block0" + top: "conv_stage3_block1_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block1_branch2a" + type: "BatchNorm" + bottom: "conv_stage3_block1_branch2a" + top: "conv_stage3_block1_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block1_branch2a" + type: "Scale" + bottom: "conv_stage3_block1_branch2a" + top: "conv_stage3_block1_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage3_block1_branch2a" + type: "ReLU" + bottom: "conv_stage3_block1_branch2a" + top: "conv_stage3_block1_branch2a" +} +layer { + name: "conv_stage3_block1_branch2b" + type: "Convolution" + bottom: "conv_stage3_block1_branch2a" + top: "conv_stage3_block1_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block1_branch2b" + type: "BatchNorm" + bottom: "conv_stage3_block1_branch2b" + top: "conv_stage3_block1_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block1_branch2b" + type: "Scale" + bottom: "conv_stage3_block1_branch2b" + top: "conv_stage3_block1_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage3_block1_branch2b" + type: "ReLU" + bottom: "conv_stage3_block1_branch2b" + top: "conv_stage3_block1_branch2b" +} +layer { + name: "conv_stage3_block1_branch2c" + type: "Convolution" + bottom: "conv_stage3_block1_branch2b" + top: "conv_stage3_block1_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 1024 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block1_branch2c" + type: "BatchNorm" + bottom: "conv_stage3_block1_branch2c" + top: "conv_stage3_block1_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block1_branch2c" + type: "Scale" + bottom: "conv_stage3_block1_branch2c" + top: "conv_stage3_block1_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage3_block1" + type: "Eltwise" + bottom: "eltwise_stage3_block0" + bottom: "conv_stage3_block1_branch2c" + top: "eltwise_stage3_block1" +} +layer { + name: "relu_stage3_block1" + type: "ReLU" + bottom: "eltwise_stage3_block1" + top: "eltwise_stage3_block1" +} +layer { + name: "conv_stage3_block2_branch2a" + type: "Convolution" + bottom: "eltwise_stage3_block1" + top: "conv_stage3_block2_branch2a" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block2_branch2a" + type: "BatchNorm" + bottom: "conv_stage3_block2_branch2a" + top: "conv_stage3_block2_branch2a" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block2_branch2a" + type: "Scale" + bottom: "conv_stage3_block2_branch2a" + top: "conv_stage3_block2_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage3_block2_branch2a" + type: "ReLU" + bottom: "conv_stage3_block2_branch2a" + top: "conv_stage3_block2_branch2a" +} +layer { + name: "conv_stage3_block2_branch2b" + type: "Convolution" + bottom: "conv_stage3_block2_branch2a" + top: "conv_stage3_block2_branch2b" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block2_branch2b" + type: "BatchNorm" + bottom: "conv_stage3_block2_branch2b" + top: "conv_stage3_block2_branch2b" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block2_branch2b" + type: "Scale" + bottom: "conv_stage3_block2_branch2b" + top: "conv_stage3_block2_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "relu_stage3_block2_branch2b" + type: "ReLU" + bottom: "conv_stage3_block2_branch2b" + top: "conv_stage3_block2_branch2b" +} +layer { + name: "conv_stage3_block2_branch2c" + type: "Convolution" + bottom: "conv_stage3_block2_branch2b" + top: "conv_stage3_block2_branch2c" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 1024 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "bn_stage3_block2_branch2c" + type: "BatchNorm" + bottom: "conv_stage3_block2_branch2c" + top: "conv_stage3_block2_branch2c" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + batch_norm_param { + use_global_stats: true + } +} +layer { + name: "scale_stage3_block2_branch2c" + type: "Scale" + bottom: "conv_stage3_block2_branch2c" + top: "conv_stage3_block2_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "eltwise_stage3_block2" + type: "Eltwise" + bottom: "eltwise_stage3_block1" + bottom: "conv_stage3_block2_branch2c" + top: "eltwise_stage3_block2" +} +layer { + name: "relu_stage3_block2" + type: "ReLU" + bottom: "eltwise_stage3_block2" + top: "eltwise_stage3_block2" +} +layer { + name: "pool" + type: "Pooling" + bottom: "eltwise_stage3_block2" + top: "pool" + pooling_param { + pool: AVE + kernel_size: 7 + stride: 1 + } +} +layer { + name: "fc_nsfw" + type: "InnerProduct" + bottom: "pool" + top: "fc_nsfw" + param { + lr_mult: 5 + decay_mult: 1 + } + param { + lr_mult: 10 + decay_mult: 0 + } + inner_product_param{ + num_output: 2 + weight_filler { + type: "xavier" + std: 0.01 + } + bias_filler { + type: "xavier" + value: 0 + } + } +} +layer { + name: "prob" + type: "Softmax" + bottom: "fc_nsfw" + top: "prob" +} + diff --git a/nsfw_model/resnet_50_1by2_nsfw.caffemodel b/nsfw_model/resnet_50_1by2_nsfw.caffemodel Binary files differnew file mode 100644 index 0000000..c4f3105 --- /dev/null +++ b/nsfw_model/resnet_50_1by2_nsfw.caffemodel |