GithubHelp home page GithubHelp logo

beaufortfrancois / shape-detection-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wicg/shape-detection-api

0.0 3.0 0.0 333 KB

Detection of shapes (faces, QR codes) in images

Home Page: https://wicg.github.io/shape-detection-api

License: Other

HTML 100.00%

shape-detection-api's Introduction

Shape Detection API Specification 🌠πŸŽ₯

This is the repository for shape-detection-api, an experimental API for detecting Shapes (e.g. Faces, Barcodes, Text) in live or still images on the Web by using accelerated hardware/OS resources.

You're welcome to contribute! Let's make the Web rock our socks off!

Introduction πŸ“˜

Photos and images constitute the largest chunk of the Web, and many include recognisable features, such as human faces, text or QR codes. Detecting these features is computationally expensive, but would lead to interesting use cases e.g. face tagging or detection of high saliency areas. Users interacting with WebCams or other Video Capture Devices have become accustomed to camera-like features such as the ability to focus directly on human faces on the screen of their devices. This is particularly true in the case of mobile devices, where hardware manufacturers have long been supporting these features. Unfortunately, Web Apps do not yet have access to these hardware capabilities, which makes the use of computationally demanding libraries necessary.

Use cases πŸ“·

QR/barcode/text detection can be used for:

  • user identification/registration, e.g. for voting purposes;
  • eCommerce, e.g. Walmart Pay;
  • Augmented Reality overlay, e.g. here;
  • Driving online-to-offline engagement, fighting fakes etc.

Face detection can be used for:

  • producing fun effects, e.g. Snapchat Lenses;
  • giving hints to encoders or auto focus routines;
  • user name tagging;
  • enhance accesibility by e.g. making objects appear larger as the user gets closer like HeadTrackr;
  • speeding up Face Recognition by indicating the areas of the image where faces are present.

Current Related Efforts and Workarounds πŸ”§

Some Web Apps -gasp- run Detection in Javascript. A performance comparison of some such libraries can be found here (note that this performance evaluation does not include e.g. WebCam image acquisition and/or canvas interactions).

Samsung Browser has a private API (click to unfold "Overview for Android", then search for "QR code reader").

TODO: compare a few JS/native libraries in terms of size and performance. On that, zxingjs2 has a list of alternative JS libraries.

Android Native Apps usually integrate ZXing (which amounts to adding ~560KB when counting core.jar, android-core.jar and android-integration.jar)).

OCR reader in Javascript are north of 1MB of size ()

Potential for misuse πŸ’Έ

Face Detection is an expensive operation due to the algorithmic complexity. Many requests, or demanding systems like a live stream feed with a certain frame rate, could slow down the whole system or greatly increase power consumption.

Platform specific implementation notes πŸ’»

Overview

What platforms support what detector?

Encoder Mac Android Win10 Linux ChromeOs
Face sw hw/sw sw ✘ ✘
QR/Barcode sw sw ✘ ✘ ✘
Text sw sw sw ✘ ✘

Android

Android provides both a stand alone software face detector and a interface to the hardware ones.

API uses... Release notes
FaceDetector Software based using the Neven face detector API Level 1, 2008
Vision.Face Software based Google Play services 7.2, Aug 2015
Camera2 Hardware API Level 21/Lollipop, 2014
Camera.Face (old) Hardware API Level 14/Ice Cream Sandwich, 2011

The availability of the actual hardware detection depends on the actual chip; according to the market share in 1H 2016 Qualcomm, MediaTek, Samsung and HiSilicon are the largest individual OEMs and they all have support for Face Detection (all the top-10 phones are covered as well):

Barcode/QR and Text detection is available via Google Play Services barcode and text, respectively.

Mac OS X / iOS

Mac OS X/iOS provides CIDetector and Vision Framework for Face, QR, Text and Rectangle detection in software or hardware.

API uses... Release notes
Vision Framework, Mac OS X Software and Hardware OS X v10.13, 2017
Vision Framework, iOS Software and Hardware IOS X v11.0, 2017
CIDetector, Mac OS X Software OS X v10.7, 2011
CIDetector, iOS Software iOS v5.0, 2011
AVFoundation Hardware iOS 6.0, 2012

Apple has supported Face Detection in hardware since the Apple A5 processor introduced in 2011.

Windows

Windows 10 has a FaceDetector class and support for Text Detection OCR.

Rendered URL πŸ“‘

The rendered version of this site can be found in https://wicg.github.io/shape-detection-api (if that's not alive for some reason try the rawgit rendering).

Examples and demos

https://wicg.github.io/shape-detection-api/#examples

Notes on bikeshedding 🚴

To compile, run:

curl https://api.csswg.org/bikeshed/ -F [email protected] -F force=1 > index.html

if the produced file has a strange size (i.e. zero), then something went terribly wrong; run instead

curl https://api.csswg.org/bikeshed/ -F [email protected] -F output=err

and try to figure out why bikeshed did not like the .bs :'(

shape-detection-api's People

Contributors

yellowdoge avatar reillyeon avatar huningxin avatar neotan avatar fujunwei avatar codeimpl avatar scheib avatar nadia-mint avatar

Watchers

François Beaufort avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.