Iniciar sesión

Redondela en Foto

Shotwell Faces Tool: Weekly Report 09, 10 & 11

::

[ NOTE: Spanish translation in http://sanva.net/blog/115/ ]

This last three weeks have been memorable, of course because having gone to GUADEC [1] —yes, nothing surprising at this time, everyone who have been at GUADEC are saying the same ;)

GUADEC has been a really good experience, not only for the talks but also for the interesting people we[a] have met —and we have actually met less people than others, and that's because staying at home[b] and being not really confidence about my spoken English. But I'm not writing this in a sad tone, of course, we've met nice people —maybe the best part was meeting my mentor, Lucas Beeler [2], in the main hacking space in the lobby of the faculty to talk about next weeks milestones to became this GSoC project a success, and ending talking about San Francisto, USA universities, etc.

I've also participated in the lightning talks with the other GNOME outreach program students talking about my project, and that was a really good way of having my first talk[c] —OK, only 2-3 minutes, but it's something. Thanks again[d] to Marina Zhurakhinskaya for convincing me. Also, after the talk, a couple of Igalia [3] guys have come to me to give me some tips about a potential third part of my project that I had mentioned in that talk —really nice guys, thanks for sharing (:

And well, going back to this series of reports main subject: I also have been working in the next stage of the project, fixing some bugs that had been reported last year. In the next weeks I'm going to start the integration of face detection and recognition programs into Shotwell —the harder stages but actually the tangible goal of the whole project.

[a] The we instead of I is because I went to GUADEC with my really motivated friend Santi.

[b] This year's GUADEC has been in the faculty of computer science at A Coruña, where I've been studying three years before moving to Santiago de Compostela.

[c] I haven't done anything similar even in Spanish —I'm waiting for the video to really see if I did it in a decent way ;)

[d] I've briefly met her in person (:

[1] http://guadec.org/

[2] http://yorba.org/about.html

[3] http://www.igalia.com/

Tags: [en], Planet GNOME, Google Summer of Code, Shotwell, GUADEC

Comentarios (0)

Shotwell Faces Tool: Informe Semanal 07 y 08

::

Estas últimas dos semanas he continuado el trabajo en la suite de pruebas, añadiendo reconocimiento facial utilizando para ello la clase FaceRecognizer de Philipp Wagner y unos scripts para ayudar en el proceso de testing. También he escrito las instrucciones para utilizar estos pequeños programas en [1] —pueden estar incompletas, pregunta lo que necesites ;)

Esto del reconocimiento facial parece que se trata sobretodo de recolectar caras para hacer una base de datos decente y realista con la que entrenar el modelo y luego tratar de reconocer a esa misma gente en otras fotos. Realmente hay muy poco código que enseñar: Desde que he descubierto, leído y entendido la nueva clase FaceRecognizer de OpenCV, el código escrito es realmente muy simple [2] —de hecho, mi tarea principal estas últimas dos semanas ha sido la de hacer pruebas, tratando de crear una base de datos decente con las caras de mis amigos para mejorar los resultados que estoy obteniendo en dichas pruebas: Sobre un 30% de precisión reconociendo gente —en algunos artículos que he leído se habla de una mayor precisión, pero tal precisión no parece ser muy real, ya que ellos están utilizando bases de datos de caras como la que puedes encontrar en [3], y no podemos esperar que los usuarios de Shotwell hagan ese tipo de fotos.

Así que dichas pruebas son reales. Quiero decir con esto que no hubo una preselección de las fotos que he utilizado. Simplemente he elegido 4 eventos —el mismo concepto que en Shotwell, i.e. fotos de la misma fecha—, y entrené un modelo con las caras autodetectadas —descartando algunas realmente malas, pero manteniendo algunas de una calidad digamos media las cuales se veía que empeorarían el modelo. Lo hice de esta forma porque creo que un usuario normal de Shotwell etiquetaría caras de estas características.

