class_docstr: This is the Detection Model training class, which allows you to train object detection models
  on image datasets that are in YOLO format, using the YOLOv3.
docstr: 'setTrainConfig()' function allows you to set the properties for the training instances. It accepts the following values:
  - object_names_array , this is an array of the names of the different objects in your dataset, in the index order your dataset is annotated
  - batch_size (optional),  this is the batch size for the training instance
  - num_experiments (optional),   also known as epochs, it is the number of times the network will train on all the training dataset
  - train_from_pretrained_model (optional), this is used to perform transfer learning by specifying the path to a pre-trained YOLOv3 or TinyYOLOv3 model
  :param object_names_array:
  :param batch_size:
  :param num_experiments:
  :param train_from_pretrained_model:
  :return:
docstr_tok: ["'setTrainConfig","(",")","'","function","allows","you","to","set","the","properties","for","the","training","instances",".","It","accepts","the","following","values",":","-","object_names_array",",","this","is","an","array","of","the","names","of","the","different","objects","in","your","dataset",",","in","the","index","order","your","dataset","is","annotated","-","batch_size","(","optional",")",",","this","is","the","batch","size","for","the","training","instance","-","num_experiments","(","optional",")",",","also","known","as","epochs",",","it","is","the","number","of","times","the","network","will","train","on","all","the","training","dataset","-","train_from_pretrained_model","(","optional",")",",","this","is","used","to","perform","transfer","learning","by","specifying","the","path","to","a","pre-trained","YOLOv3","or","TinyYOLOv3","model",":","param","object_names_array",":",":","param","batch_size",":",":","param","num_experiments",":",":","param","train_from_pretrained_model",":",":","return",":"]
code: def setTrainConfig(
      self,
      object_names_array: List[str],
      batch_size: int = 4,
      num_experiments=100,
      train_from_pretrained_model: str = None,
  ):
      """
      'setTrainConfig()' function allows you to set the properties for the training instances. It accepts the following values:
      - object_names_array , this is an array of the names of the different objects in your dataset, in the index order your dataset is annotated
      - batch_size (optional),  this is the batch size for the training instance
      - num_experiments (optional),   also known as epochs, it is the number of times the network will train on all the training dataset
      - train_from_pretrained_model (optional), this is used to perform transfer learning by specifying the path to a pre-trained YOLOv3 or TinyYOLOv3 model
      :param object_names_array:
      :param batch_size:
      :param num_experiments:
      :param train_from_pretrained_model:
      :return:
      """
      self.__model_path = train_from_pretrained_model
      if self.__model_path:
          extension_check(self.__model_path)
      self.__classes = object_names_array
      self.__mini_batch_size = batch_size
      self.__epochs = num_experiments
      self.__output_models_dir = os.path.join(self.__data_dir, "models")
      self.__output_json_dir = os.path.join(self.__data_dir, "json")
  
imports: import os
  import time
  import math
  import json
  import warnings
  from typing import List, Union, Tuple, Dict
  from collections import defaultdict
  import numpy
  from PIL import Image
  import cv2
  import torch
  from torch.cuda import amp
  from torch.utils.data import DataLoader
  from torch.optim import SGD, lr_scheduler
  from tqdm import tqdm
  from .yolo.dataset import LoadImagesAndLabels
  from .yolo.custom_anchors import generate_anchors
  from .yolo.compute_loss import compute_loss
  from .yolo import validate
  from ...yolov3.tiny_yolov3 import YoloV3Tiny
  from ...yolov3.yolov3 import YoloV3
  from ...yolov3.utils import draw_bbox_and_label, get_predictions, prepare_image
  from ...backend_check.model_extension import extension_check
label_desc: Use image node_id 8 for calling the DetectionModelTrainer obj's underlying member method code with example usage: obj.setTrainConfig(object_names_array, batch_size, num_experiments, train_from_pretrained_model) without return types