Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/evalphobia/face-detect-annotator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/evalphobia/face-detect-annotator

  • v0.1.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

face-detect-annotator

GoDoc License: MIT Release Build Status Go Report Card Code Climate BCH compliance

face-detect-annotator is a tool to detect faces from Image file by AWS Rekognition, Google Vision, Azure Computer Vision, Face++, OpenCV, Dlib, Pigo, TensorFlow

What's for?

Amazon advertise like "Our product is awesome!".

Google advocates like "Our AI is brilliant!!".

ML engineer says like "My top-noch model reach beyond the existing world!!!".

You may think, "Who is the winner?". Okay, let's decide the No.1.

Quick Usage

At first, install golang. And install dependensies.

Then, create binary file.

# Basic engines [pigo,azure,google,rekognition] (you can use these engines without OS dependencies or libraries)
$ go build -o face-detect-annotator ./cmd/face-detect-annotator-basic

# All engines
# $ go build -o face-detect-annotator ./cmd/face-detect-annotator-all
$ ./face-detect-annotator -h

Commands:

  help       show help
  detect     Detect faces from image file or csv list
  annotate   Annotate faces of image from --input TSV file

Subcommands

detect

detect command detecting faces from --input image file or csv list file.

$ ./face-detect-annotator detect -h

Detect faces from image file or csv list

Options:

  -h, --help                              display help information
  -i, --input                            *image dir path --input='/path/to/image_dir'
  -o, --output[=./output.tsv]            *output TSV file path --output='./output.tsv'
  -a, --all                               use all engines
  -e, --engine[=opencv,dlib,tensorflow]   comma separate Face Detect Engines --engine='opencv,dlib,pigo,tensorflow,rekognition,google,azure,face++'

For example, if you want to detect faces of images from the CSV file,

cat ./input,csv

path,count
myimages/foobar/001.jpg,1
myimages/foobar/002.jpg,1
myimages/foobar/003.jpg,0

With all of the engines,

$ FDA_AZURE_REGION=westus \
FDA_AZURE_SUBSCRIPTION_KEY=ZZZ \
GOOGLE_APPLICATION_CREDENTIALS=$HOME/google/service_account.json \
AWS_ACCESS_KEY_ID=XXX \
AWS_SECRET_ACCESS_KEY=ZZZ \
FACEPP_API_KEY=XXX \
FACEPP_API_SECRET=ZZZ \
./face-detect-annotator detector -i ./input.csv -o ./output.tsv  -e="rekognition,google,azure,face++,tensorflow,opencv,dlib,pigo"

[INFO] Use rekognition
[INFO] Use google
[INFO] Use azure
[INFO] Use face++
[INFO] Use tensorflow
[INFO] Use opencv
[INFO] Use dlib
[INFO] Use pigo
exec #: [2]
exec #: [1]
exec #: [0]

After a while, output.tsv will be created.

annotate

annotate command draw rectangle lines around faces from TSV file, generated from detect command.

$ ./face-detect-annotator annotate -h

Annotate faces of image from --input TSV file

Options:

  -h, --help    display help information
  -i, --input  *detector's output tsv file --input='/path/to/output.tsv'
$ ./face-detect-annotator annotate -i ./output.tsv

After a while, _annotated_ prefixed files will be created in the same directory of the given images.

$ tree

└── myimages
    └── foobar
        ├── _annotated_001.jpg
        ├── _annotated_002.jpg
        ├── _annotated_003.jpg
        ├── 001.jpg
        ├── 002.jpg
        └── 003.jpg

Example output

_annotated_01

_annotated_02

Environment variables

NameCommandDescription
FDA_ENGINE_ALLdetectUse all of the face detection engines.
FDA_ENGINE_DLIBdetectUse Dlib.
FDA_ENGINE_OPENCVdetectUse OpenCV.
FDA_ENGINE_PIGOdetectUse Pigo.
FDA_ENGINE_TFdetectUse TensorFlow.
FDA_ENGINE_REKOGNITIONdetectUse AWS Rekognition.
FDA_ENGINE_GOOGLEdetectUse Google Vision API.
FDA_ENGINE_AZUREdetectUse Azure Computer Vision API.
FDA_DLIB_MODEL_DIRdetect for DlibSpecify the directory path of model files for Dlib.
FDA_PIGO_CASCADE_FILEdetect for PigoSpecify the file path of a cascade file of Pigo.
FDA_OPENCV_CASCADE_FILEdetect for OpenCVSpecify the file path of a cascade file of OpenCV.
FDA_TF_MODEL_FILEdetect for TensorFloeSpecify the .pb file path of a model file for TensorFlow.
FDA_AZURE_REGIONdetect for AzureSpecify the region for Azure.
FDA_AZURE_SUBSCRIPTION_KEYdetect for AzureSpecify the subscription key for Azure.

Credit

This library depends on these awesome libraries,

FAQs

Package last updated on 01 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc