code: def get_ssd_config(img_reshape, inference=False):
      ssd_config = OrderedDict()
      ssd_config["batch_size"] = 32
      ssd_config["shuffle_enable"] = True
      ssd_config["shuffle_manifest"] = True
      if inference:
          ssd_config["batch_size"] = 1
      ssd_config["block_size"] = 50
      ssd_config["cache_directory"] = get_data_cache_or_nothing(
          subdir="pascalvoc_cache"
      )
      ssd_config["etl"] = [
          {
              "type": "localization_ssd",
              "height": img_reshape[0],
              "width": img_reshape[1],
              "max_gt_boxes": 500,
              "class_names": [
                  "__background__",
                  "aeroplane",
                  "bicycle",
                  "bird",
                  "boat",
                  "bottle",
                  "bus",
                  "car",
                  "cat",
                  "chair",
                  "cow",
                  "diningtable",
                  "dog",
                  "horse",
                  "motorbike",
                  "person",
                  "pottedplant",
                  "sheep",
                  "sofa",
                  "train",
                  "tvmonitor",
              ],
          },
          {
              "type": "image",
              "height": img_reshape[0],
              "width": img_reshape[1],
              "channels": 3,
          },
      ]
      if not inference:
          ssd_config["augmentation"] = [
              {
                  "type": "image",
                  "crop_enable": False,
                  "flip_enable": True,
                  "expand_ratio": [1.0, 4.0],
                  "expand_probability": 0.5,
                  # "emit_constraint_type": "center", TODO: enable when adds support for no gt boxes
                  "brightness": [0.9, 1.1],
                  "hue": [-18, 18],
                  "saturation": [0.9, 1.1],
                  "contrast": [0.9, 1.1],
                  "batch_samplers": [
                      {"max_sample": 1, "max_trials": 1},
                      {
                          "max_sample": 1,
                          "max_trials": 50,
                          "sampler": {
                              "scale": [0.3, 1.0],
                              "aspect_ratio": [0.5, 2.0],
                          },
                          "sample_constraint": {
                              "min_jaccard_overlap": 0.1
                          },
                      },
                      {
                          "max_sample": 1,
                          "max_trials": 50,
                          "sampler": {
                              "scale": [0.3, 1.0],
                              "aspect_ratio": [0.5, 2.0],
                          },
                          "sample_constraint": {
                              "min_jaccard_overlap": 0.3
                          },
                      },
                      {
                          "max_sample": 1,
                          "max_trials": 50,
                          "sampler": {
                              "scale": [0.3, 1.0],
                              "aspect_ratio": [0.5, 2.0],
                          },
                          "sample_constraint": {
                              "min_jaccard_overlap": 0.5
                          },
                      },
                      {
                          "max_sample": 1,
                          "max_trials": 50,
                          "sampler": {
                              "scale": [0.3, 1.0],
                              "aspect_ratio": [0.5, 2.0],
                          },
                          "sample_constraint": {
                              "min_jaccard_overlap": 0.7
                          },
                      },
                      {
                          "max_sample": 1,
                          "max_trials": 50,
                          "sampler": {
                              "scale": [0.3, 1.0],
                              "aspect_ratio": [0.5, 2.0],
                          },
                          "sample_constraint": {
                              "min_jaccard_overlap": 0.9
                          },
                      },
                      {
                          "max_sample": 1,
                          "max_trials": 50,
                          "sampler": {
                              "scale": [0.3, 1.0],
                              "aspect_ratio": [0.5, 2.0],
                          },
                          "sample_constraint": {
                              "max_jaccard_overlap": 1.0,
                              "min_jaccard_overlap": 0.1,
                          },
                      },
                  ],
              }
          ]
  
      if img_reshape == (300, 300):
          ssd_config["ssd_config"] = OrderedDict(
              [
                  (
                      "conv4_3",
                      {
                          "min_sizes": 30.0,
                          "max_sizes": 60.0,
                          "aspect_ratios": 2.0,
                          "step": 8,
                          "normalize": True,
                      },
                  ),
                  (
                      "fc7",
                      {
                          "min_sizes": 60.0,
                          "max_sizes": 111.0,
                          "aspect_ratios": (2.0, 3.0),
                          "step": 16,
                      },
                  ),
                  (
                      "conv6_2",
                      {
                          "min_sizes": 111.0,
                          "max_sizes": 162.0,
                          "aspect_ratios": (2.0, 3.0),
                          "step": 32,
                      },
                  ),
                  (
                      "conv7_2",
                      {
                          "min_sizes": 162.0,
                          "max_sizes": 213.0,
                          "aspect_ratios": (2.0, 3.0),
                          "step": 64,
                      },
                  ),
                  (
                      "conv8_2",
                      {
                          "min_sizes": 213.0,
                          "max_sizes": 264.0,
                          "aspect_ratios": 2.0,
                          "step": 100,
                      },
                  ),
                  (
                      "conv9_2",
                      {
                          "min_sizes": 264.0,
                          "max_sizes": 315.0,
                          "aspect_ratios": 2.0,
                          "step": 300,
                      },
                  ),
              ]
          )
  
      elif img_reshape == (512, 512):
          ssd_config["ssd_config"] = OrderedDict(
              [
                  (
                      "conv4_3",
                      {
                          "min_sizes": 35.84,
                          "max_sizes": 76.80,
                          "aspect_ratios": 2.0,
                          "step": 8,
                          "normalize": True,
                      },
                  ),
                  (
                      "fc7",
                      {
                          "min_sizes": 76.80,
                          "max_sizes": 153.6,
                          "aspect_ratios": (2.0, 3.0),
                          "step": 16,
                      },
                  ),
                  (
                      "conv6_2",
                      {
                          "min_sizes": 153.6,
                          "max_sizes": 230.4,
                          "aspect_ratios": (2.0, 3.0),
                          "step": 32,
                      },
                  ),
                  (
                      "conv7_2",
                      {
                          "min_sizes": 230.4,
                          "max_sizes": 307.2,
                          "aspect_ratios": (2.0, 3.0),
                          "step": 64,
                      },
                  ),
                  (
                      "conv8_2",
                      {
                          "min_sizes": 307.2,
                          "max_sizes": 384.0,
                          "aspect_ratios": 2.0,
                          "step": 128,
                      },
                  ),
                  (
                      "conv9_2",
                      {
                          "min_sizes": 384.0,
                          "max_sizes": 460.8,
                          "aspect_ratios": 2.0,
                          "step": 256,
                      },
                  ),
                  (
                      "conv10_2",
                      {
                          "min_sizes": 460.8,
                          "max_sizes": 537.8,
                          "aspect_ratios": 2.0,
                          "step": 512,
                      },
                  ),
              ]
          )
      else:
          raise ValueError(
              "Image shape of {} not supported.".format(img_reshape)
          )
  
      return ssd_config
  
file_path: neon/examples/ssd/datasets/ingest_pascalvoc.py
imports: from argparse import ArgumentParser
  from convert_xml_to_json import convert_xml_to_json
  import numpy
  import os
  import tarfile
  import ingest_utils
  from collections import OrderedDict
  from tqdm import tqdm
  from neon.util.persist import get_data_cache_or_nothing
label_desc: Use image node_id 1 for calling a global function with example usage: get_ssd_config(img_reshape, inference) and returns: ssd_config