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

  • Constructor Details

    • GenericModelParser

      public GenericModelParser()
  • Method Details

    • writeGenericModelParams

      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

      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

      @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

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

      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

      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

      public static void main(String[] args)