face recognition

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

face recognition

Benny Malengier
Hi,

Is there somebody who has time to investigate adding face recognition to media objects?
I find a simple script:
http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/
or
http://code.google.com/p/pyfaces/

Idea would be: in the media reference part a button: select face (active only if the python part is installed), which opens a dialog with all detected faces. Selecting one and pressing OK, sets the image reference region to that face.
Well, perhaps there is a nicer way to integrate this.

Benny

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: face recognition

DS Blank
On Jan 5, 2011, at 5:36 AM, Benny Malengier <[hidden email]> wrote:

Hi,

Is there somebody who has time to investigate adding face recognition to media objects?
I find a simple script:
http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/
or
http://code.google.com/p/pyfaces/

Idea would be: in the media reference part a button: select face (active only if the python part is installed), which opens a dialog with all detected faces. Selecting one and pressing OK, sets the image reference region to that face.
Well, perhaps there is a nicer way to integrate this.


This would be easy to add the OpenCV part, and not too hard to then associate each region with a person. Note that OpenCV (open computer vision) is a large library, but should run on most platforms. As a robotics researcher I have used it often---nice idea to use Gramps!

-Doug


Benny
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: face recognition

robhealey1
Dear Benny and Doug:

I have checked out this face_detect.py code and this howto!  I like it and I like the idea of it too!  I know that I would be very interested in seeing it in Gramps!!!

I am truly curious when running the face_detect.py script and giving it an image, what does it use for reference material to identify the faces in the image???

Sincerely yours,
Rob G. Healey


On Wed, Jan 5, 2011 at 3:24 AM, Doug Blank <[hidden email]> wrote:
On Jan 5, 2011, at 5:36 AM, Benny Malengier <[hidden email]> wrote:

Hi,

Is there somebody who has time to investigate adding face recognition to media objects?
I find a simple script:
http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/
or
http://code.google.com/p/pyfaces/

Idea would be: in the media reference part a button: select face (active only if the python part is installed), which opens a dialog with all detected faces. Selecting one and pressing OK, sets the image reference region to that face.
Well, perhaps there is a nicer way to integrate this.


This would be easy to add the OpenCV part, and not too hard to then associate each region with a person. Note that OpenCV (open computer vision) is a large library, but should run on most platforms. As a robotics researcher I have used it often---nice idea to use Gramps!

-Doug


Benny
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: face recognition

Duncan Lithgow-5
On 6 January 2011 05:32, Rob Healey <[hidden email]> wrote:
> Dear Benny and Doug:
>
> I have checked out this face_detect.py code and this howto!  I like it and I
> like the idea of it too!  I know that I would be very interested in seeing
> it in Gramps!!!
>
> I am truly curious when running the face_detect.py script and giving it an
> image, what does it use for reference material to identify the faces in the
> image???

Presumably it's biometrics. I wouldn't get too hopeful, I've tried
Picasa 3 from google and it has face recognition built in. It's not
terrible, but it's not that great in my view either. Add to that the
fact that we'll be giving it several generation of people with similar
features. So, I look forward to seeing how well it works.

Duncan

--
'The unconsidered life is not worth living' - Socrates

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: face recognition

DS Blank
On Fri, Jan 7, 2011 at 5:59 PM, Duncan Lithgow <[hidden email]> wrote:

> On 6 January 2011 05:32, Rob Healey <[hidden email]> wrote:
>> Dear Benny and Doug:
>>
>> I have checked out this face_detect.py code and this howto!  I like it and I
>> like the idea of it too!  I know that I would be very interested in seeing
>> it in Gramps!!!
>>
>> I am truly curious when running the face_detect.py script and giving it an
>> image, what does it use for reference material to identify the faces in the
>> image???
>
> Presumably it's biometrics. I wouldn't get too hopeful, I've tried
> Picasa 3 from google and it has face recognition built in. It's not
> terrible, but it's not that great in my view either. Add to that the
> fact that we'll be giving it several generation of people with similar
> features. So, I look forward to seeing how well it works.

Well, I'm impressed! I've attached a patch to [1] that uses Nick's
Person Gallery Gramplet (of course temporarily) to demonstrate the
code.

There is an attached image there that I tried with my family pictures.
Identified a variety of ages of faces. Note that this only does face
detection, not recognition.

For more information on how this works, see [2]. You could train the
system to find any type of items.

-Doug

[1] - http://www.gramps-project.org/bugs/view.php?id=4531
[2] - http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html

> Duncan
>
> --
> 'The unconsidered life is not worth living' - Socrates
>
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any company
> that requires sensitive data to be transmitted over the Web.   Learn how to
> best implement a security strategy that keeps consumers' information secure
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: face recognition

Nick Hall-6
Doug,

I can't get it to work with Ubuntu.

I installed |python-opencv and changed the import to:

import opencv as cv

but there appears to be no LoadImage function (or cv||LoadImage).

What library should I be using?

Nick.

|
Doug Blank wrote:

> On Fri, Jan 7, 2011 at 5:59 PM, Duncan Lithgow <[hidden email]> wrote:
>  
>> On 6 January 2011 05:32, Rob Healey <[hidden email]> wrote:
>>    
>>> Dear Benny and Doug:
>>>
>>> I have checked out this face_detect.py code and this howto!  I like it and I
>>> like the idea of it too!  I know that I would be very interested in seeing
>>> it in Gramps!!!
>>>
>>> I am truly curious when running the face_detect.py script and giving it an
>>> image, what does it use for reference material to identify the faces in the
>>> image???
>>>      
>> Presumably it's biometrics. I wouldn't get too hopeful, I've tried
>> Picasa 3 from google and it has face recognition built in. It's not
>> terrible, but it's not that great in my view either. Add to that the
>> fact that we'll be giving it several generation of people with similar
>> features. So, I look forward to seeing how well it works.
>>    
>
> Well, I'm impressed! I've attached a patch to [1] that uses Nick's
> Person Gallery Gramplet (of course temporarily) to demonstrate the
> code.
>
> There is an attached image there that I tried with my family pictures.
> Identified a variety of ages of faces. Note that this only does face
> detection, not recognition.
>
> For more information on how this works, see [2]. You could train the
> system to find any type of items.
>
> -Doug
>
> [1] - http://www.gramps-project.org/bugs/view.php?id=4531
> [2] - http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html
>
>  
>> Duncan
>>
>> --
>> 'The unconsidered life is not worth living' - Socrates
>>
>> ------------------------------------------------------------------------------
>> Gaining the trust of online customers is vital for the success of any company
>> that requires sensitive data to be transmitted over the Web.   Learn how to
>> best implement a security strategy that keeps consumers' information secure
>> and instills the confidence they need to proceed with transactions.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> Gramps-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>
>>    
>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand
> malware threats, the impact they can have on your business, and how you
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>
>
>  

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: face recognition

DS Blank
On Thu, Jan 13, 2011 at 10:41 AM, Nick Hall <[hidden email]> wrote:
> Doug,
>
> I can't get it to work with Ubuntu.

I'm using Ubuntu 11.04.

> I installed |python-opencv and changed the import to:
>
> import opencv as cv
>
> but there appears to be no LoadImage function (or cv||LoadImage).

There is no opencv.LoadImage (for some reason) but there is
cv.LoadImage. You should be able to import cv directly:

$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>> cv.__file__
'/usr/lib/pymodules/python2.6/cv.so'
>>>

That took me a while to figure out. Perhaps other Ubuntu's don't have
the same interface?

-Doug

> What library should I be using?
>
> Nick.
>
> |
> Doug Blank wrote:
>>
>> On Fri, Jan 7, 2011 at 5:59 PM, Duncan Lithgow <[hidden email]>
>> wrote:
>>
>>>
>>> On 6 January 2011 05:32, Rob Healey <[hidden email]> wrote:
>>>
>>>>
>>>> Dear Benny and Doug:
>>>>
>>>> I have checked out this face_detect.py code and this howto!  I like it
>>>> and I
>>>> like the idea of it too!  I know that I would be very interested in
>>>> seeing
>>>> it in Gramps!!!
>>>>
>>>> I am truly curious when running the face_detect.py script and giving it
>>>> an
>>>> image, what does it use for reference material to identify the faces in
>>>> the
>>>> image???
>>>>
>>>
>>> Presumably it's biometrics. I wouldn't get too hopeful, I've tried
>>> Picasa 3 from google and it has face recognition built in. It's not
>>> terrible, but it's not that great in my view either. Add to that the
>>> fact that we'll be giving it several generation of people with similar
>>> features. So, I look forward to seeing how well it works.
>>>
>>
>> Well, I'm impressed! I've attached a patch to [1] that uses Nick's
>> Person Gallery Gramplet (of course temporarily) to demonstrate the
>> code.
>>
>> There is an attached image there that I tried with my family pictures.
>> Identified a variety of ages of faces. Note that this only does face
>> detection, not recognition.
>>
>> For more information on how this works, see [2]. You could train the
>> system to find any type of items.
>>
>> -Doug
>>
>> [1] - http://www.gramps-project.org/bugs/view.php?id=4531
>> [2] -
>> http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html
>>
>>
>>>
>>> Duncan
>>>
>>> --
>>> 'The unconsidered life is not worth living' - Socrates
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Gaining the trust of online customers is vital for the success of any
>>> company
>>> that requires sensitive data to be transmitted over the Web.   Learn how
>>> to
>>> best implement a security strategy that keeps consumers' information
>>> secure
>>> and instills the confidence they need to proceed with transactions.
>>> http://p.sf.net/sfu/oracle-sfdevnl
>>> _______________________________________________
>>> Gramps-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Protect Your Site and Customers from Malware Attacks
>> Learn about various malware tactics and how to avoid them. Understand
>> malware threats, the impact they can have on your business, and how you can
>> protect your company and customers by using code signing.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> Gramps-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>
>>
>>
>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: face recognition

Nick Hall-6
Doug,

Thanks.  I'm running an old version.  I'll have to upgrade.

Nick.


Doug Blank wrote:

> On Thu, Jan 13, 2011 at 10:41 AM, Nick Hall <[hidden email]> wrote:
>  
>> Doug,
>>
>> I can't get it to work with Ubuntu.
>>    
>
> I'm using Ubuntu 11.04.
>
>  
>> I installed |python-opencv and changed the import to:
>>
>> import opencv as cv
>>
>> but there appears to be no LoadImage function (or cv||LoadImage).
>>    
>
> There is no opencv.LoadImage (for some reason) but there is
> cv.LoadImage. You should be able to import cv directly:
>
> $ python
> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  
>>>> import cv
>>>> cv.__file__
>>>>        
> '/usr/lib/pymodules/python2.6/cv.so'
>  
>
> That took me a while to figure out. Perhaps other Ubuntu's don't have
> the same interface?
>
> -Doug
>
>  
>> What library should I be using?
>>
>> Nick.
>>
>> |
>> Doug Blank wrote:
>>    
>>> On Fri, Jan 7, 2011 at 5:59 PM, Duncan Lithgow <[hidden email]>
>>> wrote:
>>>
>>>      
>>>> On 6 January 2011 05:32, Rob Healey <[hidden email]> wrote:
>>>>
>>>>        
>>>>> Dear Benny and Doug:
>>>>>
>>>>> I have checked out this face_detect.py code and this howto!  I like it
>>>>> and I
>>>>> like the idea of it too!  I know that I would be very interested in
>>>>> seeing
>>>>> it in Gramps!!!
>>>>>
>>>>> I am truly curious when running the face_detect.py script and giving it
>>>>> an
>>>>> image, what does it use for reference material to identify the faces in
>>>>> the
>>>>> image???
>>>>>
>>>>>          
>>>> Presumably it's biometrics. I wouldn't get too hopeful, I've tried
>>>> Picasa 3 from google and it has face recognition built in. It's not
>>>> terrible, but it's not that great in my view either. Add to that the
>>>> fact that we'll be giving it several generation of people with similar
>>>> features. So, I look forward to seeing how well it works.
>>>>
>>>>        
>>> Well, I'm impressed! I've attached a patch to [1] that uses Nick's
>>> Person Gallery Gramplet (of course temporarily) to demonstrate the
>>> code.
>>>
>>> There is an attached image there that I tried with my family pictures.
>>> Identified a variety of ages of faces. Note that this only does face
>>> detection, not recognition.
>>>
>>> For more information on how this works, see [2]. You could train the
>>> system to find any type of items.
>>>
>>> -Doug
>>>
>>> [1] - http://www.gramps-project.org/bugs/view.php?id=4531
>>> [2] -
>>> http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html
>>>
>>>
>>>      
>>>> Duncan
>>>>
>>>> --
>>>> 'The unconsidered life is not worth living' - Socrates
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Gaining the trust of online customers is vital for the success of any
>>>> company
>>>> that requires sensitive data to be transmitted over the Web.   Learn how
>>>> to
>>>> best implement a security strategy that keeps consumers' information
>>>> secure
>>>> and instills the confidence they need to proceed with transactions.
>>>> http://p.sf.net/sfu/oracle-sfdevnl
>>>> _______________________________________________
>>>> Gramps-devel mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>>>
>>>>
>>>>        
>>> ------------------------------------------------------------------------------
>>> Protect Your Site and Customers from Malware Attacks
>>> Learn about various malware tactics and how to avoid them. Understand
>>> malware threats, the impact they can have on your business, and how you can
>>> protect your company and customers by using code signing.
>>> http://p.sf.net/sfu/oracle-sfdevnl
>>> _______________________________________________
>>> Gramps-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>>
>>>
>>>
>>>      
>
>
>  

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

