multicnet.py
def preprocess_percepts(self, x_t1_colored, reshape = True):
        """
        The raw image arrays get shrunk down and
        remove any color whatsoever. Also gets it in
        3 dimensions if needed
        """
        x_t1_resized = cv2.resize(x_t1_colored, (self.input_width, self.input_height))
        x_t1_greyscale = cv2.cvtColor(x_t1_resized, cv2.COLOR_BGR2GRAY)
        ret, x_t1 = cv2.threshold(x_t1_greyscale, 1, 255, cv2.THRESH_BINARY)
        """
        import time
        timestamp = int(time.time())
        cv2.imwrite("percepts/%d-color.png" % timestamp,
                    np.rot90(x_t1_colored))
        cv2.imwrite("percepts/%d-resized.png" % timestamp,
                    np.rot90(x_t1_resized))
        cv2.imwrite("percepts/%d-greyscale.png" % timestamp,
                    np.rot90(x_t1_greyscale))
        cv2.imwrite("percepts/%d-bandw.png" % timestamp,
                    np.rot90(x_t1))
        """
        if not reshape:
            return x_t1
        return np.reshape(x_t1, (80, 80, 1))

        The raw image arrays get shrunk down and
        remove any color whatsoever. Also gets it in
        3 dimensions if needed
        
The raw image arrays get shrunk down and
remove any color whatsoever. Also gets it in
3 dimensions if needed
The raw image arrays get shrunk down and remove any color whatsoever . Also gets it in 3 dimensions if needed
def preprocess_percepts(self, x_t1_colored, reshape = True):
        x_t1_resized = cv2.resize(x_t1_colored, (self.input_width, self.input_height))
        x_t1_greyscale = cv2.cvtColor(x_t1_resized, cv2.COLOR_BGR2GRAY)
        ret, x_t1 = cv2.threshold(x_t1_greyscale, 1, 255, cv2.THRESH_BINARY)
        if not reshape:
            return x_t1
        return np.reshape(x_t1, (80, 80, 1))
def preprocess_percepts ( self , x_t1_colored , reshape = True ) : x_t1_resized = cv2 . resize ( x_t1_colored , ( self . input_width , self . input_height ) ) x_t1_greyscale = cv2 . cvtColor ( x_t1_resized , cv2 . COLOR_BGR2GRAY ) ret , x_t1 = cv2 . threshold ( x_t1_greyscale , 1 , 255 , cv2 . THRESH_BINARY ) """
        import time
        timestamp = int(time.time())
        cv2.imwrite("percepts/%d-color.png" % timestamp,
                    np.rot90(x_t1_colored))
        cv2.imwrite("percepts/%d-resized.png" % timestamp,
                    np.rot90(x_t1_resized))
        cv2.imwrite("percepts/%d-greyscale.png" % timestamp,
                    np.rot90(x_t1_greyscale))
        cv2.imwrite("percepts/%d-bandw.png" % timestamp,
                    np.rot90(x_t1))
        """ if not reshape : return x_t1 return np . reshape ( x_t1 , ( 80 , 80 , 1 ) )
The raw image arrays get shrunk down and
remove any color whatsoever.
The raw image arrays get shrunk down and remove any color whatsoever .
"""
        The raw image arrays get shrunk down and
        remove any color whatsoever. Also gets it in
        3 dimensions if needed
        """ """
        import time
        timestamp = int(time.time())
        cv2.imwrite("percepts/%d-color.png" % timestamp,
                    np.rot90(x_t1_colored))
        cv2.imwrite("percepts/%d-resized.png" % timestamp,
                    np.rot90(x_t1_resized))
        cv2.imwrite("percepts/%d-greyscale.png" % timestamp,
                    np.rot90(x_t1_greyscale))
        cv2.imwrite("percepts/%d-bandw.png" % timestamp,
                    np.rot90(x_t1))
        """
self
x_t1_colored
reshape