Modified preprocessing

This commit is contained in:
Brandon Rozek 2019-11-02 10:25:47 -04:00
parent 18ad080026
commit 59d53b5c8a
2 changed files with 3 additions and 4 deletions

View file

@ -67,4 +67,4 @@ class Environment:
content = pickle.loads(r.content)
return content['state'], content['reward'], content['done'], content['info']
# env = Environment("127.0.0.1", 5000)
env = Environment("127.0.0.1", 5000)

View file

@ -4,6 +4,7 @@ from flask import Flask
from flask import request
import pickle
import json
import numpy as np
# Make it so that it doesn't log every HTTP request
import logging
@ -53,9 +54,7 @@ class PongEnv(Environment):
frame = frame[34:194, 15:145] # Crops to shape (160, 130)
# Downsample
frame = cv2.resize(frame, (80, 80), interpolation=cv2.INTER_AREA)
# Normalize
frame = frame / 255
return frame
return frame.astype(np.uint8)