-
大小: 19.85MB文件類型: .zip金幣: 1下載: 0 次發布日期: 2023-08-06
- 語言: 其他
- 標簽: tensorflow??opencv??pb轉pbtxt??
資源簡介
此工程針對tensorflow自己訓練的模型,pb轉pbtxt,pb和pbtxt可以用opencv進行調用。
大家盡量不要再下載這個文檔了,積分太貴了,我無法改積分。建議大家直接把opencv更新到4.0以上,用opencv的Sample/dnn里面的腳本轉換就可以了。opencv調用也建議用opencv4.0以上版本。
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?“common.hpp“
std::string?keys?=
????“{?help??h?????|?|?Print?help?message.?}“
????“{?@alias??????|?|?An?alias?name?of?model?to?extract?preprocessing?parameters?from?models.yml?file.?}“
????“{?zoo?????????|?models.yml?|?An?optional?path?to?file?with?preprocessing?parameters?}“
????“{?input?i?????|?|?Path?to?input?image?or?video?file.?Skip?this?argument?to?capture?frames?from?a?camera.}“
????“{?framework?f?|?|?Optional?name?of?an?origin?framework?of?the?model.?Detect?it?automatically?if?it?does?not?set.?}“
????“{?classes?????|?|?Optional?path?to?a?text?file?with?names?of?classes.?}“
????“{?backend?????|?0?|?Choose?one?of?computation?backends:?“
????????????????????????“0:?automatically?(by?default)?“
????????????????????????“1:?Halide?language?(http://halide-lang.org/)?“
????????????????????????“2:?Intel‘s?Deep?Learning?Inference?Engine?(https://software.intel.com/openvino-toolkit)?“
????????????????????????“3:?OpenCV?implementation?}“
????“{?target??????|?0?|?Choose?one?of?target?computation?devices:?“
????????????????????????“0:?CPU?target?(by?default)?“
????????????????????????“1:?OpenCL?“
????????????????????????“2:?OpenCL?fp16?(half-float?precision)?“
????????????????????????“3:?VPU?}“;
using?namespace?cv;
using?namespace?dnn;
std::vector?classes;
int?main(int?argc?char**?argv)
{
????CommandLineParser?parser(argc?argv?keys);
????const?std::string?modelName?=?parser.get(“@alias“);
????const?std::string?zooFile?=?parser.get(“zoo“);
????keys?+=?genPreprocArguments(modelName?zooFile);
????parser?=?CommandLineParser(argc?argv?keys);
????parser.about(“Use?this?script?to?run?classification?deep?learning?networks?using?OpenCV.“);
????if?(argc?==?1?||?parser.has(“help“))
????{
????????parser.printMessage();
????????return?0;
????}
????float?scale?=?parser.get(“scale“);
????Scalar?mean?=?parser.get(“mean“);
????bool?swapRB?=?parser.get(“rgb“);
????int?inpWidth?=?parser.get(“width“);
????int?inpHeight?=?parser.get(“height“);
????String?model?=?findFile(parser.get(“model“));
????String?config?=?findFile(parser.get(“config“));
????String?framework?=?parser.get(“framework“);
????int?backendId?=?parser.get(“backend“);
????int?targetId?=?parser.get(“target“);
????//?Open?file?with?classes?names.
????if?(parser.has(“classes“))
????{
????????std::string?file?=?parser.get(“classes“);
????????std::ifstream?ifs(file.c_str());
????????if?(!ifs.is_open())
????????????CV_Error(Error::StsError?“File?“?+?file?+?“?not?found“);
????????std::string?line;
????????while?(std::getline(ifs?line))
????????{
????????????classes.push_back(line);
????????}
????}
????if?(!parser.check())
????{
????????parser.printErrors();
????????return?1;
????}
????CV_Assert(!model.empty());
????//!?[Read?and?initialize?network]
????Ne
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-05-16?20:11??pb_convert_pbtxt\
?????目錄???????????0??2019-04-22?10:49??pb_convert_pbtxt\dnn\
?????文件????????5137??2019-04-16?21:10??pb_convert_pbtxt\dnn\classification.cpp
?????文件????????3763??2019-04-16?21:10??pb_convert_pbtxt\dnn\classification.py
?????文件?????????681??2019-04-16?21:10??pb_convert_pbtxt\dnn\CMakeLists.txt
?????文件????????7072??2019-04-16?21:10??pb_convert_pbtxt\dnn\colorization.cpp
?????文件????????2943??2019-04-16?21:10??pb_convert_pbtxt\dnn\colorization.py
?????文件????????4435??2019-04-16?21:10??pb_convert_pbtxt\dnn\common.hpp
?????文件????????4913??2019-04-16?21:10??pb_convert_pbtxt\dnn\common.py
?????文件?????????563??2019-04-18?08:18??pb_convert_pbtxt\dnn\convert.py
?????文件???????10854??2019-04-16?21:10??pb_convert_pbtxt\dnn\custom_la
?????文件????????2719??2019-04-16?21:10??pb_convert_pbtxt\dnn\edge_detection.py
?????目錄???????????0??2019-04-22?10:49??pb_convert_pbtxt\dnn\face_detector\
?????文件???????28092??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\deploy.prototxt
?????文件????????2495??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\download_weights.py
?????文件????????3639??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\how_to_train_face_detector.txt
?????文件???????34912??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\opencv_face_detector.pbtxt
?????文件?????????465??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\solver.prototxt
?????文件???????28842??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\test.prototxt
?????文件???????30504??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\train.prototxt
?????文件?????????824??2019-04-16?21:10??pb_convert_pbtxt\dnn\face_detector\weights.me
?????文件????????1845??2019-04-16?21:10??pb_convert_pbtxt\dnn\fast_neural_st
?????文件???????10472??2019-04-17?07:53??pb_convert_pbtxt\dnn\graph_convert.py
?????文件????????6937??2019-04-16?21:10??pb_convert_pbtxt\dnn\js_face_recognition.html
?????文件????????5271??2019-04-16?21:10??pb_convert_pbtxt\dnn\mask_rcnn.py
?????文件????????5052??2019-04-16?21:10??pb_convert_pbtxt\dnn\mobilenet_ssd_accuracy.py
?????文件????????3583??2019-04-16?21:10??pb_convert_pbtxt\dnn\models.yml
?????文件????????9920??2019-04-16?21:10??pb_convert_pbtxt\dnn\ob
?????文件????????9221??2019-04-16?21:10??pb_convert_pbtxt\dnn\ob
?????文件????????5808??2019-04-16?21:10??pb_convert_pbtxt\dnn\openpose.cpp
?????文件????????6517??2019-04-16?21:10??pb_convert_pbtxt\dnn\openpose.py
............此處省略15個文件信息
評論
共有 條評論