Coder Social home page Coder Social logo

menpo / lsfm Goto Github PK

View Code? Open in Web Editor NEW
494.0 31.0 117.0 653 KB

Large Scale Facial Model (LSFM) - an automatic pipeline for constructing 3D Morphable Models from large collections of facial meshes

Home Page: http://ibug.doc.ic.ac.uk/resources/lsfm/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

lsfm's Introduction

Large Scale Facial Model (LSFM)

This repository contains the code used to produce the Large Scale Facial Model (LSFM) presented in:

Large scale 3D Morphable Models J. Booth, A. Roussos, A. Ponniah, D. Dunaway, S. Zafeiriou. International Journal of Computer Vision (IJCV), April 2017

A 3D Morphable Model learnt from 10,000 faces J. Booth, A. Roussos, S. Zafeiriou, A. Ponniah, D. Dunaway. Proceedings of IEEE Int’l Conf. on Computer Vision and Pattern Recognition (CVPR), June 2016

It also provides documentation about the models themselves.

Installing and using the LSFM 3D Morphable Model construction pipeline

The code used to produce the LSFM models is contained within this repository and is completely open source under a BSD license. You are free to follow the code's documentation, which explains how to install this tool and run it yourself on a set of facial meshes to automatically build a 3D Morphable Model.

Acquiring the LSFM Models

The LSFM models were produced by using this software pipeline on the (proprietary) MeIn3D dataset. For full terms and conditions, and to request access to the models, please visit the LSFM website. For technical details on the models we provide, see MODELS.md.

lsfm's People

Contributors

jabooth avatar roussos 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

lsfm's Issues

maybe a bug?

The first 17 points are the jaw of the dlib 68 landmarks.
the code in lsfm/data/init.py
LANDMARK_MASK[:18] = False
may be changed to
LANDMARK_MASK[:17] = False
I'm not sure.

How to convert .obj file to .obj+.jpg

Thanks for your code.
I want to ask about the format of input.In the lsfm,inputs are .obj flie and its texture .jpg file.but i only have an .obj file which contains both geometry and texture information.how can i convert it to .obj+.jpg files?

List index out of range Error

I want to deal with the wrl file and the jpg file in simpleIput1/
If you need jpg example please email [email protected](my email adress)

However, met this error list out of range, so anyone know about this ?
Thanks.

----------------------This is Full error description ---------------------------------------

~$ lsfm -o simpleOut3/ -i simpleInput1/
Input directory provided - scanning for importable meshes
Found 3 input meshes under: simpleInput1
Outputting results to /home/li_gang/simpleOut3

****** 1. DENSE CORRESPONDENCE **********
Correspondence: [==========] 100% (3/3) - done.
****** 1. INITIAL PCA + PRUNE **********

Traceback (most recent call last):
File "/usr/local/bin/lsfm", line 4, in
import('pkg_resources').run_script('lsfm==1.1.0rc1', 'lsfm')
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 1453, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python3.5/dist-packages/lsfm-1.1.0rc1-py3.5.egg/EGG-INFO/scripts/lsfm", line 285, in
main(docopt(doc))
File "/usr/local/lib/python3.5/dist-packages/lsfm-1.1.0rc1-py3.5.egg/EGG-INFO/scripts/lsfm", line 281, in main
pca_and_prune(r, verbose=verbose)
File "/usr/local/lib/python3.5/dist-packages/lsfm-1.1.0rc1-py3.5.egg/EGG-INFO/scripts/lsfm", line 100, in pca_and_prune
verbose=True)
File "/usr/local/lib/python3.5/dist-packages/lsfm-1.1.0rc1-py3.5.egg/lsfm/model.py", line 14, in pca_and_weights
model = PCAModel(meshes, verbose=verbose)
File "/usr/local/lib/python3.5/dist-packages/menpo/model/pca.py", line 1199, in init
return_template=True, verbose=verbose)
File "/usr/local/lib/python3.5/dist-packages/menpo/math/linalg.py", line 125, in as_matrix
template = vectorizables[0]
File "/usr/local/lib/python3.5/dist-packages/menpo/base.py", line 497, in getitem
return self.callables[ slice ] ( )
IndexError: list index out of range

theory of nicp

Dear menpo grouper,

Really thanks for your excellent work and clean code!

