docstr: See section 5.3
          
docstr_tok: ["See","section","5.3"]
code: def __init__(self, ds, index=0):
      """See section 5.3"""
  
      def func(img):
          try:
              h, w, _ = img.shape
              if h > w:
                  off = (h - w) // 2
                  if off > 0:
                      img = img[off:-off, :, :]
              if w > h:
                  off = (w - h) // 2
                  if off > 0:
                      img = img[:, off:-off, :]
  
              img = cv2.resize(img, (256, 256))
              return img
          except Exception:
              return None
  
      super(CenterSquareResize, self).__init__(ds, func, index=index)
  
imports: import argparse
  import numpy
  import os
  import zipfile
  import cv2
  from tensorpack import LMDBSerializer, MapDataComponent, RNGDataFlow
label_desc: Use image node_id 1 to create a new CenterSquareResize object from inherited base classes: MapDataComponent with example: obj = CenterSquareResize(ds, index)