code: def hook_outputs(modules, detach=True, grad=False):
      "Return `Hooks` that store activations of all `modules` in `self.stored`"
      return Hooks(
          modules, _hook_inner, detach=detach, is_forward=not grad
      )
  
imports: import base64
  import os
  import sys
  import cv2
  import numpy
  import paddle
  import paddle.nn
  from PIL import Image
label_desc: Use image node_id 6 for calling a global function with example usage: hook_outputs(modules, detach, grad) and returns: Hooks