def _preprocess(self, obs):
#gray = cv2.cvtColor(obs, cv2.COLOR_RGB2GRAY)
# for breakout
#gray = cv2.cvtColor(obs, cv2.COLOR_RGB2GRAY)[34:210]
gray = cv2.cvtColor(obs, cv2.COLOR_RGB2GRAY)
resized_gray = cv2.resize(gray, (84, 84))
"""
cv2.namedWindow("window")
cv2.imshow("window", gray)
cv2.waitKey(0)
cv2.destroyAllWindows()
"""
del obs, gray
return (resized_gray - 127.5) / 127.5
评论列表
文章目录