java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.GenericModelParser

public class GenericModelParser extends Object
Functions for saving and loading generic model metadata information. Note this does not load the model.
Author:
Jamie Macaulay
  • Field Details Link icon

  • Constructor Details Link icon

    • GenericModelParser Link icon

      public GenericModelParser()
  • Method Details Link icon

    • writeGenericModelParams Link icon

      public static boolean writeGenericModelParams(File file, GenericModelParams params)
      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 Link icon

      public static boolean writeJSONToFile(File file, String jsonString, boolean append)
      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 Link icon

      @Deprecated public static org.json.JSONObject getJSonParamsObject(GenericModelParams params)
      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 Link icon

      @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 Link icon

      public static GenericModelParams readGenericModelParams(File file, GenericModelParams params, DLClassNameManager classNameManager)
      Read the generic model paramters.
      Parameters:
      file - - the file.
      params -
      Returns:
    • parseJSONObject_legacy Link icon

      public static GenericModelParams parseJSONObject_legacy(org.json.JSONObject jsonObject, GenericModelParams paramsClone, DLClassNameManager classNameManager)
      Parse legacy JSON format.
      Parameters:
      jsonObject - - the JSONObject holding data
      paramsClone - - parameters object to set fields to to set.
      classNameManager - - the class names manager associated with the parameters.
      Returns:
      paramsClone with new settings.
    • parseJSONObject Link icon

      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 data
      paramsClone - - parameters object to set fields to to set.
      classNameManager - - the class names manager associated with the parameters.
      Returns:
      paramsClone with new settings.
    • parseJSONMetaData_legacy Link icon

      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 Link icon

      public static void main(String[] args)