Skip to main content

Show HN: I've trained my neural network to play Tinder https://ift.tt/2YAXszE

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) August 8, 2019 at 03:36PM

Comments

Popular posts from this blog

Launch HN: Simmer (YC W19) – Reviews for Delivery Dishes https://ift.tt/2Y4sD67

Launch HN: Simmer (YC W19) – Reviews for Delivery Dishes Hi HackerNews community! We’re Vaibhav and Richard, founders of Simmer ( https://usesimmer.com ). Simmer aggregates dishes from DoorDash, Caviar, GrubHub, and basically every other delivery platform out there, and tells users the best dishes across the board. We do this by providing dish-level reviews. Users find highly reviewed dishes on Simmer, choose the delivery platform of their liking, and we deep link them into their chosen delivery app. We essentially lead gen to delivery. We started working on Simmer because we loved trying new restaurants, but never knew what to order. Especially, when there’s a 5 page menu. We always asked ourselves, “Why aren’t there ratings for individual dishes?” We launched our app with this restaurant-centric use case (reviews for every dish at every restaurant), but when we rolled out delivery integrations, we realized that users resonated most with the delivery angle. They found it particularly ...