Giter VIP home page Giter VIP logo

tindetheus's Introduction

tindetheus

Build personalized machine learning models for Tinder based on your historical preference using Python.

There are three parts to this:

  1. A function to build a database which records everything about the profiles you've liked and disliked.
  2. A function to train a model to your database.
  3. A function to use the trained model to automatically like and dislike new profiles.

How it works

The last layer of a CNN trained for facial classification can be used as a feature set which describes an individual's face. It just so happens that this feature set is related to facial attractiveness.

tindetheus let's you build a database based on the profiles that you like and dislike. You can then train a classification model to your database. The model training first uses a MTCNN to detect and box the faces in your database. Then a facenet model is run on the faces to extract the embeddings (last layer of the CNN). A logistic regression model is then fit to the embeddings. The logistic regression model is saved, and this processes is repeated in automation to automatically like and dislike profiles based on your historical preference.

Visual aid explaining tindetheus

This blog post has a short description of how tindetheus works.

For a more detailed description of how and why this works see https://arxiv.org/abs/1803.04347

Example usage

tindetheus browse

build a database by liking and disliking profiles on Tinder. The database contains all the profile information as a numpy array, while the profile images are saved in a different folder.

tindetheus browse --distance=20

by default tindetheus starts with a 5 mile radius, but you can specify a search distance by specifying --distance. The above example is to start with a 20 mile search radius. It is important to note that when you run out of nearby users, tindethesus will ask you if you'd like to increase the search distance by 5 miles.

tindetheus train

Use machine learning to build a personalized model of who you like and dislike based on your database. The more profiles you've browsed, the better your model will be.

tindetheus like

Use your personalized model to automatically like and dislike profiles. The profiles which you have automatically liked and disliked are stored in al_database. By default this will start with a 5 mile search radius, which increases by 5 miles until you've used 100 likes. You can change the default search radius by using

tindetheus like --distance=20

which would start with a 20 mile search radius.

Installation and Getting started

Installation and getting started guide now stored in GETTING_STARTED.md

.env

You can now store all default optional parameters in your environment variables! This means you can set your starting distance, number of likes, and image_batch size without manually specifying the options each time. This is an example .env file:

FACEBOOK_AUTH_TOKEN="TODO" # your facebook token hash
# alternatively you can use the XAuthToken
# TINDER_AUTH_TOKEN="TODO"
TINDETHEUS_MODEL_DIR="/models/20170512-110547"  # the location of your facenet model directory
# see https://github.com/davidsandberg/facenet#pre-trained-models for other
# pretrained facenet models
TINDETHEUS_IMAGE_BATCH=1000  # number of images to load in a batch during train
#  the larger the image_batch size, the faster the training process, at the
#  cost of additional memory. A 4GB machine may struggle with 1000 images.
TINDETHEUS_DISTANCE=5  # Set the starting distance in miles
TINDETHEUS_LIKES=100  # set the number of likes you want to use
#  note that free Tinder users only get 100 likes in 24 hours
TINDETHEUS_RETRIES=20

Using the validate function on a different dataset

As of Version 0.4.0, tindetheus now includes a validate function. This validate functions applies your personally trained tinder model on an external set of images. If there is a face in the image, the model will predict whether you will like or dislike this face. The results are saved in validation.csv. For more information about the validate function read this.

Dataset available upon request

The dataset used to create this work is available upon request. Please fill out this form to request access to the data.

Changelog

All changes now stored in CHANGELOG.md

Open source libraries

tindetheus uses the following open source libraries:

About the name

Tindetheus is a combination of Tinder (the popular online dating application) and the Greek Titans: Prometheus and Epimetheus. Prometheus signifies "forethought," while his brother Epimetheus denotes "afterthought". In synergy they serve to improve your Tinder experience.

Epimetheus creates a database from all of the profiles you review on Tinder.

Prometheus learns from your historical preferences to automatically like new Tinder profiles.

tindetheus's People

Contributors

