Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
620d74ab
Commit
620d74ab
authored
Jan 19, 2017
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put Torch importer implementation under ifdef
parent
56bea16d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
THFile.h
modules/dnn/src/torch/THFile.h
+3
-1
torch_importer.cpp
modules/dnn/src/torch/torch_importer.cpp
+9
-1
No files found.
modules/dnn/src/torch/THFile.h
View file @
620d74ab
...
...
@@ -2,6 +2,7 @@
#define TH_FILE_INC
//#include "THStorage.h"
#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#include "THGeneral.h"
typedef
struct
THFile__
THFile
;
...
...
@@ -84,4 +85,5 @@ TH_API long THFile_position(THFile *self);
TH_API
void
THFile_close
(
THFile
*
self
);
TH_API
void
THFile_free
(
THFile
*
self
);
#endif
#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#endif //TH_FILE_INC
modules/dnn/src/torch/torch_importer.cpp
View file @
620d74ab
...
...
@@ -49,7 +49,7 @@
namespace
cv
{
namespace
dnn
{
#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
#include "THDiskFile.h"
#ifdef NDEBUG
...
...
@@ -964,6 +964,14 @@ Blob readTorchBlob(const String &filename, bool isBinary)
return
importer
->
tensors
.
begin
()
->
second
;
}
#else
Ptr
<
Importer
>
createTorchImporter
(
const
String
&
filename
,
bool
isBinary
)
{
CV_Error
(
Error
::
StsNotImplemented
,
"Torch importer is disabled in current build"
);
return
Ptr
<
Importer
>
();
}
#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment