toybox-rs / Toybox

The Machine Learning Toybox for testing the behavior of autonomous agents.
http://toybox.rs
27 stars 12 forks source link

RGB observations not working #175

Closed Miffyli closed 3 years ago

Miffyli commented 3 years ago

If one sets alpha=False and grayscale=False, this correctly defines the observation space as having three channels (RGB). However the returned observations are four-channel RGBA. This seems to be a result of directly calling this function without further processing on the observation.

A simple fix would be to check if self._rgba == 3 and then drop the final channel with obs = obs[:, :, :-1]. I could make a PR for this if such solution is alright to you (not too inefficient).

PS: Cheers for a nice project! It is nice to have a chance to change these games at will with clear dictionary names/values :)

jjfiv commented 3 years ago

Hi @Miffyli, thanks for finding this.

We'd happily accept the PR you've described if you want to send it our way. I think slicing out the "a" components is probably going to be efficient enough ... they should all be 255, anyway.