papulke / face-of-art Goto Github PK
View Code? Open in Web Editor NEWCode for "The Face of Art: Landmark Detection and Geometric Style in Portraits"
License: MIT License
Code for "The Face of Art: Landmark Detection and Geometric Style in Portraits"
License: MIT License
Dear author,
Thanks for sharing your code!
I found some problems when testing the scripts. I first downloaded the datasets as well as the pre-trained models, and then changed the related file paths and executed the script directly python3 predict_landmarks.py
However, I first got some complaints about the convention from py2 to py3 such as using print() rather than print at menpofit/clm/algorithm/gd.py:363
And then I got the following messages:
Traceback (most recent call last):
File "predict_landmarks.py", line 58, in
reuse=reuse, map_to_input_size=map_landmarks_to_original_image)
File "/home/chloe/face-of-art/deep_heatmaps_model_fusion_net.py", line 822, in get_landmark_predictions
p_pdm_lms = feature_based_pdm_corr(lms_init=init_lms, models_dir=pdm_models_dir, train_type='basic')
File "/home/chloe/face-of-art/pdm_clm_functions.py", line 160, in feature_based_pdm_corr
pdm_temp = pickle.load(filehandler, fix_imports=True, encoding="latin1")
_pickle.UnpicklingError: unpickling stack underflow
I simply changed the encoding way from "latin1" to "bytes" as a solution, however, I am not sure if it is correct or not.
And then, I got this error:
Traceback (most recent call last):
File "predict_landmarks.py", line 58, in
reuse=reuse, map_to_input_size=map_landmarks_to_original_image)
File "/home/chloe/face-of-art/deep_heatmaps_model_fusion_net.py", line 822, in get_landmark_predictions
p_pdm_lms = feature_based_pdm_corr(lms_init=init_lms, models_dir=pdm_models_dir, train_type='basic')
File "/home/chloe/face-of-art/pdm_clm_functions.py", line 165, in feature_based_pdm_corr
part_lms_pdm = pdm_correct(lms_init[part_inds], pdm_temp)
File "/home/chloe/face-of-art/pdm_clm_functions.py", line 86, in pdm_correct
pdm_model.set_target(PointCloud(init_shape))
File "/home/chloe/.local/lib/python3.6/site-packages/menpo/base.py", line 229, in set_target
self._target_setter_with_verification(new_target) # trigger the update
File "/home/chloe/.local/lib/python3.6/site-packages/menpo/base.py", line 244, in _target_setter_with_verification
self._verify_target(new_target)
File "/home/chloe/.local/lib/python3.6/site-packages/menpo/base.py", line 266, in _verify_target
if self.target is None:
File "/home/chloe/face-of-art/menpofit/modelinstance.py", line 114, in target
return self._target
AttributeError: 'OrthoPDM' object has no attribute '_target'
Did I miss any settings? Or what should I do to run through this script?
Thank you for your time!
Great work! I would like to check what the license is of this code and model in this repo?
Thank you for sharing the code, this is exactly what I need! I must get facial landmarks on art portraits. But I'm struggling to get it working since a week.
I´m using Python=2.7, menpo=0.8.1. Installing compatible packages was already a challenge but now I´m getting this error when I try to run predict_landmarks.py::
NotFoundError (see above for traceback): Tensor name "heatmaps_network/conv_1/conv/bias" not found in checkpoint files ./model_foa/deep_heatmaps-60000.data-00000-of-00001
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
and
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file ./model_foa/deep_heatmaps-60000.data-00000-of-00001: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
I downloaded the model weights from this link and put it into the model_foa folder. I´m not even sure if this is correct?
However there is no deep_heatmaps-60000 and the downloaded files do not work. I get the above error when using the .meta, .index file or .data... file from dropbox.
I guess the correct file is missing? what is it supposed to be or where do I get it?
I am trying to open pdm_models. But when I try to open these files I am getting and error as below.
pdm_clm_functions.py", line 158, in feature_based_pdm_corr
pdm_temp = pickle.load(filehandler)
ModuleNotFoundError: No module named 'copy_reg\r'
Any idea why I can not load these models. I tried using python 2 and 3 both.
Thank you in advance.
Thanks for this great work!
Can you tell me how to train with my own dataset? I am a little confused with the construction of the dataset.
Can you help me? Thanks so much.
hi~ first of all, thanks a lot for your awesome work and open-source codes.
It seems that predict_landmarks.py
only produces the landmarks.
How to obtain the transfer results in the teaser, namely the rendered faces given the reference art works?
try:
pdm_temp = pickle.load(open(temp_model, "rb"))
except UnicodeDecodeError:
pdm_temp = pickle.load(open(temp_model, "rb"), fix_imports=True, encoding="latin1")
2021-08-02 15:47:16.855329: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7
Traceback (most recent call last):
File "/students/julyedu_623899/face_of_art/face-of-art/predict_landmarks.py", line 61, in
reuse=reuse, map_to_input_size=map_landmarks_to_original_image)
File "/students/julyedu_623899/face_of_art/face-of-art/deep_heatmaps_model_fusion_net.py", line 828, in get_landmark_predictions
p_pdm_lms = feature_based_pdm_corr(lms_init=init_lms, models_dir=pdm_models_dir, train_type='basic')
File "/students/julyedu_623899/face_of_art/face-of-art/pdm_clm_functions.py", line 169, in feature_based_pdm_corr
pdm_temp = pickle.load(filehandler)
EOFError: Ran out of input
Hello, I have an error while running the file.
Hello, I am a novice in the field of face key detection, thank you very much for sharing the model, I need to use your key detection model to detect the key points of cartoon characters in the task, so I want to ask you about this error?
hi, when I run predict_landmarks.py
os: ubuntu 18
Traceback (most recent call last):
File "predict_landmarks.py", line 59, in
reuse=reuse, map_to_input_size=map_landmarks_to_original_image)
File "/mnt/g/github/face-of-art/deep_heatmaps_model_fusion_net.py", line 822, in get_landmark_predictions
p_pdm_lms = feature_based_pdm_corr(lms_init=init_lms, models_dir=pdm_models_dir, train_type='basic')
File "/mnt/g/github/face-of-art/pdm_clm_functions.py", line 159, in feature_based_pdm_corr
pdm_temp = pickle.load(filehandler)
ModuleNotFoundError: No module named 'copy_reg\r'
I'm on Mac M2. When creating the v_env I can only work with a version of python3.8 or above. this causes issues as I am unable to install tensor flow 1.14 which is the only one that works with this code?
I was not able to install the code with python 2.7 because of the version conflicts on menpo.
I think a requirements.txt file with version fixing would be extremely useful to help others running the codes. Also, sample data and folders for testing would help too.
It is a very fun project and I would love to be able to repeat it.
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.