charlesduponpon avatar cjekel avatar vikashkothary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tindetheus's Issues

You only need to load facenet once!

The current implementation loads the facenet model from system storage on every pynder user retrieve. There is no good reason for this, the 300+mb facenet model only needs to be initialized once!

New Error

Why would this be happening?

Traceback (most recent call last):
File "/opt/anaconda3/bin/tindetheus", line 10, in
sys.exit(command_line_run())
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/tindetheus.py", line 299, in command_line_run
retries=defaults['retries'])
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/tindetheus.py", line 82, in main
likes_left=args.likes, x_auth_token=x_auth_token)
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/tinder_client.py", line 95, in init
self.session.profile.distance_filter = self.search_distance
File "/opt/anaconda3/lib/python3.7/site-packages/pynder/models/me.py", line 32, in set
instance.init(instance._api.update_profile(profile), instance._api)
File "/opt/anaconda3/lib/python3.7/site-packages/pynder/api.py", line 98, in update_profile
return self._post("/profile", profile)
File "/opt/anaconda3/lib/python3.7/site-packages/pynder/api.py", line 63, in _post
return self._request("post", url, data=data)
File "/opt/anaconda3/lib/python3.7/site-packages/pynder/api.py", line 54, in _request
raise errors.RequestError(result.status_code)
pynder.errors.RequestError: 500

Keeps crashing during tindetheus like and/or browse

Here's the error code
Traceback (most recent call last):
File "/opt/anaconda3/bin/tindetheus", line 10, in
sys.exit(command_line_run())
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/tindetheus.py", line 274, in command_line_run
main(args, defaults['facebook_token'], defaults['XAuthToken'])
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/tindetheus.py", line 63, in main
my_sess.browse()
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/tinder_client.py", line 286, in browse
self.look_at_users(users)
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/tinder_client.py", line 145, in look_at_users
image_list = imgproc.download_url_photos(urls, user.id)
File "/opt/anaconda3/lib/python3.7/site-packages/tindetheus/image_processing.py", line 70, in download_url_photos
urlretrieve(url, image_list[-1])
File "/opt/anaconda3/lib/python3.7/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/opt/anaconda3/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/opt/anaconda3/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/opt/anaconda3/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/opt/anaconda3/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/opt/anaconda3/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/opt/anaconda3/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

JSON Decode Error

Issue:

I've recently installed tindetheus on my machine alongside all the dependencies, however, I've been getting this JSON Decode Error and have not been able to make any progress since. From my understanding, this could be an issue either with tinder's API or my access token. The config I have set up contains only the facebook token which was obtained by the following method:

https://gist.github.com/taseppa/66fc7239c66ef285ecb28b400b556938

Output from tindetheus

tindetheus browse

Traceback (most recent call last):
  File "/home/rahov/.conda/envs/tensorflow/bin/tindetheus", line 8, in <module>
    sys.exit(command_line_run())
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/site-packages/tindetheus/tindetheus.py", line 268, in command_line_run
    main(args, defaults['facebook_token'], defaults['XAuthToken'])
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/site-packages/tindetheus/tindetheus.py", line 62, in main
    likes_left=args.likes, x_auth_token=x_auth_token)
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/site-packages/tindetheus/tinder_client.py", line 89, in __init__
    self.session = self.login(facebook_token, x_auth_token)
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/site-packages/tindetheus/tinder_client.py", line 127, in login
    XAuthToken=x_auth_token)
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/site-packages/pynder/session.py", line 18, in __init__
    self._api.auth(facebook_id, facebook_token)
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/site-packages/pynder/api.py", line 28, in auth
    self._full_url('/auth'), json=data, proxies=self._proxies).json()
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/rahov/.conda/envs/tensorflow/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

ValueError: Could not find a format.....while running tindetheus train

I managed to have it finish a smaller session earlier but now with 3000+ images I'm getting these errors. Looks like there are a few things not working and I'm not sure if its my build.

(tinder_ai) bash-3.2$ tindetheus train
/Users/zmilosevic/.local/share/virtualenvs/tinder_ai-x3LwT0UQ/lib/python3.7/site-packages/pandas/compat/init.py:97: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
warnings.warn(msg)
Creating networks and loading parameters
WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/tindetheus_align.py:86: The name tf.GPUOptions is deprecated. Please use tf.compat.v1.GPUOptions instead.

WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/tindetheus_align.py:87: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/tindetheus_align.py:87: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2021-01-14 16:19:06.948437: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2021-01-14 16:19:07.006258: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f879c680f50 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-01-14 16:19:07.006290: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/align/detect_face.py:280: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/align/detect_face.py:281: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/align/detect_face.py:125: The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead.

WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/align/detect_face.py:177: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/align/detect_face.py:213: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Deprecated in favor of operator or tf.math.divide.
WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/align/detect_face.py:197: The name tf.nn.xw_plus_b is deprecated. Please use tf.compat.v1.nn.xw_plus_b instead.

database/dislike/5c4244880cb7e911009b2a4b.0.jpg
database/dislike/532272d7205ff5a8390035f9.3.jpg
database/dislike/5fbb83d1cf613b010028b312.1.jpg

Goes through the images...

Total number of images: 3943
Number of successfully aligned images: 0
Model directory: /Users/zmilosevic/tinder_ai/models/20170512-110547
Metagraph file: model-20170512-110547.meta
Checkpoint file: model-20170512-110547.ckpt-250000
WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/facenet.py:381: The name tf.train.import_meta_graph is deprecated. Please use tf.compat.v1.train.import_meta_graph instead.

WARNING:tensorflow:The saved meta_graph is possibly from an older release:
'model_variables' collection should be of type 'byte_list', but instead is of type 'node_list'.
WARNING:tensorflow:From /Users/zmilosevic/.local/share/virtualenvs/tinder_ai-x3LwT0UQ/lib/python3.7/site-packages/tensorflow_core/python/training/queue_runner_impl.py:391: QueueRunner.init (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the tf.data module.
WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/facenet.py:382: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING:tensorflow:From /Users/zmilosevic/tinder_ai/tindetheus/tindetheus/export_embeddings.py:117: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

Number of images: 3533
Number of batches: 4
Completed batch 1 of 4
Completed batch 2 of 4
Traceback (most recent call last):
File "/Users/zmilosevic/.local/share/virtualenvs/tinder_ai-x3LwT0UQ/bin/tindetheus", line 33, in
sys.exit(load_entry_point('tindetheus', 'console_scripts', 'tindetheus')())
File "/Users/zmilosevic/tinder_ai/tindetheus/tindetheus/tindetheus.py", line 279, in command_line_run
retries=defaults['retries'])
File "/Users/zmilosevic/tinder_ai/tindetheus/tindetheus/tindetheus.py", line 89, in main
image_batch=args.image_batch)
File "/Users/zmilosevic/tinder_ai/tindetheus/tindetheus/export_embeddings.py", line 142, in main
False, False, image_size)
File "/Users/zmilosevic/tinder_ai/tindetheus/tindetheus/facenet_clone/facenet.py", line 247, in load_data
img = imageio.imread(image_paths[i])
File "/Users/zmilosevic/.local/share/virtualenvs/tinder_ai-x3LwT0UQ/lib/python3.7/site-packages/imageio/core/functions.py", line 265, in imread
reader = read(uri, format, "i", **kwargs)
File "/Users/zmilosevic/.local/share/virtualenvs/tinder_ai-x3LwT0UQ/lib/python3.7/site-packages/imageio/core/functions.py", line 182, in get_reader
"Could not find a format to read the specified file in %s mode" % modename
ValueError: Could not find a format to read the specified file in single-image mode
(tinder_ai) bash-3.2$

tf.train.import_meta_graph deprecated in favor of tf.compat.v1.train.import_meta_graph

Hi- ran into an issue while running 'tindetheus like'. The runtime was 'killed' due to a deprecated facenet function.

`root@ce568c388715:/tinder# tindetheus like

... Loading the facenet model ...
... be patient this may take some time ...
WARNING:tensorflow:From /tindetheus/tindetheus/tindetheus.py:144: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2020-03-15 03:22:26.767805: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-03-15 03:22:26.807672: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2400065000 Hz
2020-03-15 03:22:26.808252: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4bf7440 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-03-15 03:22:26.808483: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Hello Morgan
You have browsed 167 Tinder profiles.
Model directory: 20170512-110547
Metagraph file: model-20170512-110547.meta
Checkpoint file: model-20170512-110547.ckpt-250000
WARNING:tensorflow:From /tindetheus/tindetheus/facenet_clone/facenet.py:381: The name tf.train.import_meta_graph is deprecated. Please use tf.compat.v1.train.import_meta_graph instead.

Killed`

401 Error Code

Using the docker setup, I created a config.txt in the docked machine, but even using the technique shown here, and correctly getting the Tinder Facebook Token, an error pynder.errors.RequestError: Couldn't authenticate request status code: 401 is raised.

pynder.errors.RequestError: 500

I followed all your steps how to start this project but it show this error

Hello XXXX
Traceback (most recent call last):
File "/usr/local/bin/tindetheus", line 10, in
sys.exit(command_line_run())
File "/usr/local/lib/python3.6/dist-packages/tindetheus/tindetheus.py", line 781, in command_line_run
main(args, defaults['facebook_token'], defaults['XAuthToken'])
File "/usr/local/lib/python3.6/dist-packages/tindetheus/tindetheus.py", line 575, in main
likes_left=args.likes, x_auth_token=x_auth_token)
File "/usr/local/lib/python3.6/dist-packages/tindetheus/tindetheus.py", line 343, in init
self.session.profile.distance_filter = self.search_distance
File "/usr/local/lib/python3.6/dist-packages/pynder/models/me.py", line 32, in set
instance.init(instance._api.update_profile(profile), instance._api)
File "/usr/local/lib/python3.6/dist-packages/pynder/api.py", line 98, in update_profile
return self._post("/profile", profile)
File "/usr/local/lib/python3.6/dist-packages/pynder/api.py", line 63, in _post
return self._request("post", url, data=data)
File "/usr/local/lib/python3.6/dist-packages/pynder/api.py", line 54, in _request
raise errors.RequestError(result.status_code)
pynder.errors.RequestError: 500

My question is did i got the wrong token?

Issue with Pillow

First off awesome work Charles, I've been using Tindetheus for the past two weeks and it works amazing. Thanks for helping me with my initial install issues. Also want to preface this with the fact I'm a CS student still so apologies if this is a simple fix. When I went to run it today I used the browse function added 50 or so profiles and then train and everything went smoothly as usual. When I tried to get it to like profiles though I got this error.

Number of images: 47
Number of batches: 1
Traceback (most recent call last):
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\plugins\pillow.py", line 671, in pil_try_read
im.getdata()[0]
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\PIL\Image.py", line 1304, in getdata
self.load()
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\PIL\ImageFile.py", line 272, in load
raise_ioerror(err_code)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\PIL\ImageFile.py", line 59, in raise_ioerror
raise IOError(message + " when reading image file")
OSError: broken data stream when reading image file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\matthew\anaconda3\envs\py36\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\matthew\anaconda3\envs\py36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Matthew\Anaconda3\envs\py36\Scripts\tindetheus.exe_main
.py", line 7, in
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\tindetheus\tindetheus.py", line 299, in command_line_run
retries=defaults['retries'])
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\tindetheus\tindetheus.py", line 153, in main
my_sess.like()
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\tindetheus\tinder_client.py", line 314, in like
self.like_or_dislike_users(users)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\tindetheus\tinder_client.py", line 219, in like_or_dislike_users
image_size)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\tindetheus\facenet_clone\facenet.py", line 247, in load_data
img = imageio.imread(image_paths[i])
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\core\functions.py", line 264, in imread
reader = read(uri, format, "i", **kwargs)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\core\functions.py", line 186, in get_reader
return format.get_reader(request)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\core\format.py", line 164, in get_reader
return self.Reader(self, request)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\core\format.py", line 214, in init
self._open(**self.request.kwargs.copy())
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\plugins\pillow.py", line 300, in _open
return PillowFormat.Reader._open(self, pilmode=pilmode, as_gray=as_gray)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\plugins\pillow.py", line 137, in _open
pil_try_read(self._im)
File "c:\users\matthew\anaconda3\envs\py36\lib\site-packages\imageio\plugins\pillow.py", line 682, in pil_try_read
raise ValueError(error_message)
ValueError: Could not load ""
Reason: "broken data stream when reading image file"
Please see documentation at: http://pillow.readthedocs.io/en/latest/installation.html#external-libraries

