6.0.0-beta1
7/5/25

[#6418] Face recognition
Summary Face recognition
Queue Ansel
Type Enhancement
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester duck (at) obala (dot) net
Created 03/10/2008 (6326 days ago)
Due
Updated 06/29/2008 (6215 days ago)
Assigned 05/13/2008 (6262 days ago)
Resolved 06/29/2008 (6215 days ago)
Milestone
Patch No

History
06/29/2008 03:33:36 PM Michael Rubinsky Deleted Original Message
 
06/29/2008 03:33:27 PM Michael Rubinsky Deleted Original Message
 
06/29/2008 03:15:44 PM Michael Rubinsky State ⇒ Resolved
 
06/29/2008 03:15:25 PM Michael Rubinsky Comment #35 Reply to this comment
Adding a recent_faces block that display the last X faces.
Added, thanks.



...and with this commit, everything outstanding from this ticket is 
complete.  Yes, the face code still needs work, and the UI needs works 
as well, but I'm closing this ticket as it is getting hard for me to 
keep up with all the various patches in one ticket.  Please open a 
separate ticket for each further enhancement or bug...



Thanks.
06/29/2008 03:13:24 PM Michael Rubinsky Comment #34 Reply to this comment
Adding a block to display random faces.
This Block won't work with our current code - as I removed the random 
feature from Faces::allFaces() (see comment in the Faces.php file - 
but the gist of it is that it is incredibly resource intensive, and 
not compatible across all RDBMSs)
06/29/2008 03:01:54 PM Michael Rubinsky Comment #33 Reply to this comment
For  getRecentImages() we must allow the galleries selection in a
direct SQL query. Of course is impossible to run a SQL query with
thousands of gallery_id in the IN(...) clause. I attaching a patch,
maybe a little hacky but is all I can do for now.
Thought I had already committed this...committed now.
06/29/2008 02:34:06 PM Michael Rubinsky Comment #32 Reply to this comment
Misaligned faces are corrected now, there were more places in the code 
that had the "old" parameters.
06/29/2008 10:30:37 AM Duck Comment #31
New Attachment: face.png Download
Reply to this comment
...and you did see this commit, right?
Yes. and attached is the result
06/26/2008 04:07:42 PM Michael Rubinsky Comment #30 Reply to this comment
06/26/2008 04:02:19 PM Michael Rubinsky Comment #29 Reply to this comment
With the recent crop changes in Horde_Image_im my faces are cut
wrongly - out of place.
Would these by any change be being cropped on images that have already 
been run through Horde_Image_im::crop() ?  If so, there's not much we 
can do about that, it was a bug in Horde_Image that was saving the 
wrong canvas size for the cropped images.
06/26/2008 03:20:54 PM Duck Comment #28 Reply to this comment
With the recent crop changes in Horde_Image_im my faces are cut 
wrongly - out of place.
06/18/2008 10:16:42 AM Duck Comment #27
New Attachment: random_faces.php
Reply to this comment
Adding a block to display random faces.


06/18/2008 10:16:05 AM Duck Comment #26
New Attachment: recent_faces.php
Reply to this comment
Adding a recent_faces block that display the last X faces.
06/11/2008 10:40:53 PM Michael Rubinsky Deleted Original Message
 
06/11/2008 10:40:19 PM Michael Rubinsky Deleted Original Message
 
06/11/2008 10:39:54 PM Michael Rubinsky Deleted Original Message
 
06/11/2008 10:39:09 PM Michael Rubinsky Deleted Original Message
 
06/07/2008 12:50:01 AM Michael Rubinsky Comment #25 Reply to this comment
For  getRecentImages() we must allow the galleries selection in a
direct SQL query. Of course is impossible to run a SQL query with
thousands of gallery_id in the IN(...) clause. I attaching a patch,
maybe a little hacky but is all I can do for now.
It might be a little hacky, but I don't think it's all that bad...we 
already have a few other places in Ansel_Storage where we directly 
access the ansel_shares table either because it's necessary or for 
performance reasons.  Of course, we'll also have to remove the code in 
the beginning of that method that fills the galleries array if it's 
empty...or your new code will never execute ;)



