Skip to content
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

Face detection #19

Closed
reinink opened this issue Jan 8, 2015 · 13 comments
Closed

Face detection #19

reinink opened this issue Jan 8, 2015 · 13 comments

Comments

@reinink
Copy link
Contributor

reinink commented Jan 8, 2015

It would be awesome to add face detection to the crop function. This might be a bit of a pipe dream. There is this PHP package. Also, could be good to look at this JavaScript project.

Function would work like this:

kayaks.jpg?w=500&h=500&crop=face
@darrenpowers
Copy link

Yes, something like www.imgix.com and www.cloudinary.com support would be fantastic.

@reinink
Copy link
Contributor Author

reinink commented Mar 4, 2015

And interestingly I don't think it would take TOO much to implement, but I'm not sure it makes sense to build face detection into Glide itself. This is better served as a separate package. I sort of keep hoping that a package will pop up...there is already a number of them in Javascript. (ie. http://facedetection.jaysalvat.com/).

If I were to make this package I would build it in such as way that it simply returned the coordinates of the faces, and didn't actually do the cropping itself. This would allow it to be used with any sort of image manipulation library...like Glide.

@barryvdh
Copy link
Member

barryvdh commented Mar 4, 2015

This was also discussed in Intervention/image: Intervention/image#75
I also looked at it but couldn't produce good results + it was very slow.

@reinink
Copy link
Contributor Author

reinink commented Mar 4, 2015

Yeah, someone who knows a thing or two about face detection needs to take the bull by the horns and make a good PHP library for this. I bet it would get used a LOT.

@reinink
Copy link
Contributor Author

reinink commented Mar 4, 2015

We maybe need to convince @jaysalvat with beer to create a PHP version of his JavaScript library. :)

@josegonzalez
Copy link

The problem is performance, or more specifically that certain tasks need to be written in C, delegated to other libraries - like image magic - or parallelized. All these things are annoying, and tbh solved better by other libraries/tools like thumbor.

@reinink
Copy link
Contributor Author

reinink commented Mar 4, 2015

Very fair point @josegonzalez, but if this can be done with JavaScript, surely it can also be done in PHP, no?

@josegonzalez
Copy link

Javascript gets web workers, which happen off the ui thread, can be parallelized and thus happen much faster than in PHP :(

@jaysalvat
Copy link

Hello all!

There are some PHP face detection projects.
https://github.com/mauricesvay/php-facedetection is one on them.

But beers are welcomed anyway :)

@estahn
Copy link

estahn commented Jun 18, 2015

thumbor's focal-point detection algorithm for facials and features is implemented through OpenCV (http://opencv.org). They also implement what they call "Lazy Detection" which is nothing more then a image processing queue based on redis.

@reinink
Copy link
Contributor Author

reinink commented Dec 20, 2015

Closing this issue for now. I love the idea of face detection in Glide, but it's too big of a feature for me to handle at this point. Further, I think it's probably better better handled by a lower level library, as @josegonzalez suggested.

@reinink reinink closed this as completed Dec 20, 2015
@barryvdh
Copy link
Member

barryvdh commented Feb 5, 2016

For Javascript, there is: https://github.com/jwagner/smartcrop.js
So if anybody feels the urge to pick this up, I suggest to make a port ;)

@reinink
Copy link
Contributor Author

reinink commented Feb 5, 2016

Awesome @barryvdh, I hadn't seen this one before. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants