@Namespace(value="cv::dnn") @NoOffset @Properties(inherit=opencv_dnn.class) public class Model extends Pointer
Modifier and Type | Class and Description |
---|---|
static class |
Model.Impl |
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
Model()
Deprecated.
|
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(Model arg0) |
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 |
---|---|
Net |
asNet()
Deprecated.
|
Model |
enableWinograd(boolean useWinograd) |
Model.Impl |
getImpl() |
Model.Impl |
getImplRef() |
Net |
getNetwork_() |
Model |
getPointer(long i) |
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 |
put(Model arg0) |
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(Scalar scale)
\brief Set scalefactor value for frame.
|
Model |
setInputSize(int width,
int height)
\overload
|
Model |
setInputSize(Size size)
\brief Set input size for frame.
|
Model |
setInputSwapRB(boolean swapRB)
\brief Set flag swapRB for frame.
|
Model |
setOutputNames(StringVector outNames)
\brief Set output names for frame.
|
Model |
setPreferableBackend(int backendId) |
Model |
setPreferableTarget(int targetId) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public Model(Pointer p)
Pointer(Pointer)
.public Model(long size)
Pointer.position(long)
.@Deprecated 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)
public Model getPointer(long i)
getPointer
in class Pointer
@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.@ByRef public Model setInputMean(@Const @ByRef Scalar mean)
mean
- [in] Scalar with mean values which are subtracted from channels.@ByRef public Model setInputScale(@Const @ByRef Scalar 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.@ByRef public Model setOutputNames(@Const @ByRef StringVector outNames)
outNames
- [in] Names for output layers.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)
@ByRef public Model setPreferableBackend(@Cast(value="cv::dnn::Backend") int backendId)
Net::setPreferableBackend
@ByRef public Model setPreferableTarget(@Cast(value="cv::dnn::Target") int targetId)
Net::setPreferableTarget
@ByRef public Model enableWinograd(@Cast(value="bool") boolean useWinograd)
Net::enableWinograd
@Deprecated @ByRef @Name(value="operator cv::dnn::Net&") public Net asNet()
public Model.Impl getImpl()
@ByRef public Model.Impl getImplRef()
Copyright © 2025. All rights reserved.