资源简介
语义分割PSPNet,实现是基于matlab和python两个版本。
代码片段和文件信息
/*
Copyright (c) 2011 Philipp Krähenbühl
All rights reserved.
Redistribution and use in source and binary forms with or without
modification are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Stanford University nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY Philipp Krähenbühl ‘‘AS IS‘‘ AND ANY
EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Philipp Krähenbühl BE LIABLE FOR ANY
DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES
(INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include “densecrf.h“
#include “util.h“
class BPPottsPotential: public PairwisePotential{
protected:
Permutohedral lattice_;
BPPottsPotential( const BPPottsPotential&o ){}
int N1_ N2_;
float w_;
float *norm_;
public:
~BPPottsPotential(){
deallocate( norm_ );
}
BPPottsPotential(const float* features1 const float* features2 int D int N1 int N2 float w bool per_pixel_normalization=true) :N1_(N1) N2_(N2) w_(w) {
float * features = new float[ (N1_+N2_)*D ];
memset( features 0 (N1_+N2_)*D*sizeof(float) );
memcpy( features features1 N1_*D*sizeof(float) );
memcpy( features+N1_*D features2 N2_*D*sizeof(float) );
lattice_.init( features D N1_+N2_ );
delete [] features;
norm_ = allocate( N2_ );
float * tmp = allocate( N1_ );
for( int i=0; i tmp[i] = 1;
// Compute the normalization factor
lattice_.compute( norm_ tmp 1 0 N1_ N1_ N2_ );
if( per_pixel_normalization ){
// use a per pixel normalization
for( int i=0; i norm_[i] = 1.f / (norm_[i]+1e-20f);
}
else{
float mean_norm = 0;
for( int i=0; i mean_norm += norm_[i];
mean_norm = N2_ / mean_norm;
// use a per pixel normalization
for( int i=0; i norm_[i] = mean_norm;
}
deallocate( tmp );
}
virtual void apply( float * out_values const float * in_values f
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 261 2018-04-24 15:12 PSPNet\.git\config
文件 73 2018-04-24 15:12 PSPNet\.git\desc
文件 23 2018-04-24 15:12 PSPNet\.git\HEAD
文件 478 2018-04-24 15:12 PSPNet\.git\hooks\applypatch-msg.sample
文件 896 2018-04-24 15:12 PSPNet\.git\hooks\commit-msg.sample
文件 189 2018-04-24 15:12 PSPNet\.git\hooks\post-update.sample
文件 424 2018-04-24 15:12 PSPNet\.git\hooks\pre-applypatch.sample
文件 1642 2018-04-24 15:12 PSPNet\.git\hooks\pre-commit.sample
文件 1348 2018-04-24 15:12 PSPNet\.git\hooks\pre-push.sample
文件 4898 2018-04-24 15:12 PSPNet\.git\hooks\pre-reba
文件 1239 2018-04-24 15:12 PSPNet\.git\hooks\prepare-commit-msg.sample
文件 3610 2018-04-24 15:12 PSPNet\.git\hooks\update.sample
文件 90400 2018-04-24 15:12 PSPNet\.git\index
文件 240 2018-04-24 15:12 PSPNet\.git\info\exclude
文件 172 2018-04-24 15:12 PSPNet\.git\logs\HEAD
文件 172 2018-04-24 15:12 PSPNet\.git\logs\refs\heads\master
文件 172 2018-04-24 15:12 PSPNet\.git\logs\refs\remotes\origin\HEAD
文件 38872 2018-04-24 15:12 PSPNet\.git\ob
文件 8459346 2018-04-24 15:12 PSPNet\.git\ob
文件 107 2018-04-24 15:12 PSPNet\.git\packed-refs
文件 41 2018-04-24 15:12 PSPNet\.git\refs\heads\master
文件 32 2018-04-24 15:12 PSPNet\.git\refs\remotes\origin\HEAD
文件 1180 2018-04-24 15:12 PSPNet\caffe.cloc
文件 2102 2018-04-24 15:12 PSPNet\CAFFE_README.md
文件 4373 2018-04-24 15:12 PSPNet\cmake\ConfigGen.cmake
文件 11184 2018-04-24 15:12 PSPNet\cmake\Cuda.cmake
文件 5564 2018-04-24 15:12 PSPNet\cmake\Dependencies.cmake
文件 1939 2018-04-24 15:12 PSPNet\cmake\External\gflags.cmake
文件 1719 2018-04-24 15:12 PSPNet\cmake\External\glog.cmake
文件 1505 2018-04-24 15:12 PSPNet\cmake\lint.cmake
............此处省略937个文件信息
- 上一篇:脉冲神经网络Python可运行
- 下一篇:Python游戏编程快速上手.rar
评论
共有 条评论