utay / dino-ml

🦎 Simple AI to teach Google Chrome's offline dino to jump obstacles
48 stars 23 forks source link

Image index out of range #3

Closed rajeshmajumdar closed 6 years ago

rajeshmajumdar commented 6 years ago

Traceback (most recent call last): File "ai.py", line 17, in main() File "ai.py", line 8, in main generation.execute() File "dino-ml/generation.py", line 25, in execute obs = scanner.find_next_obstacle() File "dino-ml/scanner.py", line 54, in find_next_obstacle dist = self.next_obstacle_dist(image) File "dino-ml/scanner.py", line 73, in next_obstacle_dist color = image.getpixel((x, y)) File "/usr/local/lib/python3.6/site-packages/PIL/Image.py", line 1282, in getpixel return self.im.getpixel(xy) IndexError: image index out of range

utay commented 6 years ago

As mentioned in the README, the x/y screen values were hard coded for my macbook laptop. Your screen hasn't the same size and you have to change those values in the code before launching the AI.