Using Jupyter notebooks

Mind if I add some notebooks which can be used to train and use the library.

It may require changes to the codebase due to the latest version of the UI.

Requirements.txt

A requirements.txt file will all the dependencies would help. Here's what I had so far

pip
jupyter
setuptools
tindetheus
opencv-python
pynder

Error when running

When I enter the command: "tindetheus browse" after running the docker I get the following error:

Traceback (most recent call last):
File "/usr/local/bin/tindetheus", line 11, in
load_entry_point('tindetheus', 'console_scripts', 'tindetheus')()
File "/tindetheus/tindetheus/tindetheus.py", line 273, in command_line_run
raise('ERROR: No facebook or tinder token has been set.'
TypeError: exceptions must derive from BaseException

I've followed all steps of the guide and I have a .env file with my facebook access token into the tinder folder.

Improving the navigation in al_database

Use your personalized model to automatically like and dislike profiles. The profiles which you have automatically liked and disliked are stored in al_database.

In my case, all profiled liked and disliked automatically when doing tindetheus like are all dumped into the al_database directory. Would it be possible to have a separation done here? A like subdirectory and dislike subdirectory. Similar to the manner database works right now. We could quickly check if the model behaves as expected.

Error in tindetheus.py:show_images line:153

OS: Mac OS X
Python dist: Anaconda 2

Traceback (most recent call last):
File "/anaconda/bin/tindetheus", line 11, in
sys.exit(command_line_run())
File "/anaconda/lib/python2.7/site-packages/tindetheus/tindetheus.py", line 567, in command_line_run
main(parse_arguments(sys.argv[1:]), facebook_token)
File "/anaconda/lib/python2.7/site-packages/tindetheus/tindetheus.py", line 501, in main
my_sess.browse()
File "/anaconda/lib/python2.7/site-packages/tindetheus/tindetheus.py", line 459, in browse
self.look_at_users(users)
File "/anaconda/lib/python2.7/site-packages/tindetheus/tindetheus.py", line 326, in look_at_users
show_images(image_list)
File "/anaconda/lib/python2.7/site-packages/tindetheus/tindetheus.py", line 153, in show_images
temp_image = imageio.imread(i)
File "/anaconda/lib/python2.7/site-packages/imageio/core/functions.py", line 200, in imread
reader = read(uri, format, 'i', **kwargs)
File "/anaconda/lib/python2.7/site-packages/imageio/core/functions.py", line 126, in get_reader
'in mode %r' % mode)
ValueError: Could not find a format to read the specified file in mode 'i'

Installing on Windows issue

Hi, I'm sorry if this is a dumb error but I just followed your article on installing Tindetheus on Windows 10 and instead of getting prompted for a config file I got these errors and was wondering if you had any idea what they mean? I've tried googling and am not getting very far. Thank you for your time, very excited to try out Tindetheus.

