JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
|
|
|
Go to the documentation of this file.
23 #include <ovxlib/vsi_nn_pub.h>
25 #include <opencv2/core/core.hpp>
48 "are relative paths.",
49 JEVOIS_SHARE_PATH, ParamCateg);
53 "Can have extension .prototxt (Caffe), .pbtxt (TensorFlow), or .cfg (Darknet). "
54 "If path is relative, it will be prefixed by dataroot.",
59 "Can have extension .caffemodel (Caffe), .pb (TensorFlow), .t7 or .net (Torch), "
60 ".tflite (TensorFlow Lite), or .weights (Darknet). If path is relative, it will be "
61 "prefixed by dataroot.",
74 "next time you load a different model.",
75 Target::CPU, Target_Values, ParamCateg);
79 #define JEVOIS_BACKEND_DEFAULT Backend::OpenCV
83 #define JEVOIS_BACKEND_DEFAULT Backend::Default
88 "engine if available, otherwise OpenCV (note that inference engine only works on Intel "
89 "processors or MyriadX hardware, thus you should normally select OpenCV when running "
90 "on JeVois-Pro Platform, unless you want to use an optional MyriadX accelerator). "
91 "Changes will take effect next time you load a model.",
100 "added after the regular intensors. Format is: "
101 "<type>:<shape>:val1 val2 ... valN, <type>:<shape>:val1 ... valN. For example, for "
102 "URetinex-Net: 32F:1x1x1:3.0",
111 "sometimes useful to re-interpret tensors to what a post-processor expects; for "
112 "example, TPU YoloV4-Int-VOC outputs 5D tensors 32F:1x52x52x3x85, 32F:1x26x26x3x85, "
113 "32F:1x13x13x3x85 but the YOLO post-processor expects 4D, which would be specified here "
114 "as 32F:1x52x52x255, 32F:1x26x26x255, 32F:1x13x13x255. Note that this only changes "
115 "the description of dimensions, but does not move any pixel data around (e.g., cannot "
116 "convert from NCHW to NHWC, convert data types, etc). Use sparingly and with caution.",
125 "Name of class defined in the file must match the file name without "
126 "the trailing '.py'",
131 "1 when using a dual-TPU add-on board, or more when using additional TPUs connected "
137 "several Hailo8 accelerators are connected to the system",
146 "to use latest version",
147 "", boost::regex(
"^$|^[0-9]+\\.[0-9]+\\.[0-9]+$"), ParamCateg);
151 "fast networks. Use with caution as it may lead to overheating, not "
152 "recommended for production",
161 public Parameter<network::comment, network::url, network::outreshape, network::extraintensors>
179 virtual std::vector<vsi_nn_tensor_attr_t>
inputShapes() = 0;
182 virtual std::vector<vsi_nn_tensor_attr_t>
outputShapes() = 0;
188 std::vector<cv::Mat>
process(std::vector<cv::Mat>
const & blobs, std::vector<std::string> & info);
193 virtual void freeze(
bool doit);
197 virtual void load() = 0;
200 virtual std::vector<cv::Mat>
doprocess(std::vector<cv::Mat>
const & blobs,
201 std::vector<std::string> & info) = 0;
203 void onParamChange(network::outreshape
const & param, std::string
const & val)
override;
206 std::atomic<bool> itsLoading =
false;
207 std::atomic<bool> itsLoaded =
false;
208 std::future<void> itsLoadFut;
209 std::vector<vsi_nn_tensor_attr_t> itsReshape;
friend class Component
Allow Component and DynamicParameter to access our registry data, everyone else is locked out.
bool ready()
Returns true when network is ready to run (loaded and initialized)
virtual ~Network()
Destructor.
void onParamChange(network::outreshape const ¶m, std::string const &val) override
JEVOIS_DECLARE_PARAMETER(thresh1, double, "First threshold for hysteresis", 50.0, ParamCateg)
std::vector< cv::Mat > process(std::vector< cv::Mat > const &blobs, std::vector< std::string > &info)
Process input blobs and obtain output blobs.
A component of a model hierarchy.
#define JEVOIS_BACKEND_DEFAULT
virtual std::vector< vsi_nn_tensor_attr_t > inputShapes()=0
Get shapes of all input tensors.
void waitBeforeDestroy()
If network is currently loading, wait until that is done before destroying.
A category to which multiple ParameterDef definitions can belong.
virtual void load()=0
Load from disk.
virtual void freeze(bool doit)
Freeze/unfreeze parameters that users should not change while running.
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(l2grad, bool, "Use more accurate L2 gradient norm if true, L1 if false", false, ParamCateg)
virtual std::vector< vsi_nn_tensor_attr_t > outputShapes()=0
Get shapes of all output tensors.
JEVOIS_DEFINE_ENUM_CLASS(CameraSensor,(any)(imx290)(os08a10)(ar0234))
Enum for different sensor models.
virtual std::vector< cv::Mat > doprocess(std::vector< cv::Mat > const &blobs, std::vector< std::string > &info)=0
Process input blobs and obtain output blobs.
Abstract class to represent a neural network.