class_docstr: This is the Classification Model training class, that allows you to define a deep learning network
  from the 4 available networks types supported by ImageAI which are MobileNetv2, ResNet50,
  InceptionV3 and DenseNet121.
class_docstr_tok: ["This","is","the","Classification","Model","training","class",",","that","allows","you","to","define","a","deep","learning","network","from","the","4","available","networks","types","supported","by","ImageAI","which","are","MobileNetv2",",","ResNet50",",","InceptionV3","and","DenseNet121","."]
docstr: 'setDataDirectory()'
  
  - data_directory , is required to set the path to which the data/dataset to be used for
           training is kept. The directory can have any name, but it must have 'train' and 'test'
           sub-directory. In the 'train' and 'test' sub-directories, there must be sub-directories
           with each having it's name corresponds to the name/label of the object whose images are
          to be kept. The structure of the 'test' and 'train' folder must be as follows:
  
          >> train >> class1 >> class1_train_images
                   >> class2 >> class2_train_images
                   >> class3 >> class3_train_images
                   >> class4 >> class4_train_images
                   >> class5 >> class5_train_images
  
          >> test >> class1 >> class1_test_images
                  >> class2 >> class2_test_images
                  >> class3 >> class3_test_images
                  >> class4 >> class4_test_images
                  >> class5 >> class5_test_images
  
  - train_subdirectory (optional), subdirectory within 'data_directory' where the training set is. Defaults to 'train'.
  - test_subdirectory (optional), subdirectory within 'data_directory' where the testing set is. Defaults to 'test'.
  - models_subdirectory (optional), subdirectory within 'data_directory' where the output models will be saved. Defaults to 'models'.
  - json_subdirectory (optional), subdirectory within 'data_directory' where the model classes json file will be saved. Defaults to 'json'.
  
  :param data_directory:
  :param train_subdirectory:
  :param test_subdirectory:
  :param models_subdirectory:
  :param json_subdirectory:
  :return:
docstr_tok: ["'setDataDirectory","(",")","'","-","data_directory",",","is","required","to","set","the","path","to","which","the","data\/dataset","to","be","used","for","training","is","kept",".","The","directory","can","have","any","name",",","but","it","must","have","'train","'","and","'test'","sub-directory",".","In","the","'train","'","and","'test","'","sub-directories",",","there","must","be","sub-directories","with","each","having","it","'s","name","corresponds","to","the","name\/label","of","the","object","whose","images","are","to","be","kept",".","The","structure","of","the","'test","'","and","'train","'","folder","must","be","as","follows",":",">",">","train",">",">","class1",">",">","class1_train_images",">",">","class2",">",">","class2_train_images",">",">","class3",">",">","class3_train_images",">",">","class4",">",">","class4_train_images",">",">","class5",">",">","class5_train_images",">",">","test",">",">","class1",">",">","class1_test_images",">",">","class2",">",">","class2_test_images",">",">","class3",">",">","class3_test_images",">",">","class4",">",">","class4_test_images",">",">","class5",">",">","class5_test_images","-","train_subdirectory","(","optional",")",",","subdirectory","within","'data_directory","'","where","the","training","set","is",".","Defaults","to","'train","'",".","-","test_subdirectory","(","optional",")",",","subdirectory","within","'data_directory","'","where","the","testing","set","is",".","Defaults","to","'test","'",".","-","models_subdirectory","(","optional",")",",","subdirectory","within","'data_directory","'","where","the","output","models","will","be","saved",".","Defaults","to","'models","'",".","-","json_subdirectory","(","optional",")",",","subdirectory","within","'data_directory","'","where","the","model","classes","json","file","will","be","saved",".","Defaults","to","'json","'",".",":","param","data_directory",":",":","param","train_subdirectory",":",":","param","test_subdirectory",":",":","param","models_subdirectory",":",":","param","json_subdirectory",":",":","return",":"]
code: def setDataDirectory(
      self,
      data_directory="",
      train_subdirectory="train",
      test_subdirectory="test",
      models_subdirectory="models",
      json_subdirectory="json",
  ):
      """
      'setDataDirectory()'
  
      - data_directory , is required to set the path to which the data/dataset to be used for
               training is kept. The directory can have any name, but it must have 'train' and 'test'
               sub-directory. In the 'train' and 'test' sub-directories, there must be sub-directories
               with each having it's name corresponds to the name/label of the object whose images are
              to be kept. The structure of the 'test' and 'train' folder must be as follows:
  
              >> train >> class1 >> class1_train_images
                       >> class2 >> class2_train_images
                       >> class3 >> class3_train_images
                       >> class4 >> class4_train_images
                       >> class5 >> class5_train_images
  
              >> test >> class1 >> class1_test_images
                      >> class2 >> class2_test_images
                      >> class3 >> class3_test_images
                      >> class4 >> class4_test_images
                      >> class5 >> class5_test_images
  
      - train_subdirectory (optional), subdirectory within 'data_directory' where the training set is. Defaults to 'train'.
      - test_subdirectory (optional), subdirectory within 'data_directory' where the testing set is. Defaults to 'test'.
      - models_subdirectory (optional), subdirectory within 'data_directory' where the output models will be saved. Defaults to 'models'.
      - json_subdirectory (optional), subdirectory within 'data_directory' where the model classes json file will be saved. Defaults to 'json'.
  
      :param data_directory:
      :param train_subdirectory:
      :param test_subdirectory:
      :param models_subdirectory:
      :param json_subdirectory:
      :return:
      """
  
      self.__data_dir = data_directory
  
      self.__train_dir = os.path.join(
          self.__data_dir, train_subdirectory
      )
      self.__test_dir = os.path.join(self.__data_dir, test_subdirectory)
      self.__trained_model_dir = os.path.join(
          self.__data_dir, models_subdirectory
      )
      self.__model_class_dir = os.path.join(
          self.__data_dir, json_subdirectory
      )
      self.__logs_dir = os.path.join(self.__data_dir, "logs")
  
imports: import tensorflow
  from PIL import Image
  import time
  import numpy
  import os
  import warnings
  from matplotlib.cbook import deprecated
  import json
label_desc: Use image node_id 9 for calling the ClassificationModelTrainer obj's underlying member method code with example usage: obj.setDataDirectory(data_directory, train_subdirectory, test_subdirectory, models_subdirectory, json_subdirectory) without return types