When I benefit from your nicp, I also want to learn the theory and math detail.

Can you refer a paper or technology report to help me learn this?

Thanks again for your help.

Package Missing and LSFM not found

Hi,
I have successfully installed the menpo as instructed. However when I run the command C:>conda create -n lsfm -c menpo python=3.5 lsfm, it says:

Fetching package metadata .............
PackageNotFoundError: Package not found: '' Package missing in current win-64 ch
annels:

  • lsfm

However, when I run the command conda create -n lsfm python=3.5 -c menpo/lsfm The following happens:-

Fetching package metadata ....
WARNING: The remote server could not find the noarch directory for the
requested channel with url: https://conda.anaconda.org/menpo/lsfm

It is possible you have given conda an invalid channel. Please double-check
your conda configuration using conda config --show.

If the requested url is in fact a valid conda channel, please request that the
channel administrator create noarch/repodata.json and associated
noarch/repodata.json.bz2 files, even if noarch/repodata.json is empty.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.json
.........
Solving package specifications: .

Package plan for installation in environment E:\Codes\External_Libs\LSFM\Minicon
da2\envs\lsfm:

The following NEW packages will be INSTALLED:

pip:            9.0.1-py35_1
python:         3.5.3-0
setuptools:     27.2.0-py35_1
vs2015_runtime: 14.0.25123-0
wheel:          0.29.0-py35_0

Proceed ([y]/n)? y

To activate this environment, use:

activate lsfm

To deactivate this environment, use:

deactivate lsfm

for power-users using bash, you must source


After activation it is unable to recognize lsfm as a command
(lsfm) C:>lsfm --help
'lsfm' is not recognized as an internal or external command,
operable program or batch file.

I will greatly appreciate some help on this.
Regards
Syed

the path of the all_all_all.mat

I want to load the model by the menpo but i do not know the path of the all_all_all.mat, Can you give me some suggestuons?

import menpo3d.io as m3io
model = m3io.import_lsfm_model('./path/to/all_all_all.mat')
print(model)

lsfm: command not found

I'm interested in your work, and i first try i can run the code,but a second try i failed.
the mistake is :
lsfm: command not found.
thanks for you apply to me as soon as possible

01_MorphableModel.mat not found

I have downloaded basel face database. Please guide me how to download "01_MorphableModel.mat" file. it is not available on basel website.
i am waiting for your kind reply.
thanks

too few components after pca

I am very interested in your excellent work and i can run, but the components are too few, and it displays as follow:
retaining 99.7% of eigenvalues keeps 8 components using thousands pruned meshes only!

conda don't find lsfm

Hi,
I have an problem during installing with conda
if I do the given command

conda create -n lsfm -c menpo python=3.5 lsfm

the error occure:

PackageNotFoundError: Package not found: '' Package missing in current linux-64 channels:

  • lsfm
    You can search for packages on anaconda.org with
    anaconda search -t conda lsfm

but if I search it with:

anaconda search -t conda lsfm
it is shown:
Using Anaconda API: https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | ---------------
menpo/lsfm | | conda | linux-64, win-32, win-64, osx-64
Found 1 packages

I hope you can help me with that error.
Thanks.

Some errors

Hi, @jabooth

I use 25 face models(obj + texture file jpg) constructed by Photoscan, and then the code returns the following error message:

"LiuAng_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [ ] 4% (1/25) - 00:09:54 remaining
Sunguizhou_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [ ] 8% (2/25) - 00:09:12 remaining
Yangzhuosheng_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [= ] 12% (3/25) - 00:08:41 remaining
bingguangtao_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [= ] 16% (4/25) - 00:08:40 remaining
cuilixiang_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [== ] 20% (5/25) - 00:08:18 remaining
guiwenlong_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [== ] 24% (6/25) - 00:07:56 remaining
gulailiang_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [== ] 28% (7/25) - 00:07:25 remaining
heming_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [=== ] 32% (8/25) - 00:06:59 remaining
jijun_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [=== ] 36% (9/25) - 00:06:32 remaining
jiyang_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [==== ] 40% (10/25) - 00:06:14 remaining
linxiaofeng_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [==== ] 44% (11/25) - 00:05:53 remaining
liyang_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [==== ] 48% (12/25) - 00:05:28 remaining
liyuan_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [===== ] 52% (13/25) - 00:05:06 remaining
luting_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [===== ] 56% (14/25) - 00:04:41 remaining
pankexing_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [====== ] 60% (15/25) - 00:04:15 remaining
qianzhiqiang_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [====== ] 64% (16/25) - 00:03:50 remaining
sungongjian_lianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [====== ] 68% (17/25) - 00:03:23 remaining
sunxin_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [======= ] 72% (18/25) - 00:02:57 remaining
wangjianguo_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [======= ] 76% (19/25) - 00:02:32 remaining
xingwei_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [======== ] 80% (20/25) - 00:02:07 remaining
xuyuwen_mianbu_zhengyan_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [======== ] 84% (21/25) - 00:01:42 remaining
yanmengjie_open eyes_mod - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [======== ] 88% (22/25) - 00:01:15 remaining
Traceback (most recent call last):
File "D:/研究生相关/LSFM/lsfm-master/bin/lsfm", line 285, in
main(docopt(doc))
File "D:/研究生相关/LSFM/lsfm-master/bin/lsfm", line 269, in main
correspond_and_save(r, id_, path, verbose=verbose)
File "D:/研究生相关/LSFM/lsfm-master/bin/lsfm", line 76, in correspond_and_save
mesh = lio.import_mesh(path)
File "D:\研究生相关\LSFM\lsfm-master\lsfm\io.py", line 41, in import_mesh
if mesh.texture.pixels.dtype != np.float64:
AttributeError: 'TriMesh' object has no attribute 'texture'
"

The obj files have no problem, I can view them in MeshLab, so I don't know why all of them failed. Would you please give me some help.
Thanks.

How do I get the `01_MorphableModel.mat`?

Hi,
When i run this command ‘lsfm -i ./input_data/ -o ./output_data/’,it prints
The LSFM template needs to be initialized from the Basel Face Model.
Please run:

lsfm init ./path/to/01_MorphableModel.mat
I don't know how to get this file,can you help me?
thank you.

About cropped model

Hi,
Can you help me?I want to know what is the role of this code.it is in the 'lsfm/lsfm/io.py' line 144
# if name.endswith('_tri'): # masking_info = mio.import_pickle( # model_path.parent.parent / 'radial_mask_tri.pkl') # mdict['map_crop_to_full'] = masking_info['map_cropped_to_full'] # mdict['map_full_to_cropped'] = masking_info['map_full_to_cropped'] # name = name.split('_tri')[0]
and i want to get the cropped model what should i do?

AttributeError: 'TriMesh' object has no attribute 'texture'

Hi,I do not know whether this project were maintained. I am very interested in it.
my input dir are mesh obj and mtl and png ,but when i run the code it shows AttributeError: 'TriMesh' object has no attribute 'texture'.
(lsfm) lii@lii:~$ lsfm -o /media/lii/dataset/300id/output51 -i /media/lirui/dataset/300id/prepared51

Input directory provided - scanning for importable meshes
Found 4 input meshes under: /media/lii/dataset/300id/prepared51
Resuming processing for output directory: /media/lii/dataset/300id/output51
Current meshes are the same as the meshes in the input dir - resuming
Outputting results to /media/lii/dataset/300id/output51

****** 1. DENSE CORRESPONDENCE **********

Traceback (most recent call last):
File "/home/lii/anaconda3/envs/lsfm/bin/lsfm", line 285, in
main(docopt(doc))
File "/home/lii/anaconda3/envs/lsfm/bin/lsfm", line 269, in main
correspond_and_save(r, id_, path, verbose=verbose)
File "/home/lii/anaconda3/envs/lsfm/bin/lsfm", line 76, in correspond_and_save
mesh = lio.import_mesh(path)
File "/home/lii/anaconda3/envs/lsfm/lib/python3.5/site-packages/lsfm/io.py", line 41, in import_mesh
if mesh.texture.pixels.dtype != np.float64:
AttributeError: 'TriMesh' object has no attribute 'texture'

Thank you and look forward to your reply

how to get colour_model ?

thanks for your code

i notice LSFM could generate both shape and colour model. And in the mesh ,i notice colours are exist.

how to get colour_model?

can you give me some advice?

about lsfm model

hello, lstm is a excellent work! And i want use this face model to train an end to end network like improved 3ddfa, can you share lsfm model with me? I didn't find interface in iBug, my email is [email protected], thx!! or can you give me a url of MEin3D dataset?

e_values and e_vectors is []

When I run lsfm -i ./input_dir -o ./output_dir I get the following error:

...
RuntimeWarning: invalid value encountered in true_divide
  C = np.dot(X, X.conj().T) / (n - 1)
...
RuntimeWarning: invalid value encountered in double_scalars
  return self._total_variance() / self.original_variance()
...File "/home/miniconda3/envs/lsfm/lib/python3.5/site-packages/menpo/model/pca.py", line 214, in n_active_components
    raise ValueError(err_str)
ValueError: Tried setting n_active_components to 0.985 - value needs to be a float 0.0 < n_components < self._total_kept_variance_ratio (nan) or an integer 1 < n_components < self.n_components (0)

When I tried to debug I found out that the eigenvalues and eigenvectors are empty.

Do you have an idea how to fix this?

Various expressions

Did you use different expressions to build the 3DMM or only use the netural face? What if I use a collection of face meshes with varous expressions?

Filed to correspond

Hi,
When I load both balanced_frontal_face_aam_v0_py2.pkl in python2 and balanced_frontal_face_aam_v0_py3.pkl in python3, I always got the error that said FAILED TO CORRESPOND: ("Size of label '%s' for operand %d does not match previous terms." 'i', 1).

I have no idea about this error, but I guess it is because the functools.partial is involed in the fitter .pkl file, and when I read it from file to call, it got some error. And then cause error in correspond process.

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Hey there,

i got a brand new installation of conda but I receive an dependency issue when following the instructions from the CODE.md file. Any help is appreciated.

Best,
Mo

The error is as follows:

conda create -n lsfm -c menpo python=3.5 lsfm
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package python conflicts for:
python=3.5
lsfm -> python=3.5
lsfm -> docopt[version='>=0.6.2'] -> python[version='2.7.|3.4.|>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.6']


My System is :
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial

AttributeError: 'TriMesh' object has no attribute 'texture'

/home/parallels/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo3d/io/input/mesh/base.py:53: UserWarning: texture was found, but no tcoords were recovered, reverting to an untextured mesh.
warnings.warn('texture was found, but no tcoords were recovered, '
Traceback (most recent call last):
File "/home/parallels/anaconda3/envs/lsfm/bin/lsfm", line 285, in
main(docopt(doc))
File "/home/parallels/anaconda3/envs/lsfm/bin/lsfm", line 269, in main
correspond_and_save(r, id_, path, verbose=verbose)
File "/home/parallels/anaconda3/envs/lsfm/bin/lsfm", line 76, in correspond_and_save
mesh = lio.import_mesh(path)
File "/home/parallels/anaconda3/envs/lsfm/lib/python3.5/site-packages/lsfm/io.py", line 41, in import_mesh
if mesh.texture.pixels.dtype != np.float64:
AttributeError: 'TriMesh' object has no attribute 'texture'

About "INITIAL PCA + PRUNE" error

Hi,
when i run this command 'lsfm -i input_data -o output_data', I met some problems:

Input directory provided - scanning for importable meshes
Found 5 input meshes under: input_data
Resuming processing for output directory: D:\lsfm\lsfm\output_data
Current meshes are the same as the meshes in the input dir - resuming
Outputting results to D:\lsfm\lsfm\output_data

****** 1. DENSE CORRESPONDENCE **********

Correspondence: [==========] 100% (5/5) - done.

****** 1. INITIAL PCA + PRUNE **********
Traceback (most recent call last):
File "E:\Program Files (x86)\Anaconda2\envs\lsfm\Scripts\lsfm-script.py", line 284, in
main(docopt(doc))
File "E:\Program Files (x86)\Anaconda2\envs\lsfm\Scripts\lsfm-script.py", line 280, in main
pca_and_prune(r, verbose=verbose)
File "E:\Program Files (x86)\Anaconda2\envs\lsfm\Scripts\lsfm-script.py", line 99, in pca_and_prune
verbose=True)
File "E:\Program Files (x86)\Anaconda2\envs\lsfm\lib\site-packages\lsfm\model.py", line 14, in pca_and_weights
model = PCAModel(meshes, verbose=verbose)
File "E:\Program Files (x86)\Anaconda2\envs\lsfm\lib\site-packages\menpo\model\pca.py", line 1199, in init
return_template=True, verbose=verbose)
File "E:\Program Files (x86)\Anaconda2\envs\lsfm\lib\site-packages\menpo\math\linalg.py", line 125, in as_matrix
template = vectorizables[0]
File "E:\Program Files (x86)\Anaconda2\envs\lsfm\lib\site-packages\menpo\base.py", line 482, in getitem
return self._callablesslice_
IndexError: list index out of range