2019-12-15 17:39:24.588753: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2019-12-15 17:39:24.591269: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Matthew\Anaconda3\envs\tensorflow\Scripts\tindetheus.exe_main
.py", line 5, in
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tindetheus_init
.py", line 1, in
from .tindetheus import * # noqa F401
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tindetheus\tindetheus.py", line 34, in
import tensorflow as tf
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_init_.py", line 99, in
from tensorflow_core import *
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core_init_.py", line 28, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "", line 1005, in handle_fromlist
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_init
.py", line 50, in getattr
module = self.load()
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_init
.py", line 44, in _load
module = importlib.import_module(self.name)
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\importlib_init
.py", line 126, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python_init
.py", line 52, in
from tensorflow.core.framework.graph_pb2 import *
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\core\framework\graph_pb2.py", line 16, in
from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\core\framework\node_def_pb2.py", line 16, in
from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\core\framework\attr_value_pb2.py", line 16, in
from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\core\framework\tensor_pb2.py", line 16, in
from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\core\framework\resource_handle_pb2.py", line 16, in
from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
File "c:\users\matthew\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\core\framework\tensor_shape_pb2.py", line 112, in
'module' : 'tensorflow.core.framework.tensor_shape_pb2'
TypeError: expected bytes, Descriptor found

Move documentation into a docs folder

We should move the documentation into a separate folder. The advantage of this is it can then be deployed. See Readthedocs or the GitHub wiki.

It will also involve separating technical documentation from the open source docs which are meant for different types of users.

Add test case

This library needs a unit tester. The following needs to be completed at a minimum to test functionality of tindetheus so I can push with ease of mind.

  • Create dummy Tinder database
  • Create dummy new profile to dislike
  • Create dummy new profile to like
  • test browse functionality
  • test train functionality
  • test like functionality

Pynder submodule

Just a thought. You should use 'git submodules' to include the specific commit of the pynder repo you use in this project. It's easier to maintain and can be used in the requirements.txt.

And it there a reason you're not using the latest version of the library?

running in Docker: ERROR: No facebook or tinder token has been set.

Hi, I end up in that error after running "tindetheus browse":

root@04ccce1f985e:/# tindetheus browse Traceback (most recent call last): File "/usr/local/bin/tindetheus", line 11, in <module> load_entry_point('tindetheus', 'console_scripts', 'tindetheus')() File "/tindetheus/tindetheus/tindetheus.py", line 274, in command_line_run raise('ERROR: No facebook or tinder token has been set.' TypeError: exceptions must derive from BaseException root@04ccce1f985e:/# tindetheus browse Traceback (most recent call last): File "/usr/local/bin/tindetheus", line 11, in <module> load_entry_point('tindetheus', 'console_scripts', 'tindetheus')() File "/tindetheus/tindetheus/tindetheus.py", line 274, in command_line_run raise('ERROR: No facebook or tinder token has been set.' TypeError: exceptions must derive from BaseException root@04ccce1f985e:/# tindetheus browse Traceback (most recent call last): File "/usr/local/bin/tindetheus", line 11, in <module> load_entry_point('tindetheus', 'console_scripts', 'tindetheus')() File "/tindetheus

I both tried the Tinder Auth Token and the Facebook Auth Token. I assume something like "EAAGmXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXV0ZD" is right?

I run the docker-image in a Ubuntu that runs on a VirtualBox on Win10, doubt that is the reason for the error though?

Use Environment Variables

Using environment variables and .env files over a config.txt file will make the program more portable and works better with Docker.

What do you think?

Docker Image

I can see that you've realised this project as a docker image. Could you add the Dockerfile for this project to the repo?

ImportError: cannot import name 'RecsTimeout' from 'pynder.errors'

please help me with the error thanks! Code as below:

tindetheus browse
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/tindetheus", line 5, in
from tindetheus import command_line_run
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tindetheus/init.py", line 1, in
from .tindetheus import * # noqa F401
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tindetheus/tindetheus.py", line 39, in
from tindetheus.tinder_client import client
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tindetheus/tinder_client.py", line 66, in
from pynder.errors import RecsTimeout
ImportError: cannot import name 'RecsTimeout' from 'pynder.errors' (/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pynder/errors.py)

AttributeError: 'int' object has no attribute 'predict'

Traceback (most recent call last): File "c:\users\focus\anaconda3\envs\tensorflow\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\focus\anaconda3\envs\tensorflow\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\Focus\Anaconda3\envs\tensorflow\Scripts\tindetheus.exe_main.py", line 9, in File "c:\users\focus\anaconda3\envs\tensorflow\lib\site-packages\tindetheus\tindetheus.py", line 781, in command_line_run main(args, defaults['facebook_token'], defaults['XAuthToken']) File "c:\users\focus\anaconda3\envs\tensorflow\lib\site-packages\tindetheus\tindetheus.py", line 644, in main my_sess.like() File "c:\users\focus\anaconda3\envs\tensorflow\lib\site-packages\tindetheus\tindetheus.py", line 560, in like self.like_or_dislike_users(users) File "c:\users\focus\anaconda3\envs\tensorflow\lib\site-packages\tindetheus\tindetheus.py", line 489, in like_or_dislike_users yhat = self.model.predict(X) AttributeError: 'int' object has no attribute 'predict'

Hey @cjekel, I am not sure what to do here. All the other errors that came up so far, I have managed to debug. But stuck on this error. Any insights on how to solve this error? Thanks!

Image save does not let you override files

Let's say you ran out of free likes from Tinder for the day, but you liked someone anyways. There's a chance that their profile images are stored in your database. The next time you log on, you might attempt to relike that user and tindetheus will bomb out as it was unable to override the profile images that were already existing.

This might just happen on Windows, as I haven't heard of this issue on Linux.

What should also be mentioned is that there will be duplicates in the database!

tutorial please

there are so many things that are a bit vague to a novice programmer like me. when you say i should copy the '*.env.example' file, where should i copy it to?
also what should the facebook auth token look like? mine is a 266 character string of digits, and lower and upper case letters. is this correct?

Error after dislike

I've disliked a profile after doing some likes and dislikes and I've got this error:

`Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1354, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 306, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.7/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.7/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/osboxes/.local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1354, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 306, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.7/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.7/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/osboxes/.local/bin/tindetheus", line 11, in
load_entry_point('tindetheus', 'console_scripts', 'tindetheus')()
File "/home/osboxes/tindetheus/tindetheus/tindetheus.py", line 278, in command_line_run
retries=defaults['retries'])
File "/home/osboxes/tindetheus/tindetheus/tindetheus.py", line 81, in main
my_sess.browse()
File "/home/osboxes/tindetheus/tindetheus/tinder_client.py", line 299, in browse
self.browse()
File "/home/osboxes/tindetheus/tindetheus/tinder_client.py", line 299, in browse
self.browse()
File "/home/osboxes/tindetheus/tindetheus/tinder_client.py", line 299, in browse
self.browse()
[Previous line repeated 11 more times]
File "/home/osboxes/tindetheus/tindetheus/tinder_client.py", line 286, in browse
self.look_at_users(users)
File "/home/osboxes/tindetheus/tindetheus/tinder_client.py", line 157, in look_at_users
print(user.dislike())
File "/home/osboxes/.local/lib/python3.7/site-packages/pynder/models/user.py", line 116, in dislike
return self._session._api.dislike(self.id)
File "/home/osboxes/.local/lib/python3.7/site-packages/pynder/api.py", line 104, in dislike
return self._get("/pass/{}".format(user))
File "/home/osboxes/.local/lib/python3.7/site-packages/pynder/api.py", line 60, in _get
return self._request("get", url)
File "/home/osboxes/.local/lib/python3.7/site-packages/pynder/api.py", line 47, in _request
url), json=data, proxies=self._proxies)
File "/home/osboxes/.local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/osboxes/.local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/osboxes/.local/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
`

tindetheus browse - pynder.errors.RequestError: 500

running tindetheus browse.
I receive a 500 error from the tinder client after a successfull login:

Traceback (most recent call last):
  File "/usr/local/bin/tindetheus", line 33, in <module>
    sys.exit(load_entry_point('tindetheus', 'console_scripts', 'tindetheus')())
  File "/tindetheus/tindetheus/tindetheus.py", line 278, in command_line_run
    main(args, defaults['facebook_token'], defaults['XAuthToken'],
  File "/tindetheus/tindetheus/tindetheus.py", line 80, in main
    likes_left=args.likes, x_auth_token=x_auth_token)
  File "/tindetheus/tindetheus/tinder_client.py", line 95, in __init__
    self.session.profile.distance_filter = self.search_distance
  File "/usr/local/lib/python3.6/dist-packages/pynder/models/me.py", line 32, in __set__
    instance.__init__(instance._api.update_profile(profile), instance._api)
  File "/usr/local/lib/python3.6/dist-packages/pynder/api.py", line 98, in update_profile
    return self._post("/profile", profile)
  File "/usr/local/lib/python3.6/dist-packages/pynder/api.py", line 63, in _post
    return self._request("post", url, data=data)
  File "/usr/local/lib/python3.6/dist-packages/pynder/api.py", line 54, in _request
    raise errors.RequestError(result.status_code)
pynder.errors.RequestError: 500

regarding model/20170512-110547

I got this directory.
Everything is working fine.
But whole deep learning piqued my interest.

when I am training my models how I know if what I am training is going into these models.
the process runs fine but modified dates on files in folder 20170512-110547 never get updated.

I am only 2 weeks old in python and very curious about creating models and all.
What is better than tinder to train models. so much data.

if you can point me to the right directions, books, articles, blogpost or youtube. I would appreciate it.

Thanks,
Alok C

Limited memory computers can't process facenet images in batch

It's possible that your computer may not be able to process the facenet images in such a large batch size due to RAM limitations. This should be fixed. I have the following two suggestions.

  1. Add config.txt setting for image batch size
  2. Add command line option for image batch size.

Profiles repeat

When I do a like, some users' profiles appear again repeated and keep repeating after I like them.

Authorization bug

Error message:
(cv) silas@silas:~/my_tinder_data$ tindetheus browse Traceback (most recent call last): File "/home/silas/.virtualenvs/cv/bin/tindetheus", line 10, in <module> sys.exit(command_line_run()) File "/home/silas/.virtualenvs/cv/lib/python3.6/site-packages/tindetheus/tindetheus.py", line 733, in command_line_run main(args, defaults['facebook_token']) File "/home/silas/.virtualenvs/cv/lib/python3.6/site-packages/tindetheus/tindetheus.py", line 551, in main likes_left=args.likes) File "/home/silas/.virtualenvs/cv/lib/python3.6/site-packages/tindetheus/tindetheus.py", line 314, in __init__ self.session = self.login(facebook_token) File "/home/silas/.virtualenvs/cv/lib/python3.6/site-packages/tindetheus/tindetheus.py", line 349, in login session = pynder.Session(facebook_token) File "/home/silas/.virtualenvs/cv/lib/python3.6/site-packages/pynder/session.py", line 18, in __init__ self._api.auth(facebook_id, facebook_token) File "/home/silas/.virtualenvs/cv/lib/python3.6/site-packages/pynder/api.py", line 28, in auth self._full_url('/auth'), json=data, proxies=self._proxies).json() File "/home/silas/.virtualenvs/cv/lib/python3.6/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Seems to be an issue with improperly formatted json data. Do you have any insight into how I can fix this? Thanks

Reinforcement learning

Hey, any idea how reinforcement learning could be applied? based on review of decisions that network made

Config.txt issue

So I was getting the error message again saying 401 auth error.

The issue only happens when in a folder with a config.txt. If you launch tindetheus from an empty folder it starts fine. Thought I'd let you know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.