code: def preprocess(image):
      """预处理 210x160x3 uint8 frame into 6400 (80x80) 1维 float vector"""
      image = image[35:195]  # 裁剪
      image = image[::2, ::2, 0]  # 下采样，缩放2倍
      image[image == 144] = 0  # 擦除背景 (background type 1)
      image[image == 109] = 0  # 擦除背景 (background type 2)
      image[image != 0] = 1  # 转为灰度图，除了黑色外其他都是白色
      return image.astype(np.float).ravel()
  
file_path: PARL/examples/tutorials/parl2_dygraph/lesson4/homework/policy_gradient_pong/train.py
imports: import gym
  import parl
  import paddle
  import os
  import gym
  import numpy
  import parl
  from agent import Agent
  from model import Model
  from parl.algorithms import PolicyGradient
  from parl.utils import logger
label_desc: Use image node_id 3 for calling a global function with example usage: preprocess(image) and returns: image