Package qupath.opencv.dnn
Class DnnModels
java.lang.Object
qupath.opencv.dnn.DnnModels
Helper class for building new DnnModels.
This includes a ServiceLoader
to support adding new implementations
via extensions.
- Since:
- v0.4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DnnModel
buildModel
(DnnModelParams params) Build aDnnModel
from the given parameters.static boolean
registerBuilder
(DnnModelBuilder builder) Register a newDnnModelBuilder
.static <T extends DnnModel>
voidregisterDnnModel
(Class<T> subtype, String name) Register a newDnnModel
class for JSON serialization/deserialization.
-
Constructor Details
-
DnnModels
public DnnModels()
-
-
Method Details
-
registerDnnModel
Register a newDnnModel
class for JSON serialization/deserialization.- Type Parameters:
T
-- Parameters:
subtype
-name
-
-
registerBuilder
Register a newDnnModelBuilder
.- Parameters:
builder
-- Returns:
- Implementation Note
- This may be removed in the future. It exists currently to deal with
the fact that the
ServiceLoader
used to identify builders may not see those that are added via extensions.
-
buildModel
Build aDnnModel
from the given parameters. This queries all available DnnModelBuilders through a service loader.- Parameters:
params
-- Returns:
- a new DnnModel, or null if no model could be built
-