Luego he elegido otros eventos, he recolectado las caras presentes en cada uno de ellos utilizando facedetect, y he descartado los falsos positivos y la gente que no estaba presente en las muestras con las que entrené el modelo. Con esta aproximación estoy obteniendo más o menos un 30% de precisión en reconocimiento facial —pero es posible aumentar esta marca a algo así como un 50-70% descartando las caras de las personas con menos de 40 muestras en la base de datos con la que se entrenó el modelo. Así que podríamos esperar unos mejores resultados simplemente incrementando el tamaño de la base de datos de pruebas —pero he tratado de hacerlo de una forma que emulase un uso normal del programa...

Pero de todas formas creo que esto no debería ser muy molesto para los usuarios de Shotwell... Incluso teniendo una tasa de errores de un 70%, podemos tratar de minimizar la molestia de dichos errores. Dejadme que me explique: Al presionar Detectar Caras podríamos esperar que el programa trate de reconocer a las personas en la foto y pregunte algo del tipo ¿Es este Valentín Barros?... Si la persona de la foto no soy yo, tenemos un error, y el usuario debería presionar No, y luego escribir el nombre correcto —pero podríamos hacerlo de otra forma: No preguntaríamos al usuario si la cara pertenece a este o el otro, simplemente escribiríamos el nombre de la persona reconocida en el campo de texto al efecto, pero totalmente seleccionado. Si es un error, el usuario simplemente deberá escribir el nombre correcto, como si no hubiese reconocimiento facial de ningún tipo —y ya que el texto está completamente seleccionado el usuario ni siquiera tiene que presionar el botón de borrar. Y si el programa ha acertado, el usuario simplemente presionaría la tecla Intro o el botón Aceptar y el foco pasaría a la siguiente cara detectada —y, si ni siquiera es una cara, el usuario podría presionar Esc o Cancelar para descartarla.

¿Que os parece?

Por cierto, estaré en la GUADEC ;)

I am attending GUADEC at A Coruña, Spain

[a] Mi código es el que es realmente simple, pero es porque todo el trabajo duro al respecto lo ha hecho otra gente y ha sido incluido en OpenCV ;)

[1] https://github.com/Sanva/facedetect#simple-face-detection--recognition-test-suite-using-opencv

[2] http://docs.opencv.org/trunk/modules/contrib/doc/facerec/index.html

[3] http://www.cl.cam.ac.uk/research/dtg/attarchive/pub/data/att_faces.zip

NOTA: Esto es una traducción del original en inglés, aquí → http://sanva.net/blog/112/

Tags: Google Summer of Code, Shotwell

Comentarios (0)

Shotwell Faces Tool: Weekly Report 07 & 08

::

[ NOTE: Spanish translation in http://sanva.net/blog/113/ ]

This last two weeks I've continued the work on the test suite, adding face recognition using Philipp Wagner's FaceRecognizer class and some scripts to help doing the testing. I've also wrote the instructions to use all those tiny programs at [1] —it could be incomplete, please ask whatever you need ;)

This face recognition thing seems to be more about collect people faces to make a decent and realistic database to train the face recognition model and then try to recognize this same people in other photos. There is really few code to show: Since I discover, read and understand the new OpenCV FaceRecognizer class [2], the written code is really simple [a] —in fact, the main task of this last two weeks has been mainly to do tests, trying to make a decent faces-database of my friends to improve the results I'm getting from my tests: About 30% of accuracy recognizing people —in the articles I've read there are people talking about more accuracy, but such accuracy seems to be not so real, because they use face-databases like the one at [3], and we can't expect Shotwell users making that kind of photos.

So, those are real tests: I mean, there was no preselection of which photos I used. I've simply chosen 4 events —the same concept as in Shotwell, i.e. photos from the same date—, and I trained a model with the detected faces —discarding some really bad face-photos, but keeping some medium ones that I knew they would make a less good model. I've done it this way because I think that a normal Shotwell user would tag faces of this characteristics.

Then, I've chosen some other events, I've taken the face-photos from each of them using facedetect, and discard false positives and the people who aren't in the trained model. With this approach I'm getting about 30% of accuracy in face recognition —but I could increase it to about 50-70% if I discard all the face-photos from people with less than 40 face-samples in the training face-photos database. So, the point is that only increasing the size of the training face-photos database we could expect better results —but I tried to do it in a way that emulates a normal use of the program...

But I think that this could be not so annoying to Shotwell users... Even having 70% of errors, we can minimize the annoyance of having such error. Let me explain: When pressing detect faces, we can expect that the program will try to recognize the person in the photo and ask you Is this Valentín Barros?... If the person isn't me, that's an error, and the user has to press No, and then write the correct name —but we can make it differently: We wouldn't ask the user if the face belongs to someone, we can simply write his/her name in the text input, where the user would write it, but all selected. If it is an error, the user can simply write the correct name —since all text is selected he doesn't even need to select it and press backspace. If it is correct, the user press Enter key or OK button and the focus goes to the next autodetected face —and, if it isn't a face, the user can press Esc/Cancel to discard it.

What do you think about this?

By the way, I'll be attending GUADEC ;)

I am attending GUADEC at A Coruña, Spain

[a] My written code is really simple, but that's because all the hard work has been done by other people and collected in OpenCV ;)

[1] https://github.com/Sanva/facedetect#simple-face-detection--recognition-test-suite-using-opencv

[2] http://docs.opencv.org/trunk/modules/contrib/doc/facerec/index.html

[3] http://www.cl.cam.ac.uk/research/dtg/attarchive/pub/data/att_faces.zip

Tags: [en], Planet GNOME, Google Summer of Code, Shotwell

Comentarios (0)

Shotwell Faces Tool: Informe Semanal 05 y 06

::

Estas últimas dos semanas he estado trabajando en mejorar el conjunto de programas para probar la detección facial que puedes encontrar en [1].

He añadido un nuevo programa [2] escrito en Vala y llamado facedetect-test en la carpeta /test/. Con este programa puedes realizar una prueba de detección facial utilizando múltiples archivos de cascada con múltiples valores de escala, y el programa escribirá las imágenes procesadas que ha encontrado en /test/sources/ con las caras detectadas marcadas con rectángulos rojos. La utilidad de esta herramienta es la de tener una forma fácil de ver qué nivel de precisión podemos esperarnos al utilizar esta funcionalidad en Shotwell.

También estoy leyendo sobre reconocimiento facial, la siguiente fase de este proyecto, y probablemente la más difícil —y necesito seguir mejorando estos programas de prueba para ver realmente los resultados, ya que sería una pena integrar esto en Shotwell y luego encontrarnos con que es inútil. Pero en fin, la parte buena es que estoy mejorando mis habilidades utilizando OpenCV desde su nueva interfaz en C++ y eso luego me permitirá realizar una mejor integración en Shotwell —si todo va bien.

Ahora mismo estoy jugando con la nueva clase FaceRecognizer [3] de OpenCV para intentar implementar la funcionalidad de reconocimiento facial en estos programas de prueba, un objetivo que, si lo consigo, haría que el reconocimiento facial en Shotwell sea una posibilidad real.

[1] https://github.com/Sanva/facedetect

[2] https://github.com/Sanva/facedetect#test-program

[3] http://docs.opencv.org/trunk/modules/contrib/doc/facerec/facerec_api.html#FaceRecognizer

NOTA: Esto es una traducción del original en inglés, aquí → http://sanva.net/blog/110/

Tags: Google Summer of Code, Shotwell

Comentarios (0)

Shotwell Faces Tool: Weekly Report 05 & 06

::

[ NOTE: Spanish translation in http://sanva.net/blog/111/ ]

This last two weeks I've working on improving the simple face detection test suite you can see at [1].

I've added a new program [2] written in Vala and called facedetect-test in the folder /test/. With this program you can perform a face detection test using multiple cascade files and multiple scale values, and the program will output the processed images that where found at /test/sources/ folder with detected faces marked with red rectangles. The utility of this tool is to have an easy way of seeing what kind of accuracy we could expect when using this feature in Shotwell.

I'm also reading about face recognition, the next stage of this project, and probably the harder one —and I need to improve this face detection suite to actually see the results, because it would be really sad to integrate this in Shotwell and later find that it is useless. But well, the good part is that I'm improving my skills using OpenCV from it's new C++ interface and that would allow me to make a better Shotwell integration later —if all goes well.

Now I'm playing with the new OpenCV C++ FaceRecognizer class [3] to try to bring face recognition to this test suite, a goal that, if achieved, would make face recognition in Shotwell a real possibility.

[1] https://github.com/Sanva/facedetect

[2] https://github.com/Sanva/facedetect#test-program

[3] http://docs.opencv.org/trunk/modules/contrib/doc/facerec/facerec_api.html#FaceRecognizer

Tags: [en], Planet GNOME, Google Summer of Code, Shotwell

Comentarios (0)

Shotwell Faces Tool: Informe Semanal 03 y 04

::

El plan para estas últimas dos semanas era escribir un programa de ejemplo en Vala con GTK+ y OpenCV, para demostrar que podemos tener detección facial en Shotwell. He estado intentando luchar contra las incompatibilidades entre OpenCV y GKT+ 3, pero he perdido.

Yo pensaba que esto sería fácil, ya que yo ya había escrito algo de código para la funcionalidad de detección facial en Shotwell utilizando OpenCV al final del año pasado, pero el problema es que ahora Shotwell utiliza GTK+ 3, y el módulo highgui de OpenCV, el cual se utiliza para proveer de una interfaz simple pero multiplataforma —pero también para cargar imágenes IPL, el formato que espera OpenCV— utiliza GTK+ 2, por lo que no pueden estar en el mismo proceso.

Por lo tanto, dos problemas a los que he tenido que enfrentarme:

  • Dependencias entre los módulos objdetect y highgui de OpenCV: Los únicos módulos que son esenciales para la detección facial son core y objdetect, pero por alguna razón que desconozco, objdetect tiene dependencias con highgui así que la biblioteca highgui se incluye automáticamente en el binario si incluyes objdetect. He informado sobre el error en [1], pero lo han cancelado —se conoce que no les importa mucho la integración entre OpenCV y otros programas... En el reporte de error cancelado, han comentado que se puede compilar OpenCV sin highgui —y es correcto y todo funciona perfectamente, pero ello plantea dos problemas:
    • Estaríamos añadiendo la necesidad de compilar OpenCV —cosa que, por cierto, yo he hecho y no es para nada complicada— para poder compilar Shotwell.
    • No se si habría problemas con los binarios distribuidos de Shotwell —por ejemplo los de Ubuntu—, ya que estarían enlazados con una versión de OpenCV sin highgui, mientras que los binarios de OpenCV presentes en el sistema probablemente habrán sido compilados con él.
  • El otro problema es que, sin highgui, perdemos la habilidad de cargar imágenes en formato IPL, por lo que he necesitado encontrar una forma de convertir pixbufs de GDK —o surfaces de Cairo, por ejemplo— al formato IPL... y he estado buscando alguna forma de hacerlo pero simplemente no he encontrado nada —hasta que Álvaro Marcos Ramiro, un español que yo sabía que había hecho esto en el pasado —porque encontré ciertos fragmentos de código en los que se intuye que está haciéndolo, pero la parte importante, la conversión entre formatos, no estaba —contestó mi correo pidiéndole ayuda.

Así que el segundo problema está solucionado, pero sigue existiendo el problema con las dependencias entre los módulos objdetect y highgui, así que he continuado siguiendo una vía alternativa: He creado un programa independiente al cual llamará Shotwell para realizar la detección facial.

A partir de un programa de ejemplo que puedes encontrar en el tarball oficial de OpenCV [2] —en /samples/c/facedetect.cpp— he creado un programa que procesa un archivo de imagen e imprime la información de las caras que ha encontrado en ella —puedes verlo en [3], por favor consulta el README para más información sobre el mismo o, por supuesto, pregúntame lo que quieras.

He empezado a trabajar en la integración de esta nueva funcionalidad en Shotwell, pero ahora mismo me encuentro de nuevo trasteando con el programa de detección facial, ya que la gente de Yorba opina que es más importante probar que OpenCV puede realizar la tarea de la detección facial de una forma fiable, e incluso intentar realizar reconocimiento facial, algo que si funcionase bien sería impresionante.

[1] http://code.opencv.org/issues/2024

[2] http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.1/

[3] https://github.com/Sanva/facedetect

NOTA: Esto es una traducción del original en inglés, aquí → http://sanva.net/blog/108/

Tags: Google Summer of Code, Shotwell

Comentarios (0)

Shotwell Faces Tool: Weekly Report 03 & 04

::

[ NOTE: Spanish translation in http://sanva.net/blog/109/ ]

The schedule to this last two weeks was to write some demo code in Vala with GTK+ and OpenCV, to proof that we can get face detection feature in Shotwell. And I was trying to fight against OpenCV & GTK+ 3 incompatibilities, but I have lost.

I thought this would be easy, because I had written some working code to detect faces inside Shotwell using OpenCV at the end of last year. But the problem now is that Shotwell is using GTK+ 3, and the OpenCV highgui module, which is used to provide a simple multiplatform user interface —but also to load IPL images, the format that OpenCV functions expect— uses GTK+ 2, so they cannot be in the same process.

So, two problems I had to deal with:

  • OpenCV objdetect module dependencies with highgui module: The only modules that are essential to face detection are core and objdetect, but for some reason I don't know, objdetect have dependencies with highgui and so the highgui library is included in the binary if you include objdetect. I've submitted a bug for that at [1], but they canceled it —it seems that they don't care about integration of OpenCV with other programs... They said that I can compile OpenCV without highgui —and that's correct, everything works fine, but the problems are two:

    • We would be adding the need of compile OpenCV —it's easy, by the way, I didn't have any problem doing it— to compile Shotwell.
    • Idon't know if there will be problems with the binary distributed Shotwell packages —in Ubuntu for example— since they would be linked against some version of OpenCV with no highgui and the OpenCV binaries in the system would probably have been compiled with it.

  • The other problem is that, without highgui, we lose the ability to load IPL images, so I've needed to find a way to convert form GDK pixbufs —or Cairo surfaces— to IPL images... and I've been looking for some way to do it but I simply haven't found anything —until Álvaro Marcos Ramiro, one Spanish guy that I know he id this in the past —because I've found some fragments of his code and it's doing the thing, but the important part, the conversion between formats, was missing— answered my mail asking his help.

So, the second problem is solved, but there is still the problem with objdetect module dependencies with highgui module, so I've continued with and alternative way: I've created an independent program which would be called by Shotwell to perform face detection.

Starting from a test program you can find in the OpenCV official tarball [2] —in /samples/c/facedetect.cpp— I've created a helper program that process one image file and outputs it's faces information —you can see it in [3], please refer to the README file to get more info about the program or, of course, ask me whatever.

I started working on the integration of this new feature into Shotwell, but now I've returned to this simple program, since people at Yorba think that it is more important to proof that OpenCV can perform face detection in a reliable way, and also try to perform face recognition, one feature that would be really awesome if it works fine.

[1] http://code.opencv.org/issues/2024

[2] http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.1/

[3] https://github.com/Sanva/facedetect

Tags: [en], Planet GNOME, Google Summer of Code, Shotwell

Comentarios (2)

Shotwell Faces Tool: Informe Semanal 01 y 02

::

¡Hola a todos!

Ya que este es mi primer artículo que aparecerá en Planet GNOME, creo que debería presentarme: Mi nombre es Valentín Barros y estudio Ingeniería Informática en Santiago de Compostela. Este es mi segundo GSoC —de nuevo con Yorba— programando para añadir una nueva funcionalidad llamada Faces Tool a Shotwell.

El año pasado creé una más o menos usable —pero totalmente funcional— herramienta que permite etiquetar caras en fotos, de la misma forma que es posible hacerlo en ciertas redes sociales. Pero a esta herramienta le falta funcionalidad, y durante este GSoC continuaré su desarrollo, con el objetivo de tener detección facial en Shotwell al final del verano, para hacer que la tarea de etiquetar tus fotos sea algo más rápida.

Estas dos primeras semanas he estado instalando y probando algunas cosas como las últimas versiones de Vala, OpenCV, leyendo algunos viejos reportes de errores, documentación, páginas web... para tenerlo todo preparado para empezar a escribir código: La primera cosa que crearé será un programa de prueba escrito en Vala con GTK+ y OpenCV para probar que es factible tener la funcionalidad de detección facial en Shotwell.

Si quieres más detalles sobre este proyecto puedes echarle un vistazo a su propia página en el Redmine de Yorba, http://redmine.yorba.org/projects/shotwell/wiki/FacesTool . También tengo mi propia copia del repositorio de Shotwell en GitHub para mi código, https://github.com/Sanva/shotwell-gsoc .

NOTA: Esto es una traducción del original en inglés, aquí → http://sanva.net/blog/106/

Tags: Google Summer of Code, Shotwell

Comentarios (0)

Shotwell Faces Tool: Weekly Report 01 & 02

::

Hello everybody!

[ NOTE: Spanish translation in http://sanva.net/blog/107/ ]

Since this is my first post that will be in Planet GNOME, I think I should introduce myself: My name is Valentín Barros and I study Computer Engineering in Santiago de Compostela. This is my second GSoC —again with Yorba— programing to add a new feature called Faces Tool to Shotwell.

Last year I made a more or less usable —but fully functional— tool that allows you to tag people faces in your photos, just the way you already can do in some social networks. But this tool leaks some functionality, and this GSoC I'll continue developing it, with the goal of having facial detection in Shotwell by the end of the summer, to make the task of categorizing your photos a little less time-consuming.

This first two weeks I've been installing and testing some things like the last versions of Vala, OpenCV, and reading some old bug reports, documentation, websites... to have all prepared to start real coding: The first thing I'm going to create will be a demo application written in Vala with GTK+ and OpenCV to proof that it will be feasible to have face detection in Shotwell.

If you want more details about this project you can take at look at it's own page on Yorba's Redmine, http://redmine.yorba.org/projects/shotwell/wiki/FacesTool . I have my own copy of Shotwell's repository on GitHub to do my coding, https://github.com/Sanva/shotwell-gsoc .

Cheers!

Tags: [en], Planet GNOME, Google Summer of Code, Shotwell

Comentarios (2)

Añadiendo etiquetas posicionales a Shotwell: Informe semanal 12 (Último informe de este GSoC)

::

La semana pasada he finalizado mi investigación sobre el bug #3896, y he informado sobre él aquí, aquí y, de forma más precisa, aquí.

He propuesto parches para

y he estado trabajando en #3991 y #3939, pero estoy atascado en el #3991, así que no se si podré solucionarlo para antes del 22.

Realmente me gustaría seguir contribuyendo a Shotwell después del GSoC, pero creo que tener que trabajar y estudiar al mismo tiempo no me permitirá hacer gran cosa —quizá corregir algún error en mi tiempo libre. De todas formas, creo que después del GSoC seguiré trabajando en Shotwell hasta el 3 o el 4 de Septiembre.

La versión original de este informe se encuentra disponible aquí [en inglés] → http://lists.yorba.org/pipermail/shotwell/2011-August/002706.html

Tags: Google Summer of Code, Shotwell

Comentarios (0)

Redondela en Foto 8.6.11 - XHTML 1.0 Strict - CSS - Política de Privacidad