
Show HN: I've trained my neural network to play Tinder - atum47
The video is here: https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Ohs6sgmVNYI<p>This video is a prof of concept. I always wanted to see if I could make my Neural Network play tinder for me. So I gather some pictures, created a fake tinder app (so I don&#x27;t expose real people) and began the training.<p>For this experiment I&#x27;m using <i>scrcpy</i> to control my cellphone and <i>pyautogui</i> alongside my neural network. The script is very simple:<p>Get the image, run it trough a neural network, move the mouse to the output (yes or no) and click.<p>There&#x27;s a lot of hard coded things in my code, but as I said earlier, it is just a prof of concept.<p>The code is pretty much garbage, but here&#x27;s it if anyone care to look:<p>import json<p>from PIL import Image, ImageChops<p>import numpy as np<p>from Dejavu import Dejavu #this is my neural network (soon on GitHub)<p>import pyautogui<p>import time<p>data = json.loads( open(&#x27;nn.json&#x27;,&#x27;r&#x27;).read() )<p>nn = Dejavu()<p>nn.load(data)<p>choices = { 0: (900,565), 1: (1055,565) }<p>pyautogui.moveTo(850, 210)
 pyautogui.click()<p><pre><code>        # I know there&#x27;s only 6 pictures on my fake tinder app
 for i in range(7):

  img = pyautogui.screenshot().convert(&#x27;L&#x27;)

  img = img.crop( (810,210, 1150, 500) )

  img.thumbnail( (36,36) )

  arr = np.array(img).reshape(-1)

  arr = np.pad(arr, (0,36*36-arr.shape[0]), mode=&#x27;constant&#x27;)

  result =  nn.predict( arr.tolist() )[0].tolist()

  result = result.index( max(result) ) 

  pyautogui.moveTo( choices[result] )

  pyautogui.click()
 
  if i &lt; 6:
   time.sleep(3)</code></pre>
======
atum47
Here's the fake tinder app:

[https://victorribeiro.com/faketinder/](https://victorribeiro.com/faketinder/)

------
atum47
the neural network I'm using is the same I used in this project:

[https://github.com/victorqribeiro/digitRecognition](https://github.com/victorqribeiro/digitRecognition)

I'm planning on realising it soon

------
atum47
friendly reminder that my script would work with pictures of guys too, in case
any girl wanted.

you just have to create two folders: one with pictures of people that you
consider attractive and one with pictures of people you don't

------
spokyy
Funny!

~~~
atum47
Thanks!