image regions on textual reports

jerome
In reply to this post by DS Blank
Hi,


About face recognition and the ability to display regions on image, there is one limitation on current textual reports!

I often use regions on image: certificate (sign) or house as a portrait alternative (when there was no photo!).

But detailed textual reports use image instead of region. Reports based on GraphViz or Views properly display region but textual reports use an other method:

ReportUtils.insert_image(database, doc, photo, w_cm=4.0, h_cm=4.0)

    """
    Insert pictures of a person into the document.
    """

    object_handle = photo.get_reference_handle()
    media_object = database.get_object_from_handle(object_handle)
    mime_type = media_object.get_mime_type()
    if mime_type and mime_type.startswith("image"):
        filename = media_path_full(database, media_object.get_path())
        if os.path.exists(filename):
            doc.add_media_object(filename, "right", w_cm, h_cm)
        else:
            WarningDialog(_("Could not add photo to page"),
                          "%s: %s" % (filename, _('File does not exist')))

http://www.gramps-project.org/bugs/view.php?id=2513

My first idea was to try to update ThumbNails.py, def get_thumbnail_image(), def get_thumbnail_path() or ReportUtils.insert_image() !
But I was not able to understand how thumbnails were managed...


Note, by searching this "feature request", I found others related request to this feature:

* Zoom needed for Image reference regions preview
http://www.gramps-project.org/bugs/view.php?id=2802 
* Label for image reference region needs to be visible in gramps
http://www.gramps-project.org/bugs/view.php?id=2833
* avoid inverted values on media_ref region
http://www.gramps-project.org/bugs/view.php?id=3842


Any idea how to properly display regions on textual reports ?



regards,
Jérôme


--- En date de : Jeu 13.1.11, Doug Blank <[hidden email]> a écrit :

> De: Doug Blank <[hidden email]>
> Objet: Re: [Gramps-devel] face recognition
> À: "Nick Hall" <[hidden email]>
> Cc: "Gramps Development List" <[hidden email]>
> Date: Jeudi 13 janvier 2011, 17h10
> On Thu, Jan 13, 2011 at 10:41 AM,
> Nick Hall <[hidden email]>
> wrote:
> > Doug,
> >
> > I can't get it to work with Ubuntu.
>
> I'm using Ubuntu 11.04.
>
> > I installed |python-opencv and changed the import to:
> >
> > import opencv as cv
> >
> > but there appears to be no LoadImage function (or
> cv||LoadImage).
>
> There is no opencv.LoadImage (for some reason) but there
> is
> cv.LoadImage. You should be able to import cv directly:
>
> $ python
> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more
> information.
> >>> import cv
> >>> cv.__file__
> '/usr/lib/pymodules/python2.6/cv.so'
> >>>
>
> That took me a while to figure out. Perhaps other Ubuntu's
> don't have
> the same interface?
>
> -Doug
>
> > What library should I be using?
> >
> > Nick.
> >
> > |
> > Doug Blank wrote:
> >>
> >> On Fri, Jan 7, 2011 at 5:59 PM, Duncan Lithgow
> <[hidden email]>
> >> wrote:
> >>
> >>>
> >>> On 6 January 2011 05:32, Rob Healey <[hidden email]>
> wrote:
> >>>
> >>>>
> >>>> Dear Benny and Doug:
> >>>>
> >>>> I have checked out this face_detect.py
> code and this howto!  I like it
> >>>> and I
> >>>> like the idea of it too!  I know that I
> would be very interested in
> >>>> seeing
> >>>> it in Gramps!!!
> >>>>
> >>>> I am truly curious when running the
> face_detect.py script and giving it
> >>>> an
> >>>> image, what does it use for reference
> material to identify the faces in
> >>>> the
> >>>> image???
> >>>>
> >>>
> >>> Presumably it's biometrics. I wouldn't get too
> hopeful, I've tried
> >>> Picasa 3 from google and it has face
> recognition built in. It's not
> >>> terrible, but it's not that great in my view
> either. Add to that the
> >>> fact that we'll be giving it several
> generation of people with similar
> >>> features. So, I look forward to seeing how
> well it works.
> >>>
> >>
> >> Well, I'm impressed! I've attached a patch to [1]
> that uses Nick's
> >> Person Gallery Gramplet (of course temporarily) to
> demonstrate the
> >> code.
> >>
> >> There is an attached image there that I tried with
> my family pictures.
> >> Identified a variety of ages of faces. Note that
> this only does face
> >> detection, not recognition.
> >>
> >> For more information on how this works, see [2].
> You could train the
> >> system to find any type of items.
> >>
> >> -Doug
> >>
> >> [1] - http://www.gramps-project.org/bugs/view.php?id=4531
> >> [2] -
> >> http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html
> >>
> >>
> >>>
> >>> Duncan
> >>>
> >>> --
> >>> 'The unconsidered life is not worth living' -
> Socrates
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------------
> >>> Gaining the trust of online customers is vital
> for the success of any
> >>> company
> >>> that requires sensitive data to be transmitted
> over the Web.   Learn how
> >>> to
> >>> best implement a security strategy that keeps
> consumers' information
> >>> secure
> >>> and instills the confidence they need to
> proceed with transactions.
> >>> http://p.sf.net/sfu/oracle-sfdevnl
> >>>
> _______________________________________________
> >>> Gramps-devel mailing list
> >>> [hidden email]
> >>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
> >>>
> >>>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Protect Your Site and Customers from Malware
> Attacks
> >> Learn about various malware tactics and how to
> avoid them. Understand
> >> malware threats, the impact they can have on your
> business, and how you can
> >> protect your company and customers by using code
> signing.
> >> http://p.sf.net/sfu/oracle-sfdevnl
> >> _______________________________________________
> >> Gramps-devel mailing list
> >> [hidden email]
> >> https://lists.sourceforge.net/lists/listinfo/gramps-devel
> >>
> >>
> >>
> >
>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them.
> Understand
> malware threats, the impact they can have on your business,
> and how you
> can protect your company and customers by using code
> signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>


     

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: image regions on textual reports

DS Blank
On Fri, Jan 14, 2011 at 11:12 AM, jerome <[hidden email]> wrote:

> Hi,
>
>
> About face recognition and the ability to display regions on image, there is one limitation on current textual reports!
>
> I often use regions on image: certificate (sign) or house as a portrait alternative (when there was no photo!).
>
> But detailed textual reports use image instead of region. Reports based on GraphViz or Views properly display region but textual reports use an other method:
>
> ReportUtils.insert_image(database, doc, photo, w_cm=4.0, h_cm=4.0)
>
>    """
>    Insert pictures of a person into the document.
>    """
>
>    object_handle = photo.get_reference_handle()
>    media_object = database.get_object_from_handle(object_handle)
>    mime_type = media_object.get_mime_type()
>    if mime_type and mime_type.startswith("image"):
>        filename = media_path_full(database, media_object.get_path())
>        if os.path.exists(filename):
>            doc.add_media_object(filename, "right", w_cm, h_cm)
>        else:
>            WarningDialog(_("Could not add photo to page"),
>                          "%s: %s" % (filename, _('File does not exist')))
>
> http://www.gramps-project.org/bugs/view.php?id=2513
>
> My first idea was to try to update ThumbNails.py, def get_thumbnail_image(), def get_thumbnail_path() or ReportUtils.insert_image() !
> But I was not able to understand how thumbnails were managed...
>
>
> Note, by searching this "feature request", I found others related request to this feature:
>
> * Zoom needed for Image reference regions preview
> http://www.gramps-project.org/bugs/view.php?id=2802
> * Label for image reference region needs to be visible in gramps
> http://www.gramps-project.org/bugs/view.php?id=2833
> * avoid inverted values on media_ref region
> http://www.gramps-project.org/bugs/view.php?id=3842
>
>
> Any idea how to properly display regions on textual reports ?

I'd be interested in this too. It looks like the interface
doc.add_media_object(filename, "right", w_cm, h_cm) expects a
filename, which it then opens and manages. Perhaps then the easiest
method would be to make a tempfile (with possible cache) that is an
extract of the region. We already do this in NarrWeb, so it would be
just a matter of doing the same for gramps-gtk proper.

if Gramps already uses a temp directory for making temp images, let's
reuse that. Else, let's create one. Then put the narrweb image
functionality into a core library. We can put the face detection stuff
there too (of course it will only work with the right versions of
opencv). The patch on the face detection feature request has a few
other utility functions for moving between pixbuf, PIL, and cv.

-Doug

>
>
> regards,
> Jérôme
>
>
> --- En date de : Jeu 13.1.11, Doug Blank <[hidden email]> a écrit :
>
>> De: Doug Blank <[hidden email]>
>> Objet: Re: [Gramps-devel] face recognition
>> À: "Nick Hall" <[hidden email]>
>> Cc: "Gramps Development List" <[hidden email]>
>> Date: Jeudi 13 janvier 2011, 17h10
>> On Thu, Jan 13, 2011 at 10:41 AM,
>> Nick Hall <[hidden email]>
>> wrote:
>> > Doug,
>> >
>> > I can't get it to work with Ubuntu.
>>
>> I'm using Ubuntu 11.04.
>>
>> > I installed |python-opencv and changed the import to:
>> >
>> > import opencv as cv
>> >
>> > but there appears to be no LoadImage function (or
>> cv||LoadImage).
>>
>> There is no opencv.LoadImage (for some reason) but there
>> is
>> cv.LoadImage. You should be able to import cv directly:
>>
>> $ python
>> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
>> [GCC 4.4.5] on linux2
>> Type "help", "copyright", "credits" or "license" for more
>> information.
>> >>> import cv
>> >>> cv.__file__
>> '/usr/lib/pymodules/python2.6/cv.so'
>> >>>
>>
>> That took me a while to figure out. Perhaps other Ubuntu's
>> don't have
>> the same interface?
>>
>> -Doug
>>
>> > What library should I be using?
>> >
>> > Nick.
>> >
>> > |
>> > Doug Blank wrote:
>> >>
>> >> On Fri, Jan 7, 2011 at 5:59 PM, Duncan Lithgow
>> <[hidden email]>
>> >> wrote:
>> >>
>> >>>
>> >>> On 6 January 2011 05:32, Rob Healey <[hidden email]>
>> wrote:
>> >>>
>> >>>>
>> >>>> Dear Benny and Doug:
>> >>>>
>> >>>> I have checked out this face_detect.py
>> code and this howto!  I like it
>> >>>> and I
>> >>>> like the idea of it too!  I know that I
>> would be very interested in
>> >>>> seeing
>> >>>> it in Gramps!!!
>> >>>>
>> >>>> I am truly curious when running the
>> face_detect.py script and giving it
>> >>>> an
>> >>>> image, what does it use for reference
>> material to identify the faces in
>> >>>> the
>> >>>> image???
>> >>>>
>> >>>
>> >>> Presumably it's biometrics. I wouldn't get too
>> hopeful, I've tried
>> >>> Picasa 3 from google and it has face
>> recognition built in. It's not
>> >>> terrible, but it's not that great in my view
>> either. Add to that the
>> >>> fact that we'll be giving it several
>> generation of people with similar
>> >>> features. So, I look forward to seeing how
>> well it works.
>> >>>
>> >>
>> >> Well, I'm impressed! I've attached a patch to [1]
>> that uses Nick's
>> >> Person Gallery Gramplet (of course temporarily) to
>> demonstrate the
>> >> code.
>> >>
>> >> There is an attached image there that I tried with
>> my family pictures.
>> >> Identified a variety of ages of faces. Note that
>> this only does face
>> >> detection, not recognition.
>> >>
>> >> For more information on how this works, see [2].
>> You could train the
>> >> system to find any type of items.
>> >>
>> >> -Doug
>> >>
>> >> [1] - http://www.gramps-project.org/bugs/view.php?id=4531
>> >> [2] -
>> >> http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html
>> >>
>> >>
>> >>>
>> >>> Duncan
>> >>>
>> >>> --
>> >>> 'The unconsidered life is not worth living' -
>> Socrates
>> >>>
>> >>>
>> >>>
>> ------------------------------------------------------------------------------
>> >>> Gaining the trust of online customers is vital
>> for the success of any
>> >>> company
>> >>> that requires sensitive data to be transmitted
>> over the Web.   Learn how
>> >>> to
>> >>> best implement a security strategy that keeps
>> consumers' information
>> >>> secure
>> >>> and instills the confidence they need to
>> proceed with transactions.
>> >>> http://p.sf.net/sfu/oracle-sfdevnl
>> >>>
>> _______________________________________________
>> >>> Gramps-devel mailing list
>> >>> [hidden email]
>> >>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> ------------------------------------------------------------------------------
>> >> Protect Your Site and Customers from Malware
>> Attacks
>> >> Learn about various malware tactics and how to
>> avoid them. Understand
>> >> malware threats, the impact they can have on your
>> business, and how you can
>> >> protect your company and customers by using code
>> signing.
>> >> http://p.sf.net/sfu/oracle-sfdevnl
>> >> _______________________________________________
>> >> Gramps-devel mailing list
>> >> [hidden email]
>> >> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>> >>
>> >>
>> >>
>> >
>>
>> ------------------------------------------------------------------------------
>> Protect Your Site and Customers from Malware Attacks
>> Learn about various malware tactics and how to avoid them.
>> Understand
>> malware threats, the impact they can have on your business,
>> and how you
>> can protect your company and customers by using code
>> signing.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> Gramps-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>
>
>
>
>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: image regions on textual reports

