MCPcopy Create free account
hub / github.com/brendanator/atari-rl / process_frame

Method process_frame

atari/atari.py:71–82  ·  view source on GitHub ↗
(self, last_frame, current_frame)

Source from the content-addressed store, hash-verified

69 return self.frames[-self.input_frames:], reward, done
70
71 def process_frame(self, last_frame, current_frame):
72 # Max last 2 frames to remove flicker
73 # TODO Use ALE color_averaging instead (current causes core dump)
74 frame = np.maximum(last_frame, current_frame)
75
76 # Rescale image
77 frame = cv2.resize(frame, self.input_shape)
78
79 # Convert to greyscale
80 frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
81
82 return frame
83
84 def log_episode(self, step):
85 duration = time.time() - self.start_time

Callers 2

resetMethod · 0.95
stepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected