diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..86354bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +labeling-system/classify/build +labeling-system/classify/result +labeling-system/out*.txt +labeling-system/classify/out.txt +labeling-system/framer/build +labeling-system/framer/frames +labeling-system/models/*.caffemodel \ No newline at end of file diff --git a/labeling-system/classify/CMakeLists.txt b/labeling-system/classify/CMakeLists.txt new file mode 100644 index 0000000..6011290 --- /dev/null +++ b/labeling-system/classify/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8) + +set(project_name classify) +project(${project_name}) + +file(GLOB SOURCES "*.cpp" "*.c" "*.h") + +# OpenCV +find_package(OpenCV REQUIRED) +find_package(Caffe REQUIRED) + +# Caffe +include_directories(${Caffe_INCLUDE_DIRS}) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -O3 -Wall") +add_executable(${project_name} ${SOURCES}) + +target_link_libraries(${project_name} ${OpenCV_LIBS} ${Caffe_LIBRARIES}) diff --git a/labeling-system/classify/classify.cpp b/labeling-system/classify/classify.cpp new file mode 100644 index 0000000..44781f5 --- /dev/null +++ b/labeling-system/classify/classify.cpp @@ -0,0 +1,190 @@ +#define USE_MKL // workaround for using mkl + +#include +#include +#include +#include +#include +#include + +using namespace caffe; +using std::string; + +class Classifier { + public: + Classifier(const string& model_file, + const string& trained_file, + const string& annot_file, + const string& result_folder); + + void Classify(); + + private: + void Classify(const cv::Mat& img, cv::Mat& dst); + std::vector Predict(const cv::Mat& img); + void WrapInputLayer(std::vector* input_channels); + void Preprocess(const cv::Mat&, std::vector*); + + private: + shared_ptr > net_; + cv::Size input_geometry_; + int num_channels_; + std::vector filenames_; + string result_folder_; +}; + +Classifier::Classifier(const string& model_file, + const string& trained_file, + const string& annot_file, + const string& result_folder) { +#ifdef CPU_ONLY + Caffe::set_mode(Caffe::CPU); +#else + Caffe::set_mode(Caffe::GPU); +#endif + + /* Load the network. */ + net_.reset(new Net(model_file, TEST)); + net_->CopyTrainedLayersFrom(trained_file); + + CHECK_EQ(net_->num_inputs(), 1) << "Network should have exactly one input."; + CHECK_EQ(net_->num_outputs(), 1) << "Network should have exactly one output."; + + Blob* input_layer = net_->input_blobs()[0]; + num_channels_ = input_layer->channels(); + CHECK(num_channels_ == 3 || num_channels_ == 1) + << "Input layer should have 1 or 3 channels."; + input_geometry_ = cv::Size(input_layer->width(), input_layer->height()); + + /* Load filenames. */ + std::ifstream filenames(annot_file.c_str()); + CHECK(filenames) << "Unable to open annotation file " << annot_file; + string line; + while (std::getline(filenames, line)) + filenames_.push_back(string(line)); + + Blob* output_layer = net_->output_blobs()[0]; + + result_folder_ = result_folder; +} + +void Classifier::Classify(const cv::Mat& img, cv::Mat& dst) { + std::vector output = Predict(img); + dst = cv::Mat(output, false); +} + +std::vector Classifier::Predict(const cv::Mat& img) { + Blob* input_layer = net_->input_blobs()[0]; + input_layer->Reshape(1, num_channels_, + input_geometry_.height, input_geometry_.width); + /* Forward dimension change to all layers. */ + net_->Reshape(); + + std::vector input_channels; + WrapInputLayer(&input_channels); + + Preprocess(img, &input_channels); + + net_->ForwardPrefilled(); + + /* Copy the output layer to a std::vector */ + Blob* output_layer = net_->output_blobs()[0]; + const float* begin = output_layer->cpu_data(); + const float* end = begin + output_layer->shape(0) * + output_layer->shape(1) * + output_layer->shape(2) * + output_layer->shape(3); + std::cout << output_layer->shape_string() << std::endl; + std::cout << "c " << output_layer->shape(0) << " " + << output_layer->shape(1) << " " + << output_layer->shape(2) << " " + << output_layer->shape(3) << std::endl; + return std::vector(begin, end); +} + +/* Wrap the input layer of the network in separate cv::Mat objects + * (one per channel). This way we save one memcpy operation and we + * don't need to rely on cudaMemcpy2D. The last preprocessing + * operation will write the separate channels directly to the input + * layer. */ +void Classifier::WrapInputLayer(std::vector* input_channels) { + Blob* input_layer = net_->input_blobs()[0]; + + int width = input_layer->width(); + int height = input_layer->height(); + float* input_data = input_layer->mutable_cpu_data(); + for (int i = 0; i < input_layer->channels(); ++i) { + cv::Mat channel(height, width, CV_32FC1, input_data); + input_channels->push_back(channel); + input_data += width * height; + } +} + +void Classifier::Preprocess(const cv::Mat& img, + std::vector* input_channels) { + cv::Mat sample_float; + img.convertTo(sample_float, CV_32FC3); + + cv::split(sample_float, *input_channels); + + CHECK(reinterpret_cast(input_channels->at(0).data) + == net_->input_blobs()[0]->cpu_data()) + << "Input channels are not wrapping the input layer of the network."; +} + + +void Classifier::Classify() { + cv::Vec3b Sky(128,128,128); + cv::Vec3b Building(128,0,0); + cv::Vec3b Pole(192,192,128); + cv::Vec3b Road_marking(255,69,0); + cv::Vec3b Road(128,64,128); + cv::Vec3b Pavement(60,40,222); + cv::Vec3b Tree(128,128,0); + cv::Vec3b SignSymbol(192,128,128); + cv::Vec3b Fence(64,64,128); + cv::Vec3b Car(64,0,128); + cv::Vec3b Pedestrian(64,64,0); + cv::Vec3b Bicyclist(0,128,192); + cv::Vec3b Unlabelled(0,0,0); + + cv::Vec3b classes_[] = { Sky, Building, Pole, + Road_marking, Road, Pavement, Tree, + SignSymbol, Fence, Car, Pedestrian, + Bicyclist, Unlabelled }; + + std::vector classes(classes_, classes_ + 12); + + for (int f = 0; f < filenames_.size(); f++) { + cv::Mat img = cv::imread(filenames_[f], 0); + cv::Mat dst; + Classify(img, dst); + + cv::Mat result(360, 480, CV_8UC3); + for (int i = 0; i < 360; i++) { + for (int j = 0; j < 480; j++) { + std::cout << "(" << i << "," << j << ") "; + //result.at(i, j) = classes_[static_cast(dst.at(i, j))]; + std::cout << dst.at(i, j) << " "; + } + std::cout << std::endl; + } + cv::imwrite(result_folder_ + "/result_" + filenames_[f], result); + } +} + +int main(int argc, char* argv[]) { + if (argc != 5) { + std::cerr << "Usage: " << argv[0] + << " deploy.prototxt network.caffemodel" + << " annotation.txt result_folder" << std::endl; + return 1; + } + + ::google::InitGoogleLogging(argv[0]); + + Classifier *classifier = new Classifier(argv[1], argv[2], argv[3], argv[4]); + classifier->Classify(); + + return 0; +} diff --git a/labeling-system/framer/CMakeLists.txt b/labeling-system/framer/CMakeLists.txt new file mode 100644 index 0000000..30d3c08 --- /dev/null +++ b/labeling-system/framer/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8) + +set(project_name framer) +project(${project_name}) + +file(GLOB SOURCES "*.cpp" "*.c" "*.h") + +# OpenCV +find_package(OpenCV REQUIRED) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -O3 -Wall") +add_executable(${project_name} ${SOURCES}) + +target_link_libraries(${project_name} ${OpenCV_LIBS}) \ No newline at end of file diff --git a/labeling-system/framer/framer.cpp b/labeling-system/framer/framer.cpp new file mode 100644 index 0000000..a7b5d81 --- /dev/null +++ b/labeling-system/framer/framer.cpp @@ -0,0 +1,60 @@ +#include "opencv2/highgui/highgui.hpp" +#include +#include + +using namespace cv; +using namespace std; + +int main(int argc, char* argv[]) { + VideoCapture cap(argv[1]); + + if (!cap.isOpened()) { + cout << "Cannot open the video file" << endl; + return -1; + } + + double Hz = atof(argv[2]); + + double fps = cap.get(CV_CAP_PROP_FPS); + cout << "Frame per seconds : " << fps << endl; + + int skip_frames = (int)(fps / Hz + 0.5) - 1; + if (skip_frames < 1) { + skip_frames = 0; + } + + cout << "Number skipped frames : " << skip_frames << endl; + + for (int i = 0; ; i++) { + Mat frame; + + bool bSuccess = cap.read(frame); + if (!bSuccess) { + cout << "Cannot read the frame from video file" << endl; + break; + } + + char filename[18]; + int cx; + + cx = snprintf (filename, 18, "./frames/%04d.png", i); + if (cx < 0) { + cout << "Cannot create filename " << i << endl; + return -1; + } + bool wsuccess = imwrite(filename, frame); + if (!wsuccess) { + cout << "Cannot write frame" << endl; + } + + waitKey(0); + for (int j = 0; j < skip_frames; j++) { + bSuccess = cap.read(frame); + if (!bSuccess) { + break; + } + } + } + + return 0; +} \ No newline at end of file diff --git a/labeling-system/hand_markup_tool/CMakeLists.txt b/labeling-system/hand_markup_tool/CMakeLists.txt new file mode 100644 index 0000000..62456fe --- /dev/null +++ b/labeling-system/hand_markup_tool/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.0) + +set(target_name "segm_tool") + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake") + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + set(CMAKE_USE_RELATIVE_PATHS ON) +endif() + +set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configurations" FORCE) +if(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8") + set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} ) +endif() + +if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) +endif() + +set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install" CACHE PATH "Installation Directory") + +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +set(CMAKE_PDB_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + +foreach(cfg ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER "${cfg}" cfg) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${cfg} ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${cfg} ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${cfg} ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_PDB_OUTPUT_DIRECTORY_${cfg} ${CMAKE_BINARY_DIR}/lib) +endforeach() + +project(${target_name}) + +find_package(OpenCV 3.0 REQUIRED) + +include_directories(${OpenCV_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) + +file(GLOB src *.cpp) +file(GLOB hdr *.h*) + +add_executable(${target_name} ${src} ${hdr}) +target_link_libraries(${target_name} ${OpenCV_LIBS}) diff --git a/labeling-system/hand_markup_tool/main.cpp b/labeling-system/hand_markup_tool/main.cpp new file mode 100644 index 0000000..d8c21de --- /dev/null +++ b/labeling-system/hand_markup_tool/main.cpp @@ -0,0 +1,286 @@ +#include +#include +#include +#include +#include +#include + +#define _USE_MATH_DEFINES +#include + +#include +#include +#include + +static std::string input_data, config_file; + +static int printUsage() +{ + std::cout << "Usage: segm_tool [OPTIONS]" << std::endl; + std::cout << "Options:" << std::endl; + std::cout << " --input_data path - path to input data" << std::endl; + std::cout << " --config_file path - path to configuration file" << std::endl; + exit(1); +} +static void parseCmdArg(int argc, const char* argv[]) +{ + for (int i = 1; i < argc; i++) + { + int argv_len = (int)strlen(argv[i]); + if (0 == memcmp("--input_data", argv[i], argv_len)) + input_data = argv[++i]; + else if (0 == memcmp("--config_file", argv[i], argv_len)) + config_file = argv[++i]; + else if (0 == strcmp("--help", argv[i])) + { + printUsage(); + } + } +} + +struct ObjectInfo +{ + char key; + int id; + std::string hint; + cv::Scalar color; +}; + +class ObjectsSetting + : public std::vector +{ +public: + ObjectsSetting() + : LUT(0) + , lut_count(0) + { + } + ~ObjectsSetting() + { + if (!LUT) + delete[]LUT; + } + + bool load(const std::string &config_file) + { + cv::FileStorage config(config_file, cv::FileStorage::READ); + if (!config.isOpened()) + return false; + this->clear(); + + cv::FileNode root = config["objects"]; + for (auto it = root.begin(); it != root.end(); it++) + { + ObjectInfo info; + info.key = ((std::string)(*it)["key"])[0]; + info.id = (int)(*it)["id"]; + info.hint = (*it)["hint"]; + (*it)["color"] >> info.color; + this->push_back(info); + } + return (0 < this->size()); + } + + int parse_key(char ch) const + { + for (int o = 0; o < this->size(); o++) + { + if (ch == (*this)[o].key) + return o; + } + return -1; + } + + size_t get_LUT(cv::Vec3b *&lut) + { + if (0 != LUT) + { + lut = LUT; + return lut_count; + } + lut_count = this->size(); + if (0 == lut_count) + { + lut = 0; + return 0; + } + LUT = new cv::Vec3b[lut_count]; + for (size_t i = 0; i < lut_count; i++) + { + LUT[i][0] = (uchar)((*this)[i].color[0]); + LUT[i][1] = (uchar)((*this)[i].color[1]); + LUT[i][2] = (uchar)((*this)[i].color[2]); + } + return lut_count; + } +private: + cv::Vec3b *LUT; + size_t lut_count; +}; + +static void draw_help(cv::Mat &help_img, const ObjectsSetting &setting) +{ + static const int fontFace = 0; + static const double fontScale = 0.3; + static const int thickness = 1; + static const int gap = 7; + + cv::Size img_size(0, gap); + std::vector text_orig(setting.size()); + cv::Point pt(gap, gap); + for (int o = 0; o < setting.size(); o++) + { + cv::String msg = cv::format("%c - %s", setting[o].key, setting[o].hint.c_str()); + int baseline; + cv::Size textSize = cv::getTextSize(msg, fontFace, fontScale, thickness, &baseline); + img_size.height += textSize.height + gap; + img_size.width = MAX(textSize.width + 2 * gap, img_size.width); + + text_orig[o] = pt; + text_orig[o].y += baseline + thickness; + pt.y += textSize.height + gap; + } + + help_img.create(img_size, CV_8UC3); help_img.setTo(255); + for (int o = 0; o < setting.size(); o++) + { + cv::String msg = cv::format("%c - %s", setting[o].key, setting[o].hint.c_str()); + cv::putText(help_img, msg, text_orig[o], fontFace, fontScale, setting[o].color); + } +} + +static int object_idx = -1; +static cv::Mat markers; +static cv::Point prevPt(-1, -1); +static ObjectsSetting setting; +static int marker_thickness = 2; +static void onMouse(int event, int x, int y, int flags, void* data) +{ + if (-1 == object_idx) + return; + + cv::Mat *show_img = (cv::Mat *)data; + if (event == cv::EVENT_LBUTTONUP || !(flags & cv::EVENT_FLAG_LBUTTON)) + prevPt = cv::Point(-1, -1); + else if (event == cv::EVENT_LBUTTONDOWN) + prevPt = cv::Point(x, y); + else if (event == cv::EVENT_MOUSEMOVE && (flags & cv::EVENT_FLAG_LBUTTON)) + { + cv::Point pt(x, y); + if (prevPt.x < 0) + prevPt = pt; + cv::line(markers, prevPt, pt, cv::Scalar::all(setting[object_idx].id), marker_thickness); + cv::line(*show_img, prevPt, pt, setting[object_idx].color, marker_thickness); + prevPt = pt; + + cv::imshow("image", *show_img); + } +} + +int main(int argc, const char** argv) +{ + parseCmdArg(argc, argv); + if (input_data.empty() || config_file.empty()) + { + printUsage(); + return 1; + } + + if (!setting.load(config_file)) + return 1; + std::vector input_files; + cv::glob(input_data, input_files); + if (input_files.empty()) + return 1; + + cv::Mat help_img; + draw_help(help_img, setting); + + bool show_help = false; + double transparent = 0.; + for (int i = 0; i < input_files.size(); i++) + { + cv::Mat img = cv::imread(input_files[i], cv::IMREAD_COLOR); + + cv::Mat show_img; img.copyTo(show_img); + markers.create(img.size(), CV_32SC1); markers.setTo(-1); + int c = 0; + for (;;) + { + img.copyTo(show_img); + + cv::Vec3b *lut; setting.get_LUT(lut); + if (lut) + { + cv::Mat temp; + if (0. < transparent) + temp.create(show_img.size(), CV_8UC3); + else + temp = show_img; + + for (int row = 0; row < show_img.rows; row++) + { + cv::Vec3b *ptr_img = temp.ptr(row); + int *ptr_markers = markers.ptr(row); + for (int col = 0; col < show_img.cols; col++) + { + if (-1 == ptr_markers[col]) + continue; + ptr_img[col] = lut[ptr_markers[col]]; + } + } + if (0. < transparent) + cv::addWeighted(show_img, 1. - transparent, temp, transparent, 0., show_img); + } + + if (show_help) + { + cv::Mat temp = show_img(cv::Rect(0, 0, help_img.cols, help_img.rows)); + cv::addWeighted(temp, 0.4, help_img, 0.6, 0., temp); + } + + cv::imshow("image", show_img); + cv::setWindowTitle("image", input_files[i]); + cv::setMouseCallback("image", onMouse, (&show_img)); + int c = cv::waitKey(0); + if (27 == c) + break; + if (' ' == c) + break; + + img.copyTo(show_img); + int obj_idx_new = setting.parse_key(c); + if (-1 != obj_idx_new) + object_idx = obj_idx_new; + switch (c) + { + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + marker_thickness = (int)(c - '0'); + break; + case 'h': + show_help = !show_help; + break; + case 'w': + cv::watershed(img, markers); + break; + case 't': + transparent += 0.2; + if (1.0 < transparent) + transparent = 0.0; + break; + } + } + if (27 == c) + break; + } + + return 0; +} diff --git a/labeling-system/models/segnet_inference.prototxt b/labeling-system/models/segnet_inference.prototxt new file mode 100644 index 0000000..b67aa76 --- /dev/null +++ b/labeling-system/models/segnet_inference.prototxt @@ -0,0 +1,1553 @@ +name: "VGG_ILSVRC_16_layer" +input: "data" +input_dim: 1 +input_dim: 3 +input_dim: 360 +input_dim: 480 +layer { + bottom: "data" + top: "conv1_1" + name: "conv1_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "conv1_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "relu1_1" + type: "ReLU" +} +layer { + bottom: "conv1_1" + top: "conv1_2" + name: "conv1_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "conv1_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "relu1_2" + type: "ReLU" +} +layer { + bottom: "conv1_2" + top: "pool1" + top: "pool1_mask" + name: "pool1" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool1" + top: "conv2_1" + name: "conv2_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "conv2_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "relu2_1" + type: "ReLU" +} +layer { + bottom: "conv2_1" + top: "conv2_2" + name: "conv2_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "conv2_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "relu2_2" + type: "ReLU" +} +layer { + bottom: "conv2_2" + top: "pool2" + top: "pool2_mask" + name: "pool2" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool2" + top: "conv3_1" + name: "conv3_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "conv3_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "relu3_1" + type: "ReLU" +} +layer { + bottom: "conv3_1" + top: "conv3_2" + name: "conv3_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "conv3_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "relu3_2" + type: "ReLU" +} +layer { + bottom: "conv3_2" + top: "conv3_3" + name: "conv3_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "conv3_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "relu3_3" + type: "ReLU" +} +layer { + bottom: "conv3_3" + top: "pool3" + top: "pool3_mask" + name: "pool3" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool3" + top: "conv4_1" + name: "conv4_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "conv4_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "relu4_1" + type: "ReLU" +} +layer { + bottom: "conv4_1" + top: "conv4_2" + name: "conv4_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "conv4_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "relu4_2" + type: "ReLU" +} +layer { + bottom: "conv4_2" + top: "conv4_3" + name: "conv4_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "conv4_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "relu4_3" + type: "ReLU" +} +layer { + bottom: "conv4_3" + top: "pool4" + top: "pool4_mask" + name: "pool4" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool4" + top: "conv5_1" + name: "conv5_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "conv5_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "relu5_1" + type: "ReLU" +} +layer { + bottom: "conv5_1" + top: "conv5_2" + name: "conv5_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "conv5_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "relu5_2" + type: "ReLU" +} +layer { + bottom: "conv5_2" + top: "conv5_3" + name: "conv5_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "conv5_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "relu5_3" + type: "ReLU" +} +layer { + bottom: "conv5_3" + top: "pool5" + top: "pool5_mask" + name: "pool5" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "upsample5" + type: "Upsample" + bottom: "pool5" + top: "pool5_D" + bottom: "pool5_mask" + upsample_param { + scale: 2 + upsample_w: 30 + upsample_h: 23 + } +} +layer { + bottom: "pool5_D" + top: "conv5_3_D" + name: "conv5_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "conv5_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "relu5_3_D" + type: "ReLU" +} + +layer { + bottom: "conv5_3_D" + top: "conv5_2_D" + name: "conv5_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "conv5_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "relu5_2_D" + type: "ReLU" +} +layer { + bottom: "conv5_2_D" + top: "conv5_1_D" + name: "conv5_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "conv5_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "relu5_1_D" + type: "ReLU" +} +layer { + name: "upsample4" + type: "Upsample" + bottom: "conv5_1_D" + top: "pool4_D" + bottom: "pool4_mask" + upsample_param { + scale: 2 + upsample_w: 60 + upsample_h: 45 + } +} +layer { + bottom: "pool4_D" + top: "conv4_3_D" + name: "conv4_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "conv4_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "relu4_3_D" + type: "ReLU" +} +layer { + bottom: "conv4_3_D" + top: "conv4_2_D" + name: "conv4_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "conv4_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "relu4_2_D" + type: "ReLU" +} +layer { + bottom: "conv4_2_D" + top: "conv4_1_D" + name: "conv4_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "conv4_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "relu4_1_D" + type: "ReLU" +} +layer { + name: "upsample3" + type: "Upsample" + bottom: "conv4_1_D" + top: "pool3_D" + bottom: "pool3_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool3_D" + top: "conv3_3_D" + name: "conv3_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "conv3_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "relu3_3_D" + type: "ReLU" +} +layer { + bottom: "conv3_3_D" + top: "conv3_2_D" + name: "conv3_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "conv3_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "relu3_2_D" + type: "ReLU" +} +layer { + bottom: "conv3_2_D" + top: "conv3_1_D" + name: "conv3_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "conv3_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "relu3_1_D" + type: "ReLU" +} +layer { + name: "upsample2" + type: "Upsample" + bottom: "conv3_1_D" + top: "pool2_D" + bottom: "pool2_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool2_D" + top: "conv2_2_D" + name: "conv2_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "conv2_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "relu2_2_D" + type: "ReLU" +} +layer { + bottom: "conv2_2_D" + top: "conv2_1_D" + name: "conv2_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "conv2_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "relu2_1_D" + type: "ReLU" +} +layer { + name: "upsample1" + type: "Upsample" + bottom: "conv2_1_D" + top: "pool1_D" + bottom: "pool1_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool1_D" + top: "conv1_2_D" + name: "conv1_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "conv1_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "relu1_2_D" + type: "ReLU" +} +layer { + bottom: "conv1_2_D" + top: "conv1_1_D" + name: "conv1_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 11 + pad: 1 + kernel_size: 3 + } +} +layer { + name: "prob" + type: "Softmax" + bottom: "conv1_1_D" + top: "prob" + softmax_param {engine: CAFFE} +} diff --git a/labeling-system/models/segnet_inference_modified.prototxt b/labeling-system/models/segnet_inference_modified.prototxt new file mode 100644 index 0000000..8fbe87c --- /dev/null +++ b/labeling-system/models/segnet_inference_modified.prototxt @@ -0,0 +1,1553 @@ +name: "VGG_ILSVRC_16_layer" +input: "data" +input_dim: 1 +input_dim: 3 +input_dim: 360 +input_dim: 480 +layer { + bottom: "data" + top: "conv1_1" + name: "conv1_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "conv1_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "relu1_1" + type: "ReLU" +} +layer { + bottom: "conv1_1" + top: "conv1_2" + name: "conv1_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "conv1_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "relu1_2" + type: "ReLU" +} +layer { + bottom: "conv1_2" + top: "pool1" + top: "pool1_mask" + name: "pool1" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool1" + top: "conv2_1" + name: "conv2_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "conv2_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "relu2_1" + type: "ReLU" +} +layer { + bottom: "conv2_1" + top: "conv2_2" + name: "conv2_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "conv2_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "relu2_2" + type: "ReLU" +} +layer { + bottom: "conv2_2" + top: "pool2" + top: "pool2_mask" + name: "pool2" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool2" + top: "conv3_1" + name: "conv3_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "conv3_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "relu3_1" + type: "ReLU" +} +layer { + bottom: "conv3_1" + top: "conv3_2" + name: "conv3_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "conv3_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "relu3_2" + type: "ReLU" +} +layer { + bottom: "conv3_2" + top: "conv3_3" + name: "conv3_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "conv3_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "relu3_3" + type: "ReLU" +} +layer { + bottom: "conv3_3" + top: "pool3" + top: "pool3_mask" + name: "pool3" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool3" + top: "conv4_1" + name: "conv4_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "conv4_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "relu4_1" + type: "ReLU" +} +layer { + bottom: "conv4_1" + top: "conv4_2" + name: "conv4_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "conv4_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "relu4_2" + type: "ReLU" +} +layer { + bottom: "conv4_2" + top: "conv4_3" + name: "conv4_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "conv4_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "relu4_3" + type: "ReLU" +} +layer { + bottom: "conv4_3" + top: "pool4" + top: "pool4_mask" + name: "pool4" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool4" + top: "conv5_1" + name: "conv5_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "conv5_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "relu5_1" + type: "ReLU" +} +layer { + bottom: "conv5_1" + top: "conv5_2" + name: "conv5_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "conv5_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "relu5_2" + type: "ReLU" +} +layer { + bottom: "conv5_2" + top: "conv5_3" + name: "conv5_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "conv5_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "relu5_3" + type: "ReLU" +} +layer { + bottom: "conv5_3" + top: "pool5" + top: "pool5_mask" + name: "pool5" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "upsample5" + type: "Upsample" + bottom: "pool5" + top: "pool5_D" + bottom: "pool5_mask" + upsample_param { + scale: 2 + upsample_w: 30 + upsample_h: 23 + } +} +layer { + bottom: "pool5_D" + top: "conv5_3_D" + name: "conv5_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "conv5_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "relu5_3_D" + type: "ReLU" +} + +layer { + bottom: "conv5_3_D" + top: "conv5_2_D" + name: "conv5_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "conv5_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "relu5_2_D" + type: "ReLU" +} +layer { + bottom: "conv5_2_D" + top: "conv5_1_D" + name: "conv5_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "conv5_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "relu5_1_D" + type: "ReLU" +} +layer { + name: "upsample4" + type: "Upsample" + bottom: "conv5_1_D" + top: "pool4_D" + bottom: "pool4_mask" + upsample_param { + scale: 2 + upsample_w: 60 + upsample_h: 45 + } +} +layer { + bottom: "pool4_D" + top: "conv4_3_D" + name: "conv4_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "conv4_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "relu4_3_D" + type: "ReLU" +} +layer { + bottom: "conv4_3_D" + top: "conv4_2_D" + name: "conv4_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "conv4_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "relu4_2_D" + type: "ReLU" +} +layer { + bottom: "conv4_2_D" + top: "conv4_1_D" + name: "conv4_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "conv4_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "relu4_1_D" + type: "ReLU" +} +layer { + name: "upsample3" + type: "Upsample" + bottom: "conv4_1_D" + top: "pool3_D" + bottom: "pool3_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool3_D" + top: "conv3_3_D" + name: "conv3_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "conv3_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "relu3_3_D" + type: "ReLU" +} +layer { + bottom: "conv3_3_D" + top: "conv3_2_D" + name: "conv3_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "conv3_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "relu3_2_D" + type: "ReLU" +} +layer { + bottom: "conv3_2_D" + top: "conv3_1_D" + name: "conv3_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "conv3_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "relu3_1_D" + type: "ReLU" +} +layer { + name: "upsample2" + type: "Upsample" + bottom: "conv3_1_D" + top: "pool2_D" + bottom: "pool2_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool2_D" + top: "conv2_2_D" + name: "conv2_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "conv2_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "relu2_2_D" + type: "ReLU" +} +layer { + bottom: "conv2_2_D" + top: "conv2_1_D" + name: "conv2_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "conv2_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "relu2_1_D" + type: "ReLU" +} +layer { + name: "upsample1" + type: "Upsample" + bottom: "conv2_1_D" + top: "pool1_D" + bottom: "pool1_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool1_D" + top: "conv1_2_D" + name: "conv1_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "conv1_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0.001 + } + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "relu1_2_D" + type: "ReLU" +} +layer { + bottom: "conv1_2_D" + top: "conv1_1_D" + name: "conv1_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + } + num_output: 12 + pad: 1 + kernel_size: 3 + } +} +layer { + name: "prob" + type: "Softmax" + bottom: "conv1_1_D" + top: "prob" + softmax_param {engine: CAFFE} +} diff --git a/labeling-system/models/segnet_mdw_modified.prototxt b/labeling-system/models/segnet_mdw_modified.prototxt new file mode 100644 index 0000000..012e18f --- /dev/null +++ b/labeling-system/models/segnet_mdw_modified.prototxt @@ -0,0 +1,1612 @@ +name: "VGG_ILSVRC_16_layer" +layer { + name: "data" + type: "DenseImageData" + top: "data" + top: "label" + dense_image_data_param { + source: "/home/kruchinin_d/Projects/tmp/CamVid/test.txt" + batch_size: 1 + } +} +layer { + bottom: "data" + top: "conv1_1" + name: "conv1_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "conv1_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "relu1_1" + type: "ReLU" +} +layer { + bottom: "conv1_1" + top: "conv1_2" + name: "conv1_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "conv1_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "relu1_2" + type: "ReLU" +} +layer { + bottom: "conv1_2" + top: "pool1" + top: "pool1_mask" + name: "pool1" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool1" + top: "conv2_1" + name: "conv2_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "conv2_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "relu2_1" + type: "ReLU" +} +layer { + bottom: "conv2_1" + top: "conv2_2" + name: "conv2_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "conv2_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "relu2_2" + type: "ReLU" +} +layer { + bottom: "conv2_2" + top: "pool2" + top: "pool2_mask" + name: "pool2" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool2" + top: "conv3_1" + name: "conv3_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "conv3_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "relu3_1" + type: "ReLU" +} +layer { + bottom: "conv3_1" + top: "conv3_2" + name: "conv3_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "conv3_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "relu3_2" + type: "ReLU" +} +layer { + bottom: "conv3_2" + top: "conv3_3" + name: "conv3_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "conv3_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "relu3_3" + type: "ReLU" +} +layer { + bottom: "conv3_3" + top: "pool3" + top: "pool3_mask" + name: "pool3" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool3" + top: "conv4_1" + name: "conv4_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "conv4_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "relu4_1" + type: "ReLU" +} +layer { + bottom: "conv4_1" + top: "conv4_2" + name: "conv4_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "conv4_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "relu4_2" + type: "ReLU" +} +layer { + bottom: "conv4_2" + top: "conv4_3" + name: "conv4_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "conv4_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "relu4_3" + type: "ReLU" +} +layer { + bottom: "conv4_3" + top: "pool4" + top: "pool4_mask" + name: "pool4" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool4" + top: "conv5_1" + name: "conv5_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "conv5_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "relu5_1" + type: "ReLU" +} +layer { + bottom: "conv5_1" + top: "conv5_2" + name: "conv5_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "conv5_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "relu5_2" + type: "ReLU" +} +layer { + bottom: "conv5_2" + top: "conv5_3" + name: "conv5_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "conv5_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "relu5_3" + type: "ReLU" +} +layer { + bottom: "conv5_3" + top: "pool5" + top: "pool5_mask" + name: "pool5" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "upsample5" + type: "Upsample" + bottom: "pool5" + top: "pool5_D" + bottom: "pool5_mask" + upsample_param { + scale: 2 + upsample_w: 30 + upsample_h: 23 + } +} +layer { + bottom: "pool5_D" + top: "conv5_3_D" + name: "conv5_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "conv5_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "relu5_3_D" + type: "ReLU" +} + +layer { + bottom: "conv5_3_D" + top: "conv5_2_D" + name: "conv5_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "conv5_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "relu5_2_D" + type: "ReLU" +} +layer { + bottom: "conv5_2_D" + top: "conv5_1_D" + name: "conv5_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "conv5_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "relu5_1_D" + type: "ReLU" +} +layer { + name: "upsample4" + type: "Upsample" + bottom: "conv5_1_D" + top: "pool4_D" + bottom: "pool4_mask" + upsample_param { + scale: 2 + upsample_w: 60 + upsample_h: 45 + } +} +layer { + bottom: "pool4_D" + top: "conv4_3_D" + name: "conv4_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "conv4_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "relu4_3_D" + type: "ReLU" +} +layer { + bottom: "conv4_3_D" + top: "conv4_2_D" + name: "conv4_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "conv4_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "relu4_2_D" + type: "ReLU" +} +layer { + bottom: "conv4_2_D" + top: "conv4_1_D" + name: "conv4_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "conv4_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "relu4_1_D" + type: "ReLU" +} +layer { + name: "upsample3" + type: "Upsample" + bottom: "conv4_1_D" + top: "pool3_D" + bottom: "pool3_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool3_D" + top: "conv3_3_D" + name: "conv3_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "conv3_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "relu3_3_D" + type: "ReLU" +} +layer { + bottom: "conv3_3_D" + top: "conv3_2_D" + name: "conv3_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "conv3_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "relu3_2_D" + type: "ReLU" +} +layer { + bottom: "conv3_2_D" + top: "conv3_1_D" + name: "conv3_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "conv3_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "relu3_1_D" + type: "ReLU" +} +layer { + name: "upsample2" + type: "Upsample" + bottom: "conv3_1_D" + top: "pool2_D" + bottom: "pool2_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool2_D" + top: "conv2_2_D" + name: "conv2_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "conv2_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "relu2_2_D" + type: "ReLU" +} +layer { + bottom: "conv2_2_D" + top: "conv2_1_D" + name: "conv2_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "conv2_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "relu2_1_D" + type: "ReLU" +} +layer { + name: "upsample1" + type: "Upsample" + bottom: "conv2_1_D" + top: "pool1_D" + bottom: "pool1_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool1_D" + top: "conv1_2_D" + name: "conv1_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "conv1_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "relu1_2_D" + type: "ReLU" +} +layer { + bottom: "conv1_2_D" + top: "conv1_1_D" + name: "conv1_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 12 + pad: 1 + kernel_size: 3 + } +} +layer { + name: "argmax" + type: "ArgMax" + bottom: "conv1_1_D" + top: "argmax" + argmax_param { + axis: 1 + } +} diff --git a/labeling-system/models/segnet_model_driving_webdemo.prototxt b/labeling-system/models/segnet_model_driving_webdemo.prototxt new file mode 100644 index 0000000..f45395d --- /dev/null +++ b/labeling-system/models/segnet_model_driving_webdemo.prototxt @@ -0,0 +1,1607 @@ +name: "VGG_ILSVRC_16_layer" +input: "data" +input_dim: 1 +input_dim: 3 +input_dim: 360 +input_dim: 480 +layer { + bottom: "data" + top: "conv1_1" + name: "conv1_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "conv1_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "relu1_1" + type: "ReLU" +} +layer { + bottom: "conv1_1" + top: "conv1_2" + name: "conv1_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "conv1_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "relu1_2" + type: "ReLU" +} +layer { + bottom: "conv1_2" + top: "pool1" + top: "pool1_mask" + name: "pool1" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool1" + top: "conv2_1" + name: "conv2_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "conv2_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "relu2_1" + type: "ReLU" +} +layer { + bottom: "conv2_1" + top: "conv2_2" + name: "conv2_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "conv2_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "relu2_2" + type: "ReLU" +} +layer { + bottom: "conv2_2" + top: "pool2" + top: "pool2_mask" + name: "pool2" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool2" + top: "conv3_1" + name: "conv3_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "conv3_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "relu3_1" + type: "ReLU" +} +layer { + bottom: "conv3_1" + top: "conv3_2" + name: "conv3_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "conv3_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "relu3_2" + type: "ReLU" +} +layer { + bottom: "conv3_2" + top: "conv3_3" + name: "conv3_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "conv3_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "relu3_3" + type: "ReLU" +} +layer { + bottom: "conv3_3" + top: "pool3" + top: "pool3_mask" + name: "pool3" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool3" + top: "conv4_1" + name: "conv4_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "conv4_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "relu4_1" + type: "ReLU" +} +layer { + bottom: "conv4_1" + top: "conv4_2" + name: "conv4_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "conv4_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "relu4_2" + type: "ReLU" +} +layer { + bottom: "conv4_2" + top: "conv4_3" + name: "conv4_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "conv4_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "relu4_3" + type: "ReLU" +} +layer { + bottom: "conv4_3" + top: "pool4" + top: "pool4_mask" + name: "pool4" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool4" + top: "conv5_1" + name: "conv5_1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "conv5_1_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "relu5_1" + type: "ReLU" +} +layer { + bottom: "conv5_1" + top: "conv5_2" + name: "conv5_2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "conv5_2_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "relu5_2" + type: "ReLU" +} +layer { + bottom: "conv5_2" + top: "conv5_3" + name: "conv5_3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "conv5_3_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "relu5_3" + type: "ReLU" +} +layer { + bottom: "conv5_3" + top: "pool5" + top: "pool5_mask" + name: "pool5" + type: "Pooling" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "upsample5" + type: "Upsample" + bottom: "pool5" + top: "pool5_D" + bottom: "pool5_mask" + upsample_param { + scale: 2 + upsample_w: 30 + upsample_h: 23 + } +} +layer { + bottom: "pool5_D" + top: "conv5_3_D" + name: "conv5_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "conv5_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_3_D" + top: "conv5_3_D" + name: "relu5_3_D" + type: "ReLU" +} + +layer { + bottom: "conv5_3_D" + top: "conv5_2_D" + name: "conv5_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "conv5_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_2_D" + top: "conv5_2_D" + name: "relu5_2_D" + type: "ReLU" +} +layer { + bottom: "conv5_2_D" + top: "conv5_1_D" + name: "conv5_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "conv5_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv5_1_D" + top: "conv5_1_D" + name: "relu5_1_D" + type: "ReLU" +} +layer { + name: "upsample4" + type: "Upsample" + bottom: "conv5_1_D" + top: "pool4_D" + bottom: "pool4_mask" + upsample_param { + scale: 2 + upsample_w: 60 + upsample_h: 45 + } +} +layer { + bottom: "pool4_D" + top: "conv4_3_D" + name: "conv4_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "conv4_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_3_D" + top: "conv4_3_D" + name: "relu4_3_D" + type: "ReLU" +} +layer { + bottom: "conv4_3_D" + top: "conv4_2_D" + name: "conv4_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 512 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "conv4_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_2_D" + top: "conv4_2_D" + name: "relu4_2_D" + type: "ReLU" +} +layer { + bottom: "conv4_2_D" + top: "conv4_1_D" + name: "conv4_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "conv4_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv4_1_D" + top: "conv4_1_D" + name: "relu4_1_D" + type: "ReLU" +} +layer { + name: "upsample3" + type: "Upsample" + bottom: "conv4_1_D" + top: "pool3_D" + bottom: "pool3_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool3_D" + top: "conv3_3_D" + name: "conv3_3_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "conv3_3_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_3_D" + top: "conv3_3_D" + name: "relu3_3_D" + type: "ReLU" +} +layer { + bottom: "conv3_3_D" + top: "conv3_2_D" + name: "conv3_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 256 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "conv3_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_2_D" + top: "conv3_2_D" + name: "relu3_2_D" + type: "ReLU" +} +layer { + bottom: "conv3_2_D" + top: "conv3_1_D" + name: "conv3_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "conv3_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv3_1_D" + top: "conv3_1_D" + name: "relu3_1_D" + type: "ReLU" +} +layer { + name: "upsample2" + type: "Upsample" + bottom: "conv3_1_D" + top: "pool2_D" + bottom: "pool2_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool2_D" + top: "conv2_2_D" + name: "conv2_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 128 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "conv2_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_2_D" + top: "conv2_2_D" + name: "relu2_2_D" + type: "ReLU" +} +layer { + bottom: "conv2_2_D" + top: "conv2_1_D" + name: "conv2_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "conv2_1_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv2_1_D" + top: "conv2_1_D" + name: "relu2_1_D" + type: "ReLU" +} +layer { + name: "upsample1" + type: "Upsample" + bottom: "conv2_1_D" + top: "pool1_D" + bottom: "pool1_mask" + upsample_param { + scale: 2 + } +} +layer { + bottom: "pool1_D" + top: "conv1_2_D" + name: "conv1_2_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 64 + pad: 1 + kernel_size: 3 + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "conv1_2_D_bn" + type: "BN" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 1 + decay_mult: 0 + } + bn_param { + bn_mode: INFERENCE + scale_filler { + type: "constant" + value: 1 + } + shift_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "conv1_2_D" + top: "conv1_2_D" + name: "relu1_2_D" + type: "ReLU" +} +layer { + bottom: "conv1_2_D" + top: "conv1_1_D" + name: "conv1_1_D" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + num_output: 12 + pad: 1 + kernel_size: 3 + } +} +layer { + name: "argmax" + type: "ArgMax" + bottom: "conv1_1_D" + top: "argmax" + argmax_param { + axis: 1 + } +} diff --git a/labeling-system/run.sh b/labeling-system/run.sh new file mode 100755 index 0000000..20a6e41 --- /dev/null +++ b/labeling-system/run.sh @@ -0,0 +1,11 @@ +#!/bin/sh +prj_path=$1 +if [[ $prj_path = "" ]] + then echo "Error: use run.sh project_path" +fi + +srun -t "00:03:00" -N 1 -p gpu -o "$prj_path/out.txt"\ + /home/kruchinin_d/lib/caffe-segnet/caffe-segnet-segnet-cleaned/build/tools/caffe\ + test -gpu 0\ + -model $prj_path/models/segnet_mdw_modified.prototxt\ + -weights $prj_path/models/segnet_weights_driving_webdemo.caffemodel & diff --git a/labeling-system/run_python.sh b/labeling-system/run_python.sh new file mode 100755 index 0000000..1fd7249 --- /dev/null +++ b/labeling-system/run_python.sh @@ -0,0 +1,13 @@ +#!/bin/sh +prj_path=$1 +if [[ $prj_path = "" ]] + then echo "Error: use run.sh project_path" +fi + +srun -t "00:03:00" -N 1 -p gpu -o "$prj_path/out_python.txt"\ + python $prj_path/test_segmentation_camvid.py\ + --model $prj_path/models/segnet_inference_modified.prototxt\ + --weights $prj_path/models/segnet_weights_driving_webdemo.caffemodel\ + --path_to_images $prj_path/CamVid/test\ + --iter 200\ + --result_dir $prj_path/out_img & diff --git a/labeling-system/test_segmentation_camvid.py b/labeling-system/test_segmentation_camvid.py new file mode 100644 index 0000000..0ac30a3 --- /dev/null +++ b/labeling-system/test_segmentation_camvid.py @@ -0,0 +1,75 @@ +import numpy as np +import cv2 +import argparse +import glob +caffe_root = 'PATH_TO_SEGNET!!! LINE 5' +import sys +sys.path.insert(0, caffe_root + 'python') + +import caffe + +# Import arguments +parser = argparse.ArgumentParser() +parser.add_argument('--model', type=str, required=True) +parser.add_argument('--weights', type=str, required=True) +parser.add_argument('--path_to_images', type=str, required=True) +parser.add_argument('--iter', type=int, required=True) +parser.add_argument('--result_dir', type=str, required=True) +args = parser.parse_args() + +caffe.set_mode_gpu() + +net = caffe.Net(args.model, + args.weights, + caffe.TEST) + +images = [caffe.io.load_image(im_f) + for im_f in glob.glob(args.path_to_images + '/*.png')] + +for i in range(0, args.iter): + + input = images[i] + inp = np.array([input[:,:,0], input[:,:,1], input[:,:,2]]) + net.blobs['data'] = inp + net.forward() + + image = images[i] + #label = net.blobs['label'].data + predicted = net.blobs['prob'].data + #image = np.squeeze(image[0,:,:,:]) + output = np.squeeze(predicted[0,:,:,:]) + ind = np.argmax(output, axis=0) + + r = ind.copy() + g = ind.copy() + b = ind.copy() + + Sky = [128,128,128] + Building = [128,0,0] + Pole = [192,192,128] + Road_marking = [255,69,0] + Road = [128,64,128] + Pavement = [60,40,222] + Tree = [128,128,0] + SignSymbol = [192,128,128] + Fence = [64,64,128] + Car = [64,0,128] + Pedestrian = [64,64,0] + Bicyclist = [0,128,192] + Unlabelled = [0,0,0] + + label_colours = np.array([Sky, Building, Pole, Road, Pavement, Tree, SignSymbol, Fence, Car, Pedestrian, Bicyclist, Unlabelled]) + for l in range(0,12): + r[ind==l] = label_colours[l,0] + g[ind==l] = label_colours[l,1] + b[ind==l] = label_colours[l,2] + + rgb = np.zeros((ind.shape[0], ind.shape[1], 3)) + rgb[:,:,0] = r + rgb[:,:,1] = g + rgb[:,:,2] = b + + cv2.imwrite(args.result_dir + ('/segnet_{}.png').format(i), rgb) + +print 'Success!' +