4 ms·
Show HN: I've trained my neural network to play Tinder
The video is here: https://www.youtube.com/watch?v=Ohs6sgmVNYI
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't expose real people) and began the training.
For this experiment I'm using scrcpy to control my cellphone and pyautogui alongside my neural network. The script is very simple:
Get the image, run it trough a neural network, move the mouse to the output (yes or no) and click.
There's a lot of hard coded things in my code, but as I said earlier, it is just a prof of concept.
The code is pretty much garbage, but here's it if anyone care to look:
import json
from PIL import Image, ImageChops
import numpy as np
from Dejavu import Dejavu #this is my neural network (soon on GitHub)
import pyautogui
import time
data = json.loads( open('nn.json','r').read() )
nn = Dejavu()
nn.load(data)
choices = { 0: (900,565), 1: (1055,565) }
pyautogui.moveTo(850, 210)
pyautogui.click()
# I know there's only 6 pictures on my fake tinder app
for i in range(7):
img = pyautogui.screenshot().convert('L')
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='constant')
result = nn.predict( arr.tolist() )[0].tolist()
result = result.index( max(result) )
pyautogui.moveTo( choices[result] )
pyautogui.click()
if i < 6:
time.sleep(3)
- atum47 7y agoHere's the fake tinder app: https://victorribeiro.com/faketinder/ https://victorribeiro.com/faketinder/
- atum47 7y agothe 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
- spokyy 7y agoFunny!
- atum47 7y agoThanks!
- atum47 7y agofriendly 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