jankrepl / pychubby Goto Github PK
View Code? Open in Web Editor NEWAutomated face warping tool.
Home Page: http://pychubby.readthedocs.io
License: MIT License
Automated face warping tool.
Home Page: http://pychubby.readthedocs.io
License: MIT License
Make it obvious that the user needs to use Multiple
metaaction or just
do it silently in the background
Interesting work. Is it possible to do it in realtime? Say live on camera video, perform nose slimming.
hello
Thank you for showing interesting code.
I want to move landmark point using class CustomAction.
and move to pixel unit.....
umm.. ex
def perform(self, lf):
a_l = Lambda(x=self.x, y = self.y
specs={'CHIN': (90,90), # x: +90pixel , y: + 90pixel
}
)
but your code works scale parameter...... umm...
I am Junior so I have trouble make class(move pixel unit)..
Could you do me a favor?..
from pychubby.actions import OpenEyes
a = OpenEyes(scale=-0.04)
new_lf, df = a.perform(lf)
new_lf.plot(show_landmarks=False)
If you look at the top side of the applied image, the image is scaled down with a black area.
Is it possible to transform a face without this being made?
https://pychubby.readthedocs.io/en/latest/source/gallery.html
If you look at the LinearTransform gif on the pychubby official website, you will see the same phenomenon.
Thanks for providing a good reference.
I wonder what caused this Error? Which kind(s) of images caused it?
Doing pip install pychubby on a OSX machine (Sierra, 10.12.6) with Python 3.7 gives:
$ pip install pychubby
Collecting pychubby
Downloading https://files.pythonhosted.org/packages/c3/09/5c9dd0c6c6b097118327d1a2f7a163bafc4d80269c102f3e036cb8c530f7/pychubby-0.2-py3-none-any.whl
.... many lines ...
Building wheels for collected packages: dlib, networkx
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/pzelnip/.virtualenvs/temp/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/z9/c2zmn4_13b31g4y26q30n5c1x5hbyk/T/pip-install-3qz43g8p/dlib/setup.py'"'"'; __file__='"'"'/private/var/folders/z9/c2zmn4_13b31g4y26q30n5c1x5hbyk/T/pip-install-3qz43g8p/dlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/z9/c2zmn4_13b31g4y26q30n5c1x5hbyk/T/pip-wheel-pg9zuzb5 --python-tag cp37
cwd: /private/var/folders/z9/c2zmn4_13b31g4y26q30n5c1x5hbyk/T/pip-install-3qz43g8p/dlib/
Complete output (53 lines):
running bdist_wheel
running build
running build_py
package init file 'dlib/__init__.py' not found (or not a regular file)
running build_ext
Traceback (most recent call last):
File "/private/var/folders/z9/c2zmn4_13b31g4y26q30n5c1x5hbyk/T/pip-install-3qz43g8p/dlib/setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'
There was more output, but ultimately the issue was that I didn't have cmake
installed. Once I installed it via Homebrew the pip install worked fine.
Should this not be documented in the Readme/docs?
Currently the error says there are duplicate landmarks. This is just a check in the constructor that does not allow for this. However, dlib apparently spits out identical landmarks when the prediction fails.
.
The goal is to have a possibility to query any pixel in the original image and get
the corresponding pixel in the new image. Currently only works the other way around.
https://github.com/SummitKwan/transparent_latent_gan
https://github.com/NVlabs/stylegan
I guess it should be mentioned in readme.
Defining new actions is very easy via the action Lambda
. See detailed explanation here: Custom actions
Some ideas
So that it is not even possible to install on unsupported versions of Python
OS: Arch Linux (latest)
Python version: 3.8.6
Pychubby version: 0.2
pip version: 20.2.4
pychubby
via pip
pc
(with arguments or without)Traceback (most recent call last):
File "/home/liferooter/.local/bin/pc", line 5, in <module>
from pychubby.cli import cli
File "/home/liferooter/.local/lib/python3.8/site-packages/pychubby/cli.py", line 8, in <module>
import pychubby.actions
File "/home/liferooter/.local/lib/python3.8/site-packages/pychubby/actions.py", line 14, in <module>
from pychubby.detect import LANDMARK_NAMES, LandmarkFace, LandmarkFaces
File "/home/liferooter/.local/lib/python3.8/site-packages/pychubby/detect.py", line 5, in <module>
import dlib
File "/home/liferooter/.local/lib/python3.8/site-packages/dlib/__init__.py", line 19, in <module>
from _dlib_pybind11 import *
ImportError: /home/liferooter/.local/lib/python3.8/site-packages/_dlib_pybind11.cpython-38-x86_64-linux-gnu.so: undefined symbol: cblas_dtrsm
(liferooter
is my user name)
Thank you for your help!
import matplotlib.pyplot as plt
import numpy as np
import urllib.request as urllib
from pychubby.actions import Smile
from pychubby.detect import LandmarkFace
def makeSmile(filePath):
img = plt.imread(filePath)
lf = LandmarkFace.estimate(img)
a = Smile(scale=0.2)
new_lf, df = a.perform(lf)
new_lf.plot(show_landmarks=False)
return "Task done"
This is my .py code. I am calling makeSmile method from java file and passing the image file as a parameter.
Once the work is done on python side, I need output image in return. I read all the documentation but did not understand what the plot method do ? why it does not return anything ?
Currently transformation shape is identical to the image shape. Interpolations get pretty slow or even lead to memory errors.
How to fix it?
Perform interpolation on a downsampled image and then upsample the transformation.
Currently only shows type
First of all, thank you for your amazing work.
The thing is, "shape_predictor_68_face_landmarks.dat" looks like under non-commercial license.
I guess we cannot use this work for commercial purposes, right?
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.