Thanks.
06/05/2008 07:36:55 AM Duck Comment #24
New Attachment: getRecentImages.diff Download
Reply to this comment
  Just a note: if I import my large data set in
current Ansel code, PHP dies with memory exhausted fatal error as
Ansel will eat more than 128 MB of ram.
Do you know where it is exhausting the memory? During what operation?
The main problem is in the listGalleries() usage. With a really lot of 
galleries the list grows up to thousands of entries wherever we don't 
limit the results. This is done in block galleries selection and   
getRecentImages() method. We should limit gallery selection in the 
blocks parameters. For example if we count more then 50 galleries we 
should skip galleries selections or allow to jut enter the gallery id. 
For  getRecentImages() we must allow the galleries selection in a 
direct SQL query. Of course is impossible to run a SQL query with 
thousands of gallery_id in the IN(...) clause. I attaching a patch, 
maybe a little hacky but is all I can do for now.
06/04/2008 04:30:42 PM CVS Commit Comment #23 Reply to this comment
Changes have been made in CVS for this ticket:

   http://cvs.horde.org/diff.php/ansel/config/conf.xml?r1=1.42&r2=1.43&ty=u
   http://cvs.horde.org/co.php/ansel/faces/claim.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/custom.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/delete.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/face.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/gallery.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/image.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/img.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/name.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/report.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/savecustom.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/all.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/image.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/image_define.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/image_save.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/image_search.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/img.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/name.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/named.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/owner.php?r=1.1
   http://cvs.horde.org/co.php/ansel/faces/search/tabs.php?r=1.1
   http://cvs.horde.org/co.php/ansel/js/builder.js?r=1.1
   http://cvs.horde.org/co.php/ansel/js/cropper.js?r=1.1
   http://cvs.horde.org/co.php/ansel/js/src/builder.js?r=1.1
   http://cvs.horde.org/co.php/ansel/js/src/cropper.js?r=1.1
   http://cvs.horde.org/diff.php/ansel/lib/Ansel.php?r1=1.433&r2=1.434&ty=u
   http://cvs.horde.org/co.php/ansel/lib/Face.php?r=1.1
   http://cvs.horde.org/co.php/ansel/lib/Face/facedetect.php?r=1.1
   http://cvs.horde.org/co.php/ansel/lib/Face/opencv.php?r=1.1
   http://cvs.horde.org/diff.php/ansel/lib/Report.php?r1=1.7&r2=1.8&ty=u
   http://cvs.horde.org/diff.php/ansel/lib/Report/letter.php?r1=1.3&r2=1.4&ty=u
   http://cvs.horde.org/diff.php/ansel/lib/Report/mail.php?r1=1.3&r2=1.4&ty=u
   http://cvs.horde.org/diff.php/ansel/lib/Views/Image.php?r1=1.52&r2=1.53&ty=u
   
http://cvs.horde.org/diff.php/ansel/lib/Widget/Actions.php?r1=1.11&r2=1.12&ty=u
   http://cvs.horde.org/co.php/ansel/lib/Widget/ImageFaces.php?r=1.1
   http://cvs.horde.org/co.php/ansel/lib/Widget/OwnerFaces.php?r=1.1
   
http://cvs.horde.org/diff.php/ansel/scripts/sql/ansel.sql?r1=1.15&r2=1.16&ty=u
   http://cvs.horde.org/co.php/ansel/templates/faces/custom.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/faces/define.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/faces/face.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/faces/faces.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/faces/gallery.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/faces/image.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/faces/index.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/faces/search.inc?r=1.1
   http://cvs.horde.org/co.php/ansel/templates/tile/face.inc?r=1.1
   
http://cvs.horde.org/diff.php/ansel/templates/tile/image.inc?r1=1.27&r2=1.28&ty=u
   
http://cvs.horde.org/diff.php/ansel/templates/view/gallery.inc?r1=1.163&r2=1.164&ty=u
   http://cvs.horde.org/co.php/ansel/themes/cropper.css?r=1.1
   http://cvs.horde.org/diff.php/ansel/themes/screen.css?r1=1.47&r2=1.48&ty=u