And another problem
E:\Program Files (x86)\Anaconda2\envs\lsfm\lib\site-packages\menpo\image\base.py:2652: MenpoDeprecationWarning: This method is no longer supported and will be removed in a future version of Menpo. Use .pixels_with_channels_at_back instead.
MenpoDeprecationWarning)
0 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [= ] 12% (1/8) - 00:00:16 remaining 1 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [== ] 25% (2/8) - 00:00:12 remaining 2 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [=== ] 37% (3/8) - 00:00:10 remaining 3 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [===== ] 50% (4/8) - 00:00:08 remaining 4 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [====== ] 62% (5/8) - 00:00:06 remaining 5 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [======= ] 75% (6/8) - 00:00:04 remaining 6 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [======== ] 87% (7/8) - 00:00:02 remaining 7 - FAILED TO CORRESPOND: Expected to find one face - found 0
Correspondence: [==========] 100% (8/8) - done.

too few components

I used over 1200 meshes to train lsfm, however I got only 4 components. Over 50 persons with different expressions were used. Visualizations of landmarks seem OK. Any ideas about this?

Question about the template

Hello,

I have a question for the facial template. I am following the tutorial to generate the facial template from the BFM--running lsfm init /path_to_directory/01_MorphableModel.mat. However, I feel something wrong with the template, for example, the topology of the eye seems to be wrong. Please see the picture below.

Can someone answer this question?

Thanks in advance!

image

FAILED TO CORRESPOND

Hello booth:
When I run "lsfm -i ./test -o ./out", An error occurred: FAILED TO CORRESPOND: 'LandmarkGroup' object has no attribute 'from_mask'. What's wrong, Please give me some tips. Thanks.

image

Can the code be applied to other categories?

Hello, I'm interested in your work, it really works excellent for facial meshes. But can it be applied to other meshes, like airplanes, cars in ShapeNet?
Looking forward to your reply, thank you.

About learning source code

Very great work!
I note that all of the construction pipeline is done through an executable file (i.e. lsfm). I want to know if it is possible to understand the calling process of the code in the whole construction pipeline.

AttributeError: 'ColouredTriMesh' object has no attribute 'texture'

I was using lsfm 1.0.0. I encountered "AttributeError: 'ColouredTriMesh' object has no attribute 'texture'" error. So I checked the code, it was in

def import_mesh(path):
if path.suffix == '.pkl' or path.suffix == '.gz':
mesh = import_pickle(path)
else:
mesh = m3io.import_mesh(path)
if mesh.texture.pixels.dtype != np.float64:
mesh.texture.pixels = normalize_pixels_range(mesh.texture.pixels)
return mesh

mesh = import_pickle(path) here I imported the template.pkl copied from "data".
I read the menpo "ColouredTriMesh" code, there is no attribute 'texture'" . ( version 0.7.7).

I am using ubuntu 14.04 with python 3.5. lsfm is 1.0.0, and it was installed with "conda install lsfm -c menpo".

Face Not Found

Hi James,

In certain cases the codes returns an error,

"MenpoDeprecation (Warning)
ST_0015 - FAILED TO CORRESPOND: Expected to find one face - found 0"

The input face is in WRL format. The code easily processes the rest of the images from the data set in the same file format. This particular file (ST_0015) does not have any errors. It opens up in 3D viewer software and I can easily import it in MATLAB. I can share the file privately if you want. I will appreciate some help on this problem.
Regards

conda failed to install lsfm

When I execute

conda create -n lsfm -c menpo python=3.5 lsfm

I got the following error on windows 10(x64):

Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Examining vs2015_runtime:   3%|█████▎                       | 1/34 [00:00<?, ?
Examining chardet:   6%|███████████                                                                                                                                                                                  | 2/34 [00:00
Examining cachecontrol:   9%|████████████████▏                                                                                                                                                                       | 3/34 
Examining requests:  12%|██████████████████████                                                                                                                                                                      | 
Examining wincertstore:  15%|███████████████████████████                                                                                                                                                          
Examining ca-certificates:  18%|███████████████████████████████▉                                                                                                                                             
Examining urllib3:  21%|██████████████████████████████████████▉                                                                                                                                       
Examining pyopenssl:  24%|████████████████████████████████████████████                                                                                                                           
Examining asn1crypto:  26%|█████████████████████████████████████████████████▏                                                                                                              
Examining html5lib:  29%|███████████████████████████████████████████████████████                                                                                                      
Examining cryptography-vectors:  32%|████████████████████████████████████████████████████████▌                                                                                      
Examining vc:  35%|████████████████████████████████████████████████████████████████████                                                                                  
Examining __cuda:  38%|████████████████████████████████████████████████████████████████████████▎                                                                    
Examining pysocks:  41%|█████████████████████████████████████████████████████████████████████████▋                                                                
 Examining cryptography:  44%|████████████████████████████████████████████████████████████████████████████▊                                                      
Examining msgpack-python:  47%|████████████████████████████████████████████████████████████████████████████████▍                                            
Examining win_inet_pton:  50%|██████████████████████████████████████████████████████████████████████████████████████                                   
Examining progress:  53%|█████████████████████████████████████████████████████████████████████████████████████████████▋                        
Examining wheel:  56%|████████████████████████████████████████████████████████████████████████████████████████████████████▌            
 Examining pip:  59%|███████████████████████████████████████████████████████████████████████████████████████████████████████████   
Examining packaging:  62%|█████████████████████████████████████████████████████████████████████████████████████████████████████████ 
Examining colorama:  65%|██████████████████████████████████████████████████████████████████████████████████████████████████████████
Examining idna:  68%|████████████████████████████████████████████████████████████████████████████████████████████████████████████
Examining python:  71%|███████████████████████████████████████████████████████████████████████████████████████████████████████████
Examining certifi:  74%|██████████████████████████████████████████████████████████████████████████████████████████████████████████ 
Examining six:  76%|████████████████████████████████████████████████████████████████████████████████████████████████████████████
 Examining webencodings:  79%|████████████████████████████████████████████████████████████████████████████████████████████████████████
Examining setuptools:  82%|█████████████████████████████████████████████████████████████████████████████████████████████████████████
Examining distlib:  85%|██████████████████████████████████████████████████████████████████████████████████████████████████████████ 
Examining pyparsing:  88%|█████████████████████████████████████████████████████████████████████████████████████████████████████████ 
Examining openssl:  91%|██████████████████████████████████████████████████████████████████████████████████████████████████████████
 Examining pycparser:  94%|█████████████████████████████████████████████████████████████████████████████████████████████████████████ 
Examining lockfile:  97%|██████████████████████████████████████████████████████████████████████████████████████████████████████████
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:



Package menpo3d conflicts for:
lsfm -> menpo3d[version='>=0.5.0,<0.6']
Package docopt conflicts for:
lsfm -> docopt[version='>=0.6.2']
Package menpodetect conflicts for:
lsfm -> menpodetect=0.4
Package python conflicts for:
lsfm -> python=3.5
Package vs2015_runtime conflicts for:
python=3.5 -> vs2015_runtime
Package vc conflicts for:
python=3.5 -> vc=14
Package menpofit conflicts for:
lsfm -> menpofit[version='>=0.4.1,<0.5']
Package pip conflicts for:
python=3.5 -> pip
Package joblib conflicts for:
lsfm -> joblib[version='>=0.9.4']

my conda is Miniconda3 v4.7.11

What can I do to fix this?

Cannot read geometry

I an very interested in your nice work, but when i run ,i have a problem.
my input dir is ply file and png, it displayed as follows
Input directory provided - scanning for importable meshes
Found 5 input meshes under: /media/lirui/dataset/300id/1
Outputting results to /media/lirui/dataset/300id/output2

****** 1. DENSE CORRESPONDENCE **********

ERROR: In /home/travis/miniconda/conda-bld/work/VTK-7.0.0/IO/PLY/vtkPLYReader.cxx, line 138
vtkPLYReader (0x55ed7fd77fc0): Cannot read geometry

ERROR: In /home/travis/miniconda/conda-bld/work/VTK-7.0.0/Common/Core/vtkDataArrayTemplate.txx, line 142
vtkFloatArray (0x55ed7fdb9180): Unable to allocate 6403935504 elements of size 4 bytes.

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

looking forward to your reply .Thanks

ValueError: zero component

Hi, I tested our pipeline providing with a single mesh, however, I encountered ValueError: Tried setting n_active_components to 0.985 - value needs to be a float 0.0 < n_components < self._total_kept_variance_ratio (nan) or an integer 1 < n_components < self.n_components (0).

My input contained 3 files with format .jpg, .mtl, .obj.

The log file is as follows:

Input directory provided - scanning for importable meshes
Found 1 input meshes under: input
Outputting results to /home/jingtao/lsfm/output


****** 1. DENSE CORRESPONDENCE **********

Correspondence: [==========] 100% (1/1) - done.


****** 1. INITIAL PCA + PRUNE **********

Allocated data matrix of size 1.22 MB (1 samples)
Building data matrix: [==========] 100% (1/1) - done.                           /home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/math/decomposition.py:136: RuntimeWarning: invalid value encountered in true_divide
  C = np.dot(X, X.conj().T) / (n - 1)

Retaining 98.50% of eigenvalues keeps 0 components
/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/model/pca.py:322: RuntimeWarning: invalid value encountered in double_scalars
  return self._total_variance() / self.original_variance()
ance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

 Runtime parameters:
   Objective type: Unknown!
   Coarsening type: METIS_CTYPE_SHEM
   Initial partitioning type: METIS_IPTYPE_EDGE
   Refinement type: METIS_RTYPE_FM
   Perform a 2-hop matching: No
   Number of balancing constraints: 1
   Number of refinement iterations: 0
   Random number seed: 212860
   Number of separators: 21860
   Compress graph prior to ordering: Yes
   Detect & order connected components separately: No
   Prunning factor for high degree vertices: -126523184.000000
   Allowed maximum load imbalance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

 Runtime parameters:
   Objective type: Unknown!
   Coarsening type: METIS_CTYPE_SHEM
   Initial partitioning type: METIS_IPTYPE_EDGE
   Refinement type: METIS_RTYPE_FM
   Perform a 2-hop matching: No
   Number of balancing constraints: 1
   Number of refinement iterations: 0
   Random number seed: 212860
   Number of separators: 21860
   Compress graph prior to ordering: Yes
   Detect & order connected components separately: No
   Prunning factor for high degree vertices: -129997568.000000
   Allowed maximum load imbalance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

 Runtime parameters:
   Objective type: Unknown!
   Coarsening type: METIS_CTYPE_SHEM
   Initial partitioning type: METIS_IPTYPE_EDGE
   Refinement type: METIS_RTYPE_FM
   Perform a 2-hop matching: No
   Number of balancing constraints: 1
   Number of refinement iterations: 0
   Random number seed: 212860
   Number of separators: 21860
   Compress graph prior to ordering: Yes
   Detect & order connected components separately: No
   Prunning factor for high degree vertices: -129742136.000000
   Allowed maximum load imbalance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

Traceback (most recent call last):
  File "/home/jingtao/anaconda3/envs/lsfm/bin/lsfm", line 285, in <module>
    main(docopt(__doc__))
  File "/home/jingtao/anaconda3/envs/lsfm/bin/lsfm", line 281, in main
    pca_and_prune(r, verbose=verbose)
  File "/home/jingtao/anaconda3/envs/lsfm/bin/lsfm", line 100, in pca_and_prune
    verbose=True)
  File "/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/lsfm/model.py", line 20, in pca_and_weights
    model.trim_components(retain_eig_cum_val)
  File "/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/model/pca.py", line 568, in trim_components
    self.n_active_components = n_components
  File "/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/model/pca.py", line 209, in n_active_components
    raise ValueError(err_str)
ValueError: Tried setting n_active_components to 0.985 - value needs to be a float 0.0 < n_components < self._total_kept_variance_ratio (nan) or an integer 1 < n_components < self.n_components (0)

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.