text: # Internal Imports
  import configs
  from configs import configure, parse_args, print_args
  from SGAN.discriminator import create_discriminator_models
  from SGAN.gan import create_gan_model
  from SGAN.generator import create_generator_model
  from SGAN.train import start_training_SGAN
  from Utils.datasets import get_plant_diseases_dataset, normalize_image
  
  
  parse_args()
  print_args()
  
  
  # Configuring TensorFlow
  configure(enable_mixed_float16=False,
            print_device_placement=False,
            enable_eager_execution=configs.eager_execution)
  
  
  # Create the datasets
  unsupervised_ds, supervised_ds, test_ds = get_plant_diseases_dataset(configs.batch_size, configs.supervised_samples_ratio)
  input_shape = unsupervised_ds.element_spec[0].shape[1:]
  no_of_classes = len(unsupervised_ds.class_names)
  
  # Adding preprocessing to input pipeline
  unsupervised_ds = unsupervised_ds.map(normalize_image,
                                        num_parallel_calls=configs.cpu_no)
  supervised_ds = supervised_ds.map(normalize_image,
                                    num_parallel_calls=configs.cpu_no)
  test_ds = test_ds.map(normalize_image,
                        num_parallel_calls=configs.cpu_no)
  
  with configs.strategy.scope():
      generator_model = create_generator_model(configs.latent_dim)
      discriminator_model, classifier_model = create_discriminator_models(input_shape, no_of_classes)
      gan_model = create_gan_model(generator_model, discriminator_model)
  
      start_training_SGAN(generator=generator_model,
                          discriminator=discriminator_model,
                          classifier=classifier_model,
                          gan=gan_model,
                          batch_size=configs.batch_size,
                          unsupervised_ds=unsupervised_ds,
                          supervised_ds=supervised_ds,
                          test_ds=test_ds,
                          epochs=configs.epochs,
                          latent_dim=configs.latent_dim,
                          supervised_batches_per_iteration=configs.super_batches,
                          unsupervised_batches_per_iteration=configs.unsuper_batches,
                          save_interval=configs.save_interval)
  