robhealey1
Dear Doug:

I think it would be a great idea to be able to have the same functionality that is in NarWeb to be modular so that it can be used by other reports too!

I really like the face_detection patch that you have for PersonGallery, but it caused a segmentation fault for me!  I believe tht it would be nice to have these functions in the same file as talked about above...

+1

Sincerely yours,
Rob G. Healey

On Fri, Jan 14, 2011 at 8:27 AM, Doug Blank <[hidden email]> wrote:
On Fri, Jan 14, 2011 at 11:12 AM, jerome <[hidden email]> wrote:
> Hi,
>
>
> About face recognition and the ability to display regions on image, there is one limitation on current textual reports!
>
> I often use regions on image: certificate (sign) or house as a portrait alternative (when there was no photo!).
>
> But detailed textual reports use image instead of region. Reports based on GraphViz or Views properly display region but textual reports use an other method:
>
> ReportUtils.insert_image(database, doc, photo, w_cm=4.0, h_cm=4.0)
>
>    """
>    Insert pictures of a person into the document.
>    """
>
>    object_handle = photo.get_reference_handle()
>    media_object = database.get_object_from_handle(object_handle)
>    mime_type = media_object.get_mime_type()
>    if mime_type and mime_type.startswith("image"):
>        filename = media_path_full(database, media_object.get_path())
>        if os.path.exists(filename):
>            doc.add_media_object(filename, "right", w_cm, h_cm)
>        else:
>            WarningDialog(_("Could not add photo to page"),
>                          "%s: %s" % (filename, _('File does not exist')))
>
> http://www.gramps-project.org/bugs/view.php?id=2513
>
> My first idea was to try to update ThumbNails.py, def get_thumbnail_image(), def get_thumbnail_path() or ReportUtils.insert_image() !
> But I was not able to understand how thumbnails were managed...
>
>
> Note, by searching this "feature request", I found others related request to this feature:
>
> * Zoom needed for Image reference regions preview
> http://www.gramps-project.org/bugs/view.php?id=2802
> * Label for image reference region needs to be visible in gramps
> http://www.gramps-project.org/bugs/view.php?id=2833
> * avoid inverted values on media_ref region
> http://www.gramps-project.org/bugs/view.php?id=3842
>
>
> Any idea how to properly display regions on textual reports ?

I'd be interested in this too. It looks like the interface
doc.add_media_object(filename, "right", w_cm, h_cm) expects a
filename, which it then opens and manages. Perhaps then the easiest
method would be to make a tempfile (with possible cache) that is an
extract of the region. We already do this in NarrWeb, so it would be
just a matter of doing the same for gramps-gtk proper.

if Gramps already uses a temp directory for making temp images, let's
reuse that. Else, let's create one. Then put the narrweb image
functionality into a core library. We can put the face detection stuff
there too (of course it will only work with the right versions of
opencv). The patch on the face detection feature request has a few
other utility functions for moving between pixbuf, PIL, and cv.

-Doug