06/04/2008 04:16:01 PM Michael Rubinsky Comment #22 Reply to this comment
A now version of Ansel_Report with setTitle and some missing
report_content config changes.
Awesome. Thanks.
06/04/2008 04:09:56 PM Michael Rubinsky Comment #21 Reply to this comment
.  Again, maybe from a missing patch?
Is a little hard for me provide patches for every single modification
since I run an older patched version.
Understood....but from our end it's more than a little difficult to 
apply patches that were generated from code that is _that_ much 
different from our current HEAD.  Regardless, we do appreciate the 
effort :)



  Just a note: if I import my large data set in
current Ansel code, PHP dies with memory exhausted fatal error as
Ansel will eat more than 128 MB of ram.
Do you know where it is exhausting the memory? During what operation?


06/03/2008 09:09:48 PM Duck Comment #20
New Attachment: report.diff Download
Reply to this comment
A now version of Ansel_Report with setTitle and some missing 
report_content config changes.
06/03/2008 08:02:00 AM Duck Comment #19 Reply to this comment
.  Again, maybe from a missing patch?
Is a little hard for me provide patches for every single modification 
since I run an older patched version. I will try to port al my ideas 
to current cvs state in the next days and then provide patches for 
every changed part. Just a note: if I import my large data set in 
current Ansel code, PHP dies with memory exhausted fatal error as 
Ansel will eat more than 128 MB of ram.


06/01/2008 06:49:15 PM Michael Rubinsky Comment #18 Reply to this comment
1) Looks like some style definitions are missing from the patch...I 
guessed as to what they should be, but maybe a diff against your 
screen.css would be helpful.





2) The Ansel_Report stuff that your using for the "Claim" 
functionality is broken...perhaps there are missing patches against 
Ansel_Report?  The issues I see are:



     - Currently, Ansel_Report *always* sends to the configured 
