-
大小: 80.65MB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2022-06-27
- 語言: 其他
- 標(biāo)簽: dnn??opencv??深度學(xué)習(xí)??demo??
資源簡介
opencv dnn模塊的demo,詳情可見下面文章
http://blog.csdn.net/weixinhum/article/details/70982048
代碼片段和文件信息
/**M///////////////////////////////////////////////////////////////////////////////////////
//
//??IMPORTANT:?READ?BEFORE?DOWNLOADING?COPYING?INSTALLING?OR?USING.
//
//??By?downloading?copying?installing?or?using?the?software?you?agree?to?this?license.
//??If?you?do?not?agree?to?this?license?do?not?download?install
//??copy?or?use?the?software.
//
//
//???????????????????????????License?Agreement
//????????????????For?Open?Source?Computer?Vision?Library
//
//?Copyright?(C)?2013?OpenCV?Foundation?all?rights?reserved.
//?Third?party?copyrights?are?property?of?their?respective?owners.
//
//?Redistribution?and?use?in?source?and?binary?forms?with?or?without?modification
//?are?permitted?provided?that?the?following?conditions?are?met:
//
//???*?Redistribution‘s?of?source?code?must?retain?the?above?copyright?notice
//?????this?list?of?conditions?and?the?following?disclaimer.
//
//???*?Redistribution‘s?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.
//
//???*?The?name?of?the?copyright?holders?may?not?be?used?to?endorse?or?promote?products
//?????derived?from?this?software?without?specific?prior?written?permission.
//
//?This?software?is?provided?by?the?copyright?holders?and?contributors?“as?is“?and
//?any?express?or?implied?warranties?including?but?not?limited?to?the?implied
//?warranties?of?merchantability?and?fitness?for?a?particular?purpose?are?disclaimed.
//?In?no?event?shall?the?Intel?Corporation?or?contributors?be?liable?for?any?direct
//?indirect?incidental?special?exemplary?or?consequential?damages
//?(including?but?not?limited?to?procurement?of?substitute?goods?or?services;
//?loss?of?use?data?or?profits;?or?business?interruption)?however?caused
//?and?on?any?theory?of?liability?whether?in?contract?strict?liability
//?or?tort?(including?negligence?or?otherwise)?arising?in?any?way?out?of
//?the?use?of?this?software?even?if?advised?of?the?possibility?of?such?damage.
//
//M*/
#include?
#include?
#include?
using?namespace?cv;
using?namespace?cv::dnn;
#include?
#include?
#include?
using?namespace?std;
/*?Find?best?class?for?the?blob?(i.?e.?class?with?maximal?probability)?*/
void?getMaxClass(dnn::Blob?&probBlob?int?*classId?double?*classProb)
{
????Mat?probMat?=?probBlob.matRefConst().reshape(1?1);?//reshape?the?blob?to?1x1000?matrix
????Point?classNumber;
????minMaxLoc(probMat?NULL?classProb?NULL?&classNumber);
????*classId?=?classNumber.x;
}
std::vector?readClassNames(const?char?*filename?=?“synset_words.txt“)
{
????std::vector?classNames;
????std::ifstream?fp(filename);
????if?(!fp.is_open())
????{
????????std::cerr?<“File?with?classes?labels?not?found:?“?<????????exit(-1);
????}
????std::string?name;
????while?(!fp.eof())
????{
?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-04-29?17:26??dnnDemo\
?????目錄???????????0??2017-04-29?17:48??dnnDemo\dnnDemo\
?????目錄???????????0??2017-04-29?17:26??dnnDemo\dnnDemo\.vs\
?????目錄???????????0??2017-04-29?17:26??dnnDemo\dnnDemo\.vs\dnnDemo\
?????目錄???????????0??2017-04-29?17:26??dnnDemo\dnnDemo\.vs\dnnDemo\v14\
?????文件???????24576??2017-04-29?17:48??dnnDemo\dnnDemo\.vs\dnnDemo\v14\.suo
?????目錄???????????0??2017-04-29?17:42??dnnDemo\dnnDemo\dnnDemo\
?????文件????????1303??2017-04-29?17:26??dnnDemo\dnnDemo\dnnDemo.sln
?????文件????53533754??2017-04-28?02:52??dnnDemo\dnnDemo\dnnDemo\bvlc_googlenet.caffemodel
?????文件???????35816??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\bvlc_googlenet.prototxt
?????文件????????5582??2017-04-29?17:42??dnnDemo\dnnDemo\dnnDemo\caffe_googlenet.cpp
?????文件????????7729??2017-04-29?17:34??dnnDemo\dnnDemo\dnnDemo\dnnDemo.vcxproj
?????文件?????????956??2017-04-29?17:34??dnnDemo\dnnDemo\dnnDemo\dnnDemo.vcxproj.filters
?????目錄???????????0??2017-04-29?17:28??dnnDemo\dnnDemo\dnnDemo\include\
?????目錄???????????0??2017-04-29?17:28??dnnDemo\dnnDemo\dnnDemo\include\opencv\
?????目錄???????????0??2017-04-29?17:28??dnnDemo\dnnDemo\dnnDemo\include\opencv2\
?????目錄???????????0??2017-04-29?17:28??dnnDemo\dnnDemo\dnnDemo\include\opencv2\aruco\
?????文件???????25124??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\aruco.hpp
?????文件???????15222??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\aruco\charuco.hpp
?????文件????????6436??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\aruco\dictionary.hpp
?????文件????????7518??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\bgsegm.hpp
?????目錄???????????0??2017-04-29?17:28??dnnDemo\dnnDemo\dnnDemo\include\opencv2\bioinspired\
?????文件????????2716??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\bioinspired.hpp
?????文件????????2373??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\bioinspired\bioinspired.hpp
?????文件???????27057??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\bioinspired\retina.hpp
?????文件????????8675??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\bioinspired\retinafasttonemapping.hpp
?????文件???????10235??2016-03-06?19:26??dnnDemo\dnnDemo\dnnDemo\include\opencv2\bioinspired\transientareassegmentationmodule.hpp
?????目錄???????????0??2017-04-29?17:28??dnnDemo\dnnDemo\dnnDemo\include\opencv2\calib3d\
?????文件??????124712??2017-04-27?22:14??dnnDemo\dnnDemo\dnnDemo\include\opencv2\calib3d.hpp
?????文件????????2369??2017-04-27?22:14??dnnDemo\dnnDemo\dnnDemo\include\opencv2\calib3d\calib3d.hpp
?????文件???????20138??2017-04-27?22:14??dnnDemo\dnnDemo\dnnDemo\include\opencv2\calib3d\calib3d_c.h
............此處省略412個文件信息
評論
共有 條評論