aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/src
diff options
context:
space:
mode:
authorNikhil Raj <nikhil.raj@arm.com>2021-04-02 22:04:39 +0100
committerNikhil Raj <nikhil.raj@arm.com>2021-04-16 14:27:27 +0100
commit6dd178f2395b34cfb360eabb0130c19ed258f5fa (patch)
tree6814e4729bbd1e652d8b9c18c9db28f3bc2f8a8a /python/pyarmnn/src
parented7fce413410d15c501ea52f9e6bfbbf71b3daf1 (diff)
downloadarmnn-6dd178f2395b34cfb360eabb0130c19ed258f5fa.tar.gz
IVGCVSW-5720 Remove the Caffe Parser from ArmNN
Signed-off-by: Nikhil Raj <nikhil.raj@arm.com> Change-Id: Ib00be204f549efa9aa5971ecf65c2dec4a10b10f
Diffstat (limited to 'python/pyarmnn/src')
-rw-r--r--python/pyarmnn/src/pyarmnn/__init__.py12
-rw-r--r--python/pyarmnn/src/pyarmnn/swig/armnn_caffeparser.i103
2 files changed, 0 insertions, 115 deletions
diff --git a/python/pyarmnn/src/pyarmnn/__init__.py b/python/pyarmnn/src/pyarmnn/__init__.py
index 19b14a4b09..410e66be11 100644
--- a/python/pyarmnn/src/pyarmnn/__init__.py
+++ b/python/pyarmnn/src/pyarmnn/__init__.py
@@ -7,18 +7,6 @@ import logging
from ._generated.pyarmnn_version import GetVersion, GetMajorVersion, GetMinorVersion
# Parsers
-try:
- from ._generated.pyarmnn_caffeparser import ICaffeParser
-except ImportError as err:
- logger = logging.getLogger(__name__)
- message = "Your ArmNN library instance does not support Caffe models parser functionality. "
- logger.warning("%s Skipped ICaffeParser import.", message)
- logger.debug(str(err))
-
-
- def ICaffeParser():
- """In case people try importing without having Arm NN built with this parser."""
- raise RuntimeError(message)
try:
from ._generated.pyarmnn_onnxparser import IOnnxParser
diff --git a/python/pyarmnn/src/pyarmnn/swig/armnn_caffeparser.i b/python/pyarmnn/src/pyarmnn/swig/armnn_caffeparser.i
deleted file mode 100644
index 538b486aad..0000000000
--- a/python/pyarmnn/src/pyarmnn/swig/armnn_caffeparser.i
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Copyright © 2020 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-%module pyarmnn_caffeparser
-%{
-#define SWIG_FILE_WITH_INIT
-#include "armnnCaffeParser/ICaffeParser.hpp"
-#include "armnn/INetwork.hpp"
-%}
-
-//typemap definitions and other common stuff
-%include "standard_header.i"
-
-namespace std {
- %template(BindingPointInfo) pair<int, armnn::TensorInfo>;
- %template(MapStringTensorShape) map<std::string, armnn::TensorShape>;
- %template(StringVector) vector<string>;
-}
-
-namespace armnnCaffeParser
-{
-
-%feature("docstring",
-"
-Interface for creating a parser object using Caffe (http://caffe.berkeleyvision.org/) caffemodel files.
-
-Parsers are used to automatically construct Arm NN graphs from model files.
-
-") ICaffeParser;
-
-%nodefaultctor ICaffeParser;
-class ICaffeParser
-{
-public:
- // Documentation
- %feature("docstring",
- "
- Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name.
-
- Args:
- name (str): Name of the input.
-
- Returns:
- tuple: (`int`, `TensorInfo`)
- ") GetNetworkInputBindingInfo;
-
- %feature("docstring",
- "
- Retrieve binding info (layer id and `TensorInfo`) for the network output identified by the given layer name.
-
- Args:
- name (str): Name of the output.
-
- Returns:
- tuple: (`int`, `TensorInfo`)
- ") GetNetworkOutputBindingInfo;
-
- std::pair<int, armnn::TensorInfo> GetNetworkInputBindingInfo(const std::string& name);
- std::pair<int, armnn::TensorInfo> GetNetworkOutputBindingInfo(const std::string& name);
-};
-
-%extend ICaffeParser {
- // This is not a substitution of the default constructor of the Armnn class. It tells swig to create custom __init__
- // method for ICaffeParser python object that will use static factory method to do the job.
-
- ICaffeParser() {
- return armnnCaffeParser::ICaffeParser::CreateRaw();
- }
-
- // The following does not replace a real destructor of the Armnn class.
- // It creates a functions that will be called when swig object goes out of the scope to clean resources.
- // so the user doesn't need to call ICaffeParser::Destroy himself.
- // $self` is a pointer to extracted ArmNN ICaffeParser object.
-
- ~ICaffeParser() {
- armnnCaffeParser::ICaffeParser::Destroy($self);
- }
-
- %feature("docstring",
- "
- Create the network from a Caffe caffemodel binary file on disk.
-
- Args:
- graphFile: Path to the caffe model to be parsed.
- inputShapes (tuple): (`string`, `TensorShape`) A tuple containing the input name and TensorShape information for the network.
- requestedOutputs (list): A list of the output tensor names.
-
- Returns:
- INetwork: INetwork object for the parsed Caffe model.
- ") CreateNetworkFromBinaryFile;
-
- %newobject CreateNetworkFromBinaryFile;
- armnn::INetwork* CreateNetworkFromBinaryFile(const char* graphFile,
- const std::map<std::string, armnn::TensorShape>& inputShapes,
- const std::vector<std::string>& requestedOutputs) {
- return $self->CreateNetworkFromBinaryFile(graphFile, inputShapes, requestedOutputs).release();
- }
-}
-}
-
-// Clear exception typemap.
-%exception;