-
Notifications
You must be signed in to change notification settings - Fork 36
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
Use pychubby in android using Chaquopy sdk #24
Comments
@bharatkhadodra1996 thank you for your interest! So full transparency, I have no experience with |
Ok so I tried your given solution. I converted the new_lf.img to byte_array and passed it to my android file. When I try to create a bitmap with that byte array, null bitmap is created. So there maybe some issue with byte_array. |
Hmm, again, I am not an expert on |
Ok I solve that issue by saving file to device. One more issue I faced is my app crash because PyChubby is not able to handle some images. Maybe Dlib is not able to detecting the face or something I do not know the clear reason because there is no error log message about this. So can you tell me what can be the reason and how can I identify the error ? |
I think one possible reason is that the image is too big. Try resizing it (making it smaller) let me know if it helps:) Another possibility is that it did not find any face in the image and then this exception would be raised |
Image is not too big size, its around 100 kb. This is the error I got = There are some duplicates. I do not understand image is very clear and it is very easy to identify face landmarks then why it is throwing such error. |
Hmm, interesting. This is the part of the code that raises that exception: Lines 255 to 256 in 3d7916f
It basically means that there are duplicate landmark points detected by dlib. Honestly, I don't remember whether this would lead to some crazy problems inside of
Hope that helps |
I actually just checked and it seems like there is just a single duplicate landmark in your image. So I guess in this specific case it would make sense to not raise the I am a bit afraid to allow for duplicates in general because if there are 2 duplicate landmark points and there is an action that moves each of the duplicates to a new position that is different then it will basically become "unsolvable". Hope that makes sense:) |
Okay so basically you want me to clone pychubby project to my account. Comment the lines in detect.py file and then use it. |
yes:) |
Ok so I forked this project and made necessary changes. But I do not know how to use it now ? I mean I was writing pip install pychubby for the original project. So what I need to write to use this forked project ? |
Thank you for the response. It helped me a lot in my project. After completing all the process, my application size is around 200 MB. From 200 MB, 150+ MB is occupied by PyChubby. So Do you have any idea if I want to reduce the size or if I can use lite version of PyChubby ? |
So I would guess the space is taken by your dependencies (things you have in your virtual environment) Also, a completely different paradigm would be to write a HTTP server around |
Ok I will try this solution once my application is completed. |
@bharatkhadodra1996 I think you just need to find the right balance between speed and quality. The bigger the image the slower PyChubby is going to be. So try to find the image resolution that represents the right tradeoff for you |
Yes that's right. Currently I am working on it. |
The teeth whitening is definitely not something PyChubby can do (it just does warping). I would encourage you to look into generative models that could take your original image + prompt and generate a new one. Or a bit more oldschool approach would be using semantic segmentation to find the pixels that correspond to teeth and then manually overwrite those pixels:D |
@jankrepl I was thinking that I am getting the landmarks of face. So it is easy to recognize the teeth area using those landmark points. So can I do something with that in python ? |
Well, getting the mouth landmarks will still leave you with the problem of trying to segment things like gums, lips, teeth... Anyway, as mentioned above this is a problem unrelated to Good luck @bharatkhadodra1996 |
Ok sure. And thank you for all the help. @jankrepl |
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 ?
The text was updated successfully, but these errors were encountered: