Package qupath.opencv.dnn
Class OpenCVDnn.Builder
java.lang.Object
qupath.opencv.dnn.OpenCVDnn.Builder
- Enclosing class:
OpenCVDnn
Helper class to build an
OpenCVDnn
.-
Method Summary
Modifier and TypeMethodDescriptionbackend
(int backend) Specify the backend, e.g.build()
Build a newOpenCVDnn
.Set the model type to beOpenCVDnn.ModelType.CLASSIFICATION
.Path to config file (if required).Path to config file (if required).cpu()
Request CPU backend and target, if available.cuda()
Request CUDA backend and target, if available.cuda16()
Request CUDA backend and target, if available, with 16-bit floating point.Set the model type to beOpenCVDnn.ModelType.DETECTION
.Specify the framework (used to identify the appropriate loader for the model).Mean values which should be subtracted from the image channels before input to theNet
.modelType
(OpenCVDnn.ModelType type) Set the model type, used byOpenCVDnn.buildModel()
.User-friendly name to use with this model.opencl()
Specify OpenCL target.opencl16()
Specify OpenCL target with 16-bit floating point.Set the layer outputs.Set the layer outputs and shapes.scale
(double scale) Scale values, by which channels should be multiplied (after mean subtraction) before input to theNet
.Set the model type to beOpenCVDnn.ModelType.SEGMENTATION
.size
(int width, int height) Input width and height.Input width and height.target
(int target) Specify the target, e.g.
-
Method Details
-
framework
Specify the framework (used to identify the appropriate loader for the model).- Parameters:
name
-- Returns:
-
config
Path to config file (if required).- Parameters:
pathConfig
-- Returns:
-
config
Path to config file (if required).- Parameters:
pathConfig
-- Returns:
-
name
User-friendly name to use with this model.- Parameters:
name
-- Returns:
-
opencl
Specify OpenCL target. It probably won't help, but perhaps worth a try.- Returns:
-
opencl16
Specify OpenCL target with 16-bit floating point. It probably won't help, but perhaps worth a try.- Returns:
-
cuda
Request CUDA backend and target, if available.- Returns:
-
cpu
Request CPU backend and target, if available.- Returns:
-
cuda16
Request CUDA backend and target, if available, with 16-bit floating point.- Returns:
-
target
Specify the target, e.g.opencv_dnn.DNN_TARGET_CUDA
.- Parameters:
target
-- Returns:
- See Also:
-
backend
Specify the backend, e.g.opencv_dnn.DNN_BACKEND_CUDA
.- Parameters:
backend
-- Returns:
- See Also:
-
mean
Mean values which should be subtracted from the image channels before input to theNet
.- Parameters:
mean
-- Returns:
-
scale
Scale values, by which channels should be multiplied (after mean subtraction) before input to theNet
.- Parameters:
scale
-- Returns:
-
size
Input width and height.- Parameters:
width
-height
-- Returns:
-
size
Input width and height.- Parameters:
size
-- Returns:
-
modelType
Set the model type, used byOpenCVDnn.buildModel()
.- Parameters:
type
-- Returns:
-
classification
Set the model type to beOpenCVDnn.ModelType.CLASSIFICATION
.- Returns:
-
segmentation
Set the model type to beOpenCVDnn.ModelType.SEGMENTATION
.- Returns:
-
detection
Set the model type to beOpenCVDnn.ModelType.DETECTION
.- Returns:
-
outputs
Set the layer outputs. Usually this isn't necessary, but it provides a means to output features prior to any final classification.- Parameters:
layers
-- Returns:
-
outputs
Set the layer outputs and shapes. Usually this isn't necessary, but it provides a means to output features prior to any final classification.- Parameters:
outputs
-- Returns:
-
build
Build a newOpenCVDnn
.- Returns:
-