ΒιΆΉΤΌΕΔ

IRFS Weeknotes #243

Published: 8 May 2017
  • Matt Haynes

    Matt Haynes

    Principal Web Developer

Welcome to the regular update from the Internet Research & Future Services team in ΒιΆΉΤΌΕΔ R&D, making new things on, for and with the internet.

IRFS consists of three - Data, Discovery and Experiences - each following a more specific theme of our section's broader research. From this edition of weeknotes we've decided to try something slightly different, with the author giving a more detailed insight into a piece of work from their team. As it's my turn I'll be talking about some of the face recognition work we've been doing in the Data Team.

Python Face Recognition using C++

As we've discussed recently we've been assessing face recognition technologies as part of our Content Analysis Toolkit project. Our aim is to find accurate methods of identifying and tracking on-screen personalities, we think there is a wealth of uses for this data but one of our main objectives is to help production staff search our digital archives.

One tool we have found to be especially useful is , a face recognition engine that allows us to identify where faces are in an image and then move onto identifying who the person is. SeetaFace offers a business friendly open source license which allows us to deliver face recognition technology at a lower cost. It also performs favourably in terms of speed and accuracy against other open source and commercial solutions we have tested.

Many of the tools we have been using as part of our Content Analysis project are written in Python, this is especially true of the machine learning and numerical computing frameworks such as , and more recently . In addition we have been using the framework to run analysis on video. SeetaFace itself though is written as a C++ library so we decided to write a Python binding for the project so as to integrate it more thoroughly.

There are multiple ways of writing a binding between Python and C/C++, one way is to use the tool. Cython is a small domain specific language that allows you to write Python C extensions using a language that is almost identical to Python itself. Cython converts your code into C and compiles into an extension ready for use. It also integrates easily with Python's setup.py method of building and distributing packages.

In order to expose the functionality from SeetaFace we needed to bind just a few C++ classes and structs to Python objects. Cython makes this incredibly easy, just a case of defining which interfaces your want to expose in a .pxd file and letting the Cython tools compile them into an extension. Below is an excerpt from our .pxd file, exposing SeetaFace's bounding box struct.

cdef extern from 'common.h' namespace 'seeta':
    cdef cppclass CRect 'seeta::Rect':
        int32t x
        int32t y
        int32t width
        int32t height

Once we have exposed classes and structures in a .pxd file we can use them in a Cython .pyx file. Again this file is compiled into a Python extension and enables us to write code that can use both Python and the exposed C types.

cdef CRect rect
rect.x = 0
rect.y = 0
rect.width = 128
rect.height = 128

The overhead of this wrapper between Python and C++ is very minimal, in our benchmarks we see the Cython version running almost at the same speeds. Also, there's some neat tricks that can be employed to make things faster still, an example is Cython's integration with Numpy arrays, where we can do strict type checking on the array data types and then pass around the pointers to the original array data - removing the need to copy potentially large bits of data between Python and C.

Now the functions from SeetaFace are exposed to Python we've been able to integrate the framework with our other analysis tools. It turned out to be refreshingly easy to integrate the C++ using Cython which is certainly something I'd recommend using again. Hopefully we'll be able to open source our efforts on the over the next few weeks.

And now some updates from the rest of the section.

Standards

Chris submitted a few minor changes to the Open Mobile Radio Interface (OMRI) Java API for smartphone radio receivers. This project is now being coordinated through . He also visited colleagues in MCUK to catch up with a few people about Web standards, including Andrew Evans (TV Platforms) and Rob Wadge (R&D IP Studio).

Olivier attended the W3C Advisory Committee Meeting in Beijing, this included the W3C Open day with members of the Chinese web community, as well as the main W3C Advisory Committee meeting, with good sessions on vision and strategy for the web platform. Olivier also featured on a panel on the needs of the Media and Entertainment industry for the web platform.

Tellybox

In the Tellybox project we've been thinking about our plans for the future - what we should do next, who we can collaborate with and what we want to achieve. As part of this, Joanne's been researching best practice on co-design with children. David's also been creating a presentation collating ideas from the collaboration workshop with the Red Button+ UX team.

Talking with machines

Henry has been working on our paper for IBC, describing the design process we have been developing for VUI UX & prototyping. He also had a nice holiday. Tom and Ant have been working on story editor and engine for the Rosina Sound project. The editor makes it easy to edit large stories and exports to API.AI and JSON. The engine will manage story states on Google ΒιΆΉΤΌΕΔ and Alexa.

Other Stuff

Libby's been talking with Martin Thorp who runs the CAD team about getting a laser cutter in Centre House, and got a tour of all the possible locations it could go. Tristan’s been setting up the β€œReinventing the news story” project; doing some background research, meeting people and kicking off recruitment for a developer and a journalist. Collecting examples of future news formats here:  Kristian finally attended UpFront, the ΒιΆΉΤΌΕΔ’s induction programme for new staff, and attended another Digital Signal Processing tutorial on image and video encoding.Henry  as part of the Haunted Festival in Brighton, β€œa weekend of installations and panel discussion exploring ways we understand and critique machine learning systems.”Publication of a written by Zillah and published by Reuters Institute for Journalism, Oxford University.

  • Internet Research and Future Services section

    The Internet Research and Future Services section is an interdisciplinary team of researchers, technologists, designers, and data scientists who carry out original research to solve problems for the ΒιΆΉΤΌΕΔ. Our work focuses on the intersection of audience needs and public service values, with digital media and machine learning. We develop research insights, prototypes and systems using experimental approaches and emerging technologies.

Rebuild Page

The page will automatically reload. You may need to reload again if the build takes longer than expected.

Useful links

Theme toggler

Select a theme and theme mode and click "Load theme" to load in your theme combination.

Theme:
Theme Mode: