Skip to content

Conversation

@FrankTheDevop
Copy link

Just a quick hack to be able to use your library with python3.
Let me know if you miss something

@vijpandaturtle
Copy link

I used this version of the client library, and I keep getting error code 31 (download error file not found). I'm not sure what to do about this .. I'm using the same images given in the README

@FrankTheDevop
Copy link
Author

@vijpandaturtle I only published my changes to be able to use it with Python3 but I can try to help you.
Please post the code you used so that I can understand how you tried to use it

@vijpandaturtle
Copy link

Thank you
Here is the code I used

# Detecting faces
from face_client.face_client import FaceClient

# Initializing the face recognition client
client = FaceClient(API_KEY, API_SECRET)

response = client.faces_detect('http://savasplace.com/wp-content/uploads/2009/04/guido-van-rossum.jpg, http://farm1.static.flickr.com/43/104506247_c748f20b83.jpg, http://farm1.static.flickr.com/67/200126290_2798330e61.jpg')
tids = [photo['tags'][0]['tid'] for photo in response['photos']]
tids

# Saving tags for training namespace index
client.tags_save(tids= ','.join(tids), uid= 'guido@CoBo', label='Guido Van Rossum')

clients.faces_train('guido@CoBo')
client.tags_get('guido@CoBo')

client.faces_recognize('all', 'http://farm1.static.flickr.com/41/104498903_bad315cee0.jpg', namespace='CoBo')

(My api key and api secret is left blank because they are private)
Also, this is the error I get

error

@FrankTheDevop
Copy link
Author

@vijpandaturtle I tried your code and I think I found the problem. In response = client.faces_detect()you have your ", " (comma followed by space) instead of "," (only comma). In the example they don´t use the space. It seems like the library is a bit picky there.

@vijpandaturtle
Copy link

Thank you that fixed the error for me :)

@justinasci
Copy link

@FrankTheDevop I have tried running your script with python 3.6.4, however it uses dict.iteritems() which is no longer supported in Python 3. Using dict.items() seems to do the trick.

Also there is urllib.parse import which is Python 3 package, so its impossible to run this script in neither py3 or py2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants