public class Model extends Net
| Modifier | Constructor and Description |
|---|---|
protected |
Model(long addr) |
|
Model(Net network)
Create model from deep learning network.
|
|
Model(String model)
Create model from deep learning network represented in one of the supported formats.
|
|
Model(String model,
String config)
Create model from deep learning network represented in one of the supported formats.
|
| Modifier and Type | Method and Description |
|---|---|
static Model |
__fromPtr__(long addr) |
protected void |
finalize() |
void |
predict(Mat frame,
List<Mat> outs)
Given the
input frame, create input blob, run net and return the output blobs. |
Model |
setInputCrop(boolean crop)
Set flag crop for frame.
|
Model |
setInputMean(Scalar mean)
Set mean value for frame.
|
void |
setInputParams()
Set preprocessing parameters for frame.
|
void |
setInputParams(double scale)
Set preprocessing parameters for frame.
|
void |
setInputParams(double scale,
Size size)
Set preprocessing parameters for frame.
|
void |
setInputParams(double scale,
Size size,
Scalar mean)
Set preprocessing parameters for frame.
|
void |
setInputParams(double scale,
Size size,
Scalar mean,
boolean swapRB)
Set preprocessing parameters for frame.
|
void |
setInputParams(double scale,
Size size,
Scalar mean,
boolean swapRB,
boolean crop)
Set preprocessing parameters for frame.
|
Model |
setInputScale(double scale)
Set scalefactor value for frame.
|
Model |
setInputSize(int width,
int height)
Set input size for frame.
|
Model |
setInputSize(Size size)
Set input size for frame.
|
Model |
setInputSwapRB(boolean swapRB)
Set flag swapRB for frame.
|
connect, dump, dumpToFile, empty, enableFusion, forward, forward, forward, forward, forward, getFLOPS, getFLOPS, getFLOPS, getFLOPS, getLayer, getLayerId, getLayerNames, getLayersCount, getLayerTypes, getMemoryConsumption, getMemoryConsumption, getMemoryConsumption, getNativeObjAddr, getParam, getParam, getPerfProfile, getUnconnectedOutLayers, getUnconnectedOutLayersNames, readFromModelOptimizer, setHalideScheduler, setInput, setInput, setInput, setInput, setInputsNames, setParam, setPreferableBackend, setPreferableTargetprotected Model(long addr)
public Model(Net network)
network - Net object.public Model(String model, String config)
model and config arguments does not matter.model - Binary file contains trained weights.config - Text file contains network configuration.public Model(String model)
model and config arguments does not matter.model - Binary file contains trained weights.public static Model __fromPtr__(long addr)
public Model setInputCrop(boolean crop)
crop - Flag which indicates whether image will be cropped after resize or not.public Model setInputMean(Scalar mean)
mean - Scalar with mean values which are subtracted from channels.public Model setInputScale(double scale)
scale - Multiplier for frame values.public Model setInputSize(Size size)
size - New input size.
Note: If shape of the new blob less than 0, then frame size not change.public Model setInputSize(int width, int height)
width - New input width.height - New input height.
Note: If shape of the new blob less than 0,
then frame size not change.public Model setInputSwapRB(boolean swapRB)
swapRB - Flag which indicates that swap first and last channels.public void predict(Mat frame, List<Mat> outs)
input frame, create input blob, run net and return the output blobs.outs - Allocated output blobs, which will store results of the computation.frame - automatically generatedpublic void setInputParams(double scale,
Size size,
Scalar mean,
boolean swapRB,
boolean crop)
size - New input size.mean - Scalar with mean values which are subtracted from channels.scale - Multiplier for frame values.swapRB - Flag which indicates that swap first and last channels.crop - 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(double scale,
Size size,
Scalar mean,
boolean swapRB)
size - New input size.mean - Scalar with mean values which are subtracted from channels.scale - Multiplier for frame values.swapRB - Flag which indicates that swap first and last channels.
blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )public void setInputParams(double scale,
Size size,
Scalar mean)
size - New input size.mean - Scalar with mean values which are subtracted from channels.scale - Multiplier for frame values.
blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )public void setInputParams(double scale,
Size size)
size - New input size.scale - Multiplier for frame values.
blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )public void setInputParams(double scale)
scale - Multiplier for frame values.
blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )public void setInputParams()
Generated on Wed Oct 9 2019 23:24:43 UTC / OpenCV 4.1.2