class_docstr: PicReader
class_docstr_tok: ["PicReader"]
docstr: Args:
      directory:
  
  Returns:
docstr_tok: ["Args",":","directory",":","Returns",":"]
code: def _load_image(self, directory: str) -> np.ndarray:
      """
  
      Args:
          directory:
  
      Returns:
  
      """
  
      if not self.cache_img:
          img = cv2.imread(directory, cv2.IMREAD_COLOR).astype(
              "float32"
          )
          img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
          # img = Image.open(directory).convert('RGB')
      else:
          if directory in self.cache_img_buff:
              img = self.cache_img_buff[directory]
          else:
              img = cv2.imread(directory, cv2.IMREAD_COLOR).astype(
                  "float32"
              )
              img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
  
              # img = Image.open(directory).convert('RGB')
      return img
  
imports: import re
  import numpy
  from typing import Dict, List, Optional, Union, Tuple
  import six
  import cv2
  import os
  import paddle
  import paddlehub.vision.transforms
  from PIL import ImageFile
  from auto_augment.autoaug.transform.autoaug_transform import AutoAugTransform
label_desc: Use image node_id 3 for calling the PicReader obj's underlying member method code with example usage: obj._load_image(directory) and returns: img