Class GenericModelParser
java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.GenericModelParser
Functions for saving and loading generic model metadata information. Note this
does not load the model.
- Author:
- Jamie Macaulay
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.json.JSONObject
Deprecated.static org.json.JSONObject
getJSonParamsObject
(GenericModelParams params, org.json.JSONObject paramsObject) Deprecated.static void
static GenericModelParams
parseJSONMetaData_legacy
(org.json.JSONObject jsonObject, GenericModelParams paramsClone, DLClassNameManager classNameManager) Set new parameters in a GenericModelParams object.static GenericModelParams
parseJSONObject
(org.json.JSONObject jsonObject, GenericModelParams paramsClone, DLClassNameManager classNameManager) Parse JSON data containing transforms and model metadata.static GenericModelParams
parseJSONObject_legacy
(org.json.JSONObject jsonObject, GenericModelParams paramsClone, DLClassNameManager classNameManager) Parse legacy JSON format.static GenericModelParams
readGenericModelParams
(File file, GenericModelParams params, DLClassNameManager classNameManager) Read the generic model paramters.static boolean
writeGenericModelParams
(File file, GenericModelParams params) Write the generic model parameters to a file.static boolean
writeJSONToFile
(File file, String jsonString, boolean append) Write a JSON string to a JSON file.
-
Field Details
-
CLASS_STRING
- See Also:
-
SEG_SIZE_STRING
- See Also:
-
MODEL_INFO_STRING
- See Also:
-
-
Constructor Details
-
GenericModelParser
public GenericModelParser()
-
-
Method Details
-
writeGenericModelParams
Write the generic model parameters to a file.- Parameters:
file
- - the file to write to.params
- - the parameters to write.- Returns:
- true if the write was successful
-
writeJSONToFile
Write a JSON string to a JSON file.- Parameters:
file
- - the file to write to.jsonString
- - the jsonString.append
- - append to the file.- Returns:
- true if the file writing was successful.
-
getJSonParamsObject
Deprecated.Get the JSON parameters object. This contains all parameters from generic parameters except the transform parameters. The transform parameters are written on a different line.- Parameters:
params
- - the parameters object.- Returns:
- the JSONObject.
-
getJSonParamsObject
@Deprecated public static org.json.JSONObject getJSonParamsObject(GenericModelParams params, org.json.JSONObject paramsObject) Deprecated.Get the JSON parameters object. This contains all parameters from generic parameters except the transform parameters. The transform parameters are written on a different line.- Parameters:
params
- - the parameters object.paramsobject
- - jsonObject to add params to.- Returns:
- the JSONObject.
-
readGenericModelParams
public static GenericModelParams readGenericModelParams(File file, GenericModelParams params, DLClassNameManager classNameManager) Read the generic model paramters.- Parameters:
file
- - the file.params
-- Returns:
-
parseJSONObject_legacy
public static GenericModelParams parseJSONObject_legacy(org.json.JSONObject jsonObject, GenericModelParams paramsClone, DLClassNameManager classNameManager) Parse legacy JSON format.- Parameters:
jsonObject
- - the JSONObject holding dataparamsClone
- - parameters object to set fields to to set.classNameManager
- - the class names manager associated with the parameters.- Returns:
- paramsClone with new settings.
-
parseJSONObject
public static GenericModelParams parseJSONObject(org.json.JSONObject jsonObject, GenericModelParams paramsClone, DLClassNameManager classNameManager) Parse JSON data containing transforms and model metadata.- Parameters:
jsonObject
- - the JSONObject holding dataparamsClone
- - parameters object to set fields to to set.classNameManager
- - the class names manager associated with the parameters.- Returns:
- paramsClone with new settings.
-
parseJSONMetaData_legacy
public static GenericModelParams parseJSONMetaData_legacy(org.json.JSONObject jsonObject, GenericModelParams paramsClone, DLClassNameManager classNameManager) Set new parameters in a GenericModelParams object.- Parameters:
jsonParamsString
- - the json parameters string.params
- - the parameters.- Returns:
- the parameters class with new settings set.
-
main
-