report-to address.  It looks to me like the face code attempts to pass 
Ansel_Report an identity object,  that I assume it's to get an email 
address from (assuming it's available).  I'm assuming there is also 
some missing checks for what to do if there is no valid email address 
in the user's identity?



     - There is no Ansel_Report#setTitle method, but the image code 
attempts to call it.  Again, maybe from a missing patch?
05/31/2008 05:24:40 AM Duck Comment #17
New Attachment: faces.sql Download
Reply to this comment
Sure.
05/31/2008 05:24:22 AM Michael Rubinsky Comment #16 Reply to this comment
Also, these php extensions require PHP5. Ansel needs to support PHP4 
as well.  Not a big deal, as we can use a proxy to wrap the affected 
calls.  Just more of an FYI to any one following this ticket, looking 
to use this functionality....you will need to be on PHP5 to use 
everything in this patch but the manual face cropping.
05/30/2008 08:03:58 PM Michael Rubinsky Comment #15 Reply to this comment
Can you provide the table definition for ansel_faces_index.....or any 
other tables besides ansel_faces that have been added?





Thanks.
05/13/2008 02:06:19 PM Duck Comment #14 Reply to this comment
Awesome. Can't wait to take a look at this.
Don't forget to install opencv or face_recognition PECL extension to 
detect faces and lib http://libpuzzle.pureftpd.org/project/libpuzzle 
for image similarities. I home I included all files in the tar.



If this patch will be accepted I will slowly post all my Ansel 
changes, as I don't like to run a completly separate source.
05/13/2008 01:42:06 PM Michael Rubinsky Comment #13
Assigned to Michael Rubinsky
State ⇒ Assigned
Reply to this comment
Awesome. Can't wait to take a look at this.



Thanks!
05/13/2008 11:53:05 AM Duck Comment #12
New Attachment: faces.tgz Download
Reply to this comment
I ported the face recognition part to Ansel snapshot from 12. may.
03/29/2008 06:09:19 PM Michael Rubinsky Comment #11
State ⇒ Accepted
Reply to this comment
Great. Thanks for the update.

I'll be out of town for the next two weeks, so I'll look at it when I 
get back.



Thanks again.
03/29/2008 06:03:58 PM Duck Comment #10 Reply to this comment
This looks very cool...do we have the most recent patch attached to
the ticket?
(If it is, it is missing the template files)
Is not. It is missing even the whole bitmap search and widgets. I plan 
to switch to Ansel next week. If there will not be any critical bugs I 
will try to find some time and merge my code with the last Ansel 
changes (API/Lightbox etc) and the I will try to provide a patch.
03/29/2008 05:56:40 PM Michael Rubinsky Comment #9 Reply to this comment
This looks very cool...do we have the most recent patch attached to
the ticket?
(If it is, it is missing the template files)


03/29/2008 04:44:19 PM Michael Rubinsky Comment #8 Reply to this comment
This looks very cool...do we have the most recent patch attached to 
the ticket?


03/24/2008 06:26:36 PM Duck Comment #7 Reply to this comment
I finished what I have in mind for the first part of face recognition 
implementation.



EDITING: It not just finds faces. User can edit results or create its 
on face by selecting a par of an image with JS. The owner can name the 
person of the image as users can notify the owner who is on the 
picture or tell him to remove themselves (using Ansel_Report).



BROWSING: You can browse the image collection and see where a name 
ocorrus on any image/gallery. Widgets for faces in image/gallery are 
also added.



SEARCHING: Additional to the classic name (text value) search, a 
bitmap search is added too. You can see which faces are similar to any 
face sorted by similartiy percentage. But I did not stop here. User 
can upload a custom image, select face range, and search if the person 
is in any of the galleries.
03/13/2008 10:35:05 AM Duck Comment #6
New Attachment: face7.jpeg Download
Reply to this comment
Now I am able to find even face similarities as show in the 
attachments screen shots. I will add an auto-completer for face names 
looking for similar faces form your past galleries that you already 
named. Then even a search faces by similarities. For example "to who I 
am smilar" search.
03/11/2008 02:06:18 PM Duck Comment #5
New Attachment: ansel-fr[2].tgz
Reply to this comment
Added an image widget to show persons names/faces on the image like on 
facebook. (thumbnails in widget display and divs over the image to 
show face name on mouserover). I still like to have an clime option 
using Ansel_Report so users can notify the gallery owner who is on the 
image (face has no name etc) etc.
03/10/2008 08:01:36 PM Duck Comment #4
New Attachment: ansel-fr[1].tgz
Reply to this comment
Updating the patch. Now the the face recognition can be turned off in 
the configuration.

Added an user driver to allow "user only" mode when you don't have a 
PECL extenssion installed.
03/10/2008 07:12:15 PM Duck Comment #3 Reply to this comment
Some OpenCV/PECL reference links:

Intel OpenCV home: http://www.intel.com/technology/computing/opencv/

Public source: http://sourceforge.net/projects/opencvlibrary/

OpenCV PECL extension: http://d.hatena.ne.jp/moriyoshi/20070314/1173838791

Face Detect only PECL extension: http://hirokawa.netflowers.jp/entry/4874/
03/10/2008 07:07:29 PM Duck Comment #2
New Attachment: face4.jpeg
Reply to this comment
Added the posiblitly to add accustom face range or move/enlarge/shrink 
that was found by the opencv libraty. I had still two things to do, 
after that I will re-create the patch.



I sued the Image Cropper UI 
(http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/) I found on 
http://scripteka.com/.
03/10/2008 03:03:02 PM Duck New Attachment: ansel-fr.tgz
 
03/10/2008 02:54:40 PM Duck Comment #1
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Face recognition
Queue ⇒ Ansel
Reply to this comment
Use OpenCV library to find faces in images. User can enter the 
(user)name of the person on the picture. So someone can browse faces 
or find images where he is on. I implemented the two PECL extensions I 
found on the net. There are some screen shoots in the zip.



An interface to allow user to select his own face rage will be nice 
too. But don't have time right now. But you never know ;)

Saved Queries