-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use image outside of LFW? #1
Comments
Yes, you can use the command-line argument |
Thanks for your quick reply! I just tried running it with an image outside of the dataset and it throws an error
`se tf.global_variables_initializer instead. During handling of the above exception, another exception occurred: Traceback (most recent call last): Am I doing something wrong? thank you |
Oh, sorry. I was a little confused. That was unfortunately not implemented yet. Though it is fairly to easily add it yourself: Looking at this line: https://github.com/slang03/dfi-tensorflow/blob/master/src/utils.py#L42 You currently need to put the image into the data directory in it's according name directory (E.g. Additionally you need to add all attributes manually to the It is sufficient to use -1/1 as attribute values. That should hopefully work. Our initial plan was to include an automatic svm regression for all attributes as this is how the lfw-attributes.txt was generated. Maybe if I find time I'll include in at some point in the future. Tell me if you are successful (or if not, what went wrong). |
I was able to run it now. I manually added -1/1 for all the attributes. Would you be able to point me towards a way of automatic generating the lfw-attributes for the image? Is that implementation open source at another repository? Also this is the result I got for this image. It seems to automatically crop the face...
lfw attributes line for this image:
thank you |
According to the lfw website, they have used this approach. Unfortunately I couldn't find an implementation for it.
Oh yes, we only implemented cropping. Feel free to adjust the code to enable scaling instead of cropping here and submit a PR of you want to, it should be pretty easy. Since I don't have access to any computer in the next weeks I can only accept PRs. |
Also make sure to have the facial features (eyes, mouth, nose) approximately aligned with those of the lfw dataset. As stated in the paper, the method works best for similar aligned pictures (hence the dataset is preprocessed by deepfunnel alignment) |
Ok. I manually aligned my input image to match one of Trump's images in terms of eye,nose and mouth and it worked great! Here's my input Asian: Black: Bald: Two quick questions if you don't mind ;)
thank you |
That might have several reasons such as that the nearest neighbor search delivered bad results for that specific person. On the other side, the algorithm is quite parameter sensitive so you might find better results with lower
It should be fairly easy as you only need to adjust the data loading methods in utils.py to your needs. It doesn't matter if the attributes are different from lfw as it is just used internally to find the I feel bad now for not making it dynamic in the first place but hardcoding the lfw paths etc. I can fix it in two months earliest so tell me if you need any help patching that yourself. |
Hi,
Is there a way to apply a transformation to an image that is not in the LFW dataset?
thank you
The text was updated successfully, but these errors were encountered: