miyosuda / unreal

Reinforcement learning with unsupervised auxiliary tasks
Other
416 stars 131 forks source link

Original RGB image from the lab simulator #23

Closed kkhetarpal closed 6 years ago

kkhetarpal commented 6 years ago

Hi @miyosuda , Could you please suggest where is the best place to obtain the raw RGB image/frame before it is changed to grayscale etc. ? I wish to preprocess the raw frames before they are used in the algorithm.

In trainer.py self.environment.last_state seems to be the processed image frame in grayscale and also new_state in new_state, reward, terminal, pixel_change = self.environment.process(action) seems to be returning the current image frame with image = self._get_current_image().

The following function then is the one I am not sure about, what is put_pixel's functionality here?

  def _get_current_image(self):
    image = np.array(self._maze_image)
    self._put_pixel(image, self.x, self.y, 1)
    return image

labenvironment.py on the other hand uses the following preprocessing:

  def _preprocess_frame(self, image):
    image = image.astype(np.float32)
    image = image / 255.0
    return image

Could you please suggest if my understanding is correct and also where exactly is the raw RGB image before resizing obtained in the maze environment? Really appreciate your inputs. thanks a lot.

kkhetarpal commented 6 years ago

Nvm, Sorted. Sorry for the spam of issues. Figured I was using lab environment but my editor navigating me to functions in the maze env. :/ Thanks for your code again.