>
>
> regards,
> Jérôme
>
>
> --- En date de : Jeu 13.1.11, Doug Blank <[hidden email]> a écrit :
>
>> De: Doug Blank <[hidden email]>
>> Objet: Re: [Gramps-devel] face recognition
>> À: "Nick Hall" <[hidden email]>
>> Cc: "Gramps Development List" <[hidden email]>
>> Date: Jeudi 13 janvier 2011, 17h10
>> On Thu, Jan 13, 2011 at 10:41 AM,
>> Nick Hall <[hidden email]>
>> wrote:
>> > Doug,
>> >
>> > I can't get it to work with Ubuntu.
>>
>> I'm using Ubuntu 11.04.
>>
>> > I installed |python-opencv and changed the import to:
>> >
>> > import opencv as cv
>> >
>> > but there appears to be no LoadImage function (or
>> cv||LoadImage).
>>
>> There is no opencv.LoadImage (for some reason) but there
>> is
>> cv.LoadImage. You should be able to import cv directly:
>>
>> $ python
>> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
>> [GCC 4.4.5] on linux2
>> Type "help", "copyright", "credits" or "license" for more
>> information.
>> >>> import cv
>> >>> cv.__file__
>> '/usr/lib/pymodules/python2.6/cv.so'
>> >>>
>>
>> That took me a while to figure out. Perhaps other Ubuntu's
>> don't have
>> the same interface?
>>
>> -Doug
>>
>> > What library should I be using?
>> >
>> > Nick.
>> >
>> > |
>> > Doug Blank wrote:
>> >>
>> >> On Fri, Jan 7, 2011 at 5:59 PM, Duncan Lithgow
>> <[hidden email]>
>> >> wrote:
>> >>
>> >>>
>> >>> On 6 January 2011 05:32, Rob Healey <[hidden email]>
>> wrote:
>> >>>
>> >>>>
>> >>>> Dear Benny and Doug:
>> >>>>
>> >>>> I have checked out this face_detect.py
>> code and this howto!  I like it
>> >>>> and I
>> >>>> like the idea of it too!  I know that I
>> would be very interested in
>> >>>> seeing
>> >>>> it in Gramps!!!
>> >>>>
>> >>>> I am truly curious when running the
>> face_detect.py script and giving it
>> >>>> an
>> >>>> image, what does it use for reference
>> material to identify the faces in
>> >>>> the
>> >>>> image???
>> >>>>
>> >>>
>> >>> Presumably it's biometrics. I wouldn't get too
>> hopeful, I've tried
>> >>> Picasa 3 from google and it has face
>> recognition built in. It's not
>> >>> terrible, but it's not that great in my view
>> either. Add to that the
>> >>> fact that we'll be giving it several
>> generation of people with similar
>> >>> features. So, I look forward to seeing how
>> well it works.
>> >>>
>> >>
>> >> Well, I'm impressed! I've attached a patch to [1]
>> that uses Nick's
>> >> Person Gallery Gramplet (of course temporarily) to
>> demonstrate the
>> >> code.
>> >>
>> >> There is an attached image there that I tried with
>> my family pictures.
>> >> Identified a variety of ages of faces. Note that
>> this only does face
>> >> detection, not recognition.
>> >>
>> >> For more information on how this works, see [2].
>> You could train the
>> >> system to find any type of items.
>> >>
>> >> -Doug
>> >>
>> >> [1] - http://www.gramps-project.org/bugs/view.php?id=4531
>> >> [2] -
>> >> http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html
>> >>
>> >>
>> >>>
>> >>> Duncan
>> >>>
>> >>> --
>> >>> 'The unconsidered life is not worth living' -
>> Socrates
>> >>>
>> >>>
>> >>>
>> ------------------------------------------------------------------------------
>> >>> Gaining the trust of online customers is vital
>> for the success of any
>> >>> company
>> >>> that requires sensitive data to be transmitted
>> over the Web.   Learn how
>> >>> to
>> >>> best implement a security strategy that keeps
>> consumers' information
>> >>> secure
>> >>> and instills the confidence they need to
>> proceed with transactions.
>> >>> http://p.sf.net/sfu/oracle-sfdevnl
>> >>>
>> _______________________________________________
>> >>> Gramps-devel mailing list
>> >>> [hidden email]
>> >>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> ------------------------------------------------------------------------------
>> >> Protect Your Site and Customers from Malware
>> Attacks
>> >> Learn about various malware tactics and how to
>> avoid them. Understand
>> >> malware threats, the impact they can have on your
>> business, and how you can
>> >> protect your company and customers by using code
>> signing.
>> >> http://p.sf.net/sfu/oracle-sfdevnl
>> >> _______________________________________________
>> >> Gramps-devel mailing list
>> >> [hidden email]
>> >> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>> >>
>> >>
>> >>
>> >
>>
>> ------------------------------------------------------------------------------
>> Protect Your Site and Customers from Malware Attacks
>> Learn about various malware tactics and how to avoid them.
>> Understand
>> malware threats, the impact they can have on your business,
>> and how you
>> can protect your company and customers by using code
>> signing.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> Gramps-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>>
>
>
>
>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel