@Namespace(value="cv::dnn") @NoOffset @Properties(inherit=opencv_dnn.class) public class Model extends Net
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
Model()
\brief Default constructor.
|
Model(BytePointer model) |
Model(BytePointer model,
BytePointer config)
\brief Create model from deep learning network represented in one of the supported formats.
|
Model(long size)
Native array allocator.
|
Model(Net network)
\brief Create model from deep learning network.
|
Model(Pointer p)
Pointer cast constructor.
|
Model(String model) |
Model(String model,
String config) |
| Modifier and Type | Method and Description |
|---|---|
Model |
position(long position) |
void |
predict(GpuMat frame,
GpuMatVector outs) |
void |
predict(GpuMat frame,
MatVector outs) |
void |
predict(GpuMat frame,
UMatVector outs) |
void |
predict(Mat frame,
GpuMatVector outs) |
void |
predict(Mat frame,
MatVector outs)
\brief Given the \p input frame, create input blob, run net and return the output \p blobs.
|
void |
predict(Mat frame,
UMatVector outs) |
void |
predict(UMat frame,
GpuMatVector outs) |
void |
predict(UMat frame,
MatVector outs) |
void |
predict(UMat frame,
UMatVector outs) |
Model |
setInputCrop(boolean crop)
\brief Set flag crop for frame.
|
Model |
setInputMean(Scalar mean)
\brief Set mean value for frame.
|
void |
setInputParams() |
void |
setInputParams(double scale,
Size size,
Scalar mean,
boolean swapRB,
boolean crop)
\brief Set preprocessing parameters for frame.
|
Model |
setInputScale(double scale)
\brief Set scalefactor value for frame.
|
Model |
setInputSize(int width,
int height)
\brief Set input size for frame.
|
Model |
setInputSize(Size size)
\brief Set input size for frame.
|
Model |
setInputSwapRB(boolean swapRB)
\brief Set flag swapRB for frame.
|
addLayer, addLayer, addLayerToPrev, addLayerToPrev, connect, connect, connect, dump, dumpToFile, dumpToFile, empty, enableFusion, forward, forward, forward, forward, forward, forward, forward, forward, forward, forward, forward, forward, forward, forward, forward, forwardAndRetrieve, forwardAsync, forwardAsync, forwardAsync, getFLOPS, getFLOPS, getFLOPS, getFLOPS, getLayer, getLayerId, getLayerId, getLayerNames, getLayersCount, getLayersCount, getLayerShapes, getLayerShapes, getLayersShapes, getLayersShapes, getLayersShapes, getLayersShapes, getLayersShapes, getLayersShapes, getLayerTypes, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getParam, getParam, getPerfProfile, getPerfProfile, getPerfProfile, getUnconnectedOutLayers, getUnconnectedOutLayersNames, readFromModelOptimizer, readFromModelOptimizer, readFromModelOptimizer, readFromModelOptimizer, readFromModelOptimizer, readFromModelOptimizer, readFromModelOptimizer, setHalideScheduler, setHalideScheduler, setInput, setInput, setInput, setInput, setInput, setInput, setInput, setInput, setInput, setInputShape, setInputShape, setInputsNames, setParam, setPreferableBackend, setPreferableTargetaddress, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic Model(Pointer p)
Pointer.Pointer(Pointer).public Model(long size)
Pointer.position(long).public Model()
public Model(@opencv_core.Str BytePointer model, @opencv_core.Str BytePointer config)
model - [in] Binary file contains trained weights.config - [in] Text file contains network configuration.public Model(@opencv_core.Str BytePointer model)
public Model(@opencv_core.Str String model, @opencv_core.Str String config)
public Model(@opencv_core.Str String model)
@ByRef public Model setInputSize(@Const @ByRef Size size)
size - [in] New input size.
\note If shape of the new blob less than 0, then frame size not change.@ByRef public Model setInputSize(int width, int height)
width - [in] New input width.height - [in] New input height.
\note If shape of the new blob less than 0,
then frame size not change.@ByRef public Model setInputMean(@Const @ByRef Scalar mean)
mean - [in] Scalar with mean values which are subtracted from channels.@ByRef public Model setInputScale(double scale)
scale - [in] Multiplier for frame values.@ByRef public Model setInputCrop(@Cast(value="bool") boolean crop)
crop - [in] Flag which indicates whether image will be cropped after resize or not.@ByRef public Model setInputSwapRB(@Cast(value="bool") boolean swapRB)
swapRB - [in] Flag which indicates that swap first and last channels.public void setInputParams(double scale,
@Const @ByRef(nullValue="cv::Size()")
Size size,
@Const @ByRef(nullValue="cv::Scalar()")
Scalar mean,
@Cast(value="bool")
boolean swapRB,
@Cast(value="bool")
boolean crop)
size - [in] New input size.mean - [in] Scalar with mean values which are subtracted from channels.scale - [in] Multiplier for frame values.swapRB - [in] Flag which indicates that swap first and last channels.crop - [in] Flag which indicates whether image will be cropped after resize or not.
blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )public void setInputParams()
public void predict(@ByVal Mat frame, @ByVal MatVector outs)
frame - [in] The input image.outs - [out] Allocated output blobs, which will store results of the computation.public void predict(@ByVal Mat frame, @ByVal UMatVector outs)
public void predict(@ByVal Mat frame, @ByVal GpuMatVector outs)
public void predict(@ByVal UMat frame, @ByVal UMatVector outs)
public void predict(@ByVal UMat frame, @ByVal GpuMatVector outs)
public void predict(@ByVal GpuMat frame, @ByVal UMatVector outs)
public void predict(@ByVal GpuMat frame, @ByVal GpuMatVector outs)
Copyright © 2020. All rights reserved.