40
40
//M*/
41
41
42
42
#include " ../precomp.hpp"
43
- using namespace cv ;
44
- using namespace cv ::dnn;
45
43
46
44
#ifdef HAVE_PROTOBUF
47
45
#include " caffe.pb.h"
@@ -54,7 +52,13 @@ using namespace cv::dnn;
54
52
#include < google/protobuf/text_format.h>
55
53
#include < google/protobuf/io/zero_copy_stream_impl.h>
56
54
#include " caffe_io.hpp"
55
+ #endif
57
56
57
+ namespace cv {
58
+ namespace dnn {
59
+ CV__DNN_EXPERIMENTAL_NS_BEGIN
60
+
61
+ #ifdef HAVE_PROTOBUF
58
62
using ::google::protobuf::RepeatedField;
59
63
using ::google::protobuf::RepeatedPtrField;
60
64
using ::google::protobuf::Message;
@@ -361,26 +365,29 @@ class CaffeImporter : public Importer
361
365
362
366
}
363
367
364
- Ptr<Importer> cv::dnn:: createCaffeImporter (const String &prototxt, const String &caffeModel)
368
+ Ptr<Importer> createCaffeImporter (const String &prototxt, const String &caffeModel)
365
369
{
366
370
return Ptr<Importer>(new CaffeImporter (prototxt.c_str (), caffeModel.c_str ()));
367
371
}
368
372
369
373
#else // HAVE_PROTOBUF
370
374
371
- Ptr<Importer> cv::dnn:: createCaffeImporter (const String&, const String&)
375
+ Ptr<Importer> createCaffeImporter (const String&, const String&)
372
376
{
373
377
CV_Error (cv::Error::StsNotImplemented, " libprotobuf required to import data from Caffe models" );
374
378
return Ptr<Importer>();
375
379
}
376
380
377
381
#endif // HAVE_PROTOBUF
378
382
379
- Net cv::dnn:: readNetFromCaffe (const String &prototxt, const String &caffeModel /* = String()*/ )
383
+ Net readNetFromCaffe (const String &prototxt, const String &caffeModel /* = String()*/ )
380
384
{
381
385
Ptr<Importer> caffeImporter = createCaffeImporter (prototxt, caffeModel);
382
386
Net net;
383
387
if (caffeImporter)
384
388
caffeImporter->populateNet (net);
385
389
return net;
386
390
}
391
+
392
+ CV__DNN_EXPERIMENTAL_NS_END
393
+ }} // namespace
0 commit comments