This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"meta": { | |
"status": 200 | |
}, | |
"data": { | |
"results": [ | |
{ | |
"type": "user", | |
"user": { | |
"_id": "4adfwe547s8df64df", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from geopy.geocoders import Nominatim | |
TINDER_URL = "https://api.gotinder.com" | |
geolocator = Nominatim(user_agent="auto-tinder") | |
PROF_FILE = "./images/unclassified/profiles.txt" | |
class Person(object): | |
def __init__(self, data, api): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
TINDER_URL = "https://api.gotinder.com" | |
class tinderAPI(): | |
def __init__(self, token): | |
self._token = token | |
def profile(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
token = "YOUR-API-TOKEN" | |
api = tinderAPI(token) | |
while True: | |
persons = api.nearby_persons() | |
for person in persons: | |
print(person) | |
# person.like() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# At the top of auto_tinder.py | |
PROF_FILE = "./images/unclassified/profiles.txt" | |
# inside the Person-class | |
def download_images(self, folder=".", sleep_max_for=0): | |
with open(PROF_FILE, "r") as f: | |
lines = f.readlines() | |
if self.id in lines: | |
return | |
with open(PROF_FILE, "a") as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
token = "YOUR-API-TOKEN" | |
api = tinderAPI(token) | |
while True: | |
persons = api.nearby_persons() | |
for person in persons: | |
person.download_images(folder="./images/unclassified", sleep_max_for=random()*3) | |
sleep(random()*10) | |
sleep(random()*10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import listdir, rename | |
from os.path import isfile, join | |
import tkinter as tk | |
from PIL import ImageTk, Image | |
IMAGE_FOLDER = "./images/unclassified" | |
images = [f for f in listdir(IMAGE_FOLDER) if isfile(join(IMAGE_FOLDER, f))] | |
unclassified_images = filter(lambda image: not (image.startswith("0_") or image.startswith("1_")), images) | |
current = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
def open_graph(): | |
detection_graph = tf.Graph() | |
with detection_graph.as_default(): | |
od_graph_def = tf.GraphDef() | |
with tf.gfile.GFile('ssd_mobilenet_v1_coco_2017_11_17/frozen_inference_graph.pb', 'rb') as fid: | |
serialized_graph = fid.read() | |
od_graph_def.ParseFromString(serialized_graph) | |
tf.import_graph_def(od_graph_def, name='') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def load_image_into_numpy_array(image): | |
(im_width, im_height) = image.size | |
return np.array(image.getdata()).reshape( | |
(im_height, im_width, 3)).astype(np.uint8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from object_detection.utils import ops as utils_ops | |
import tensorflow as tf | |
def run_inference_for_single_image(image, sess): | |
ops = tf.get_default_graph().get_operations() | |
all_tensor_names = {output.name for op in ops for output in op.outputs} | |
tensor_dict = {} | |
for key in [ | |
'num_detections', 'detection_boxes', 'detection_scores', |
OlderNewer