vasilysinitsin / faces Goto Github PK
View Code? Open in Web Editor NEWA Python wrapper around FaceApp :pensive: → :grinning:
License: MIT License
A Python wrapper around FaceApp :pensive: → :grinning:
License: MIT License
"Please update! you are running an old version. Please update FaceApp to the latest one"
Here is my code
import faces
from PIL import Image
from io import BytesIO
sad = open("ivan.png", "rb")
image = faces.FaceAppImage(file=sad)
happy = image.apply_filter("smile", cropped=True)
image = Image.open(BytesIO(happy))
image.save("output.png", "PNG")
I think, you need to update api BASE_API_URL
to "https://ph-x-p.faceapp.io/api/v2.3/photos". I tried to do this, but unfortunately, it doesn't work.
Is there is a way to compare the photos and say if they are the same or different? Please reply as soon as possible!!
Hey. Thanks for the awesome library. as of July 20, 2019, The API will return an image with a layer on top of it saying you need to update. I have a rooted device (if that matters). I tried capturing packets but it seems TCP stream is not readable. I am totally willing to find the new API URL. I only need to know how it was done till now. Any information on how to get the URL is appreciated
Hi! great job!
But i cant get an output file, just verify that the filters are working
Cheers
I just installed via pip and saved your sample code(With file example) to a file, placed an image in proper path and ran. This is what I see
Traceback (most recent call last):
File "face.py", line 4, in
image = faces.FaceAppImage(file=sad)
File "/Users/ishandutta2007/.pyenv/versions/3.6.0/lib/python3.6/site-packages/faces/init.py", line 71, in init
post = requests.post(BASE_API_URL, headers=headers, files={'file': file})
File "/Users/ishandutta2007/.pyenv/versions/3.6.0/lib/python3.6/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Users/ishandutta2007/.pyenv/versions/3.6.0/lib/python3.6/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/ishandutta2007/.pyenv/versions/3.6.0/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Users/ishandutta2007/.pyenv/versions/3.6.0/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Users/ishandutta2007/.pyenv/versions/3.6.0/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='ph-x-p.faceapp.io', port=443): Max retries exceeded with url: /api/v2.11/photos (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
"Please Update!
You are running an old version. Please update FaceApp to the latest one."
Hi, Thanks for making this.
Unfortunately I can't get an output file.
I created a py file with htis 👍
import faces
sad = open('sad.jpg', 'rb')
image = faces.FaceAppImage(file=sad)
happy = image.apply_filter('smile', cropped=True)
happy.save('/home/user/Face/output.jpg')
But I get this error:
Traceback (most recent call last):
File "test.py", line 7, in
happy.save('/home/nfrederickx/Face/output.jpg')
AttributeError: 'str' object has no attribute 'save'
I have no idea what I'm doing.
Thanks for helping!
after running the code below, i got an error. Any idea?
import faces
old_rockfeller = 'https://upload.wikimedia.org/wikipedia/commons/6/6f/John_D._Rockefeller_1885.jpg'
image = faces.FaceAppImage(url=old_rockfeller)
young_rockfeller = image.apply_filter('young')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.