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

fastface

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastface

A face detection framework for edge devices using pytorch lightning

  • 0.1.4
  • PyPI
  • Socket score

Maintainers
1

FastFace: Lightweight Face Detection Framework

PyPI Documentation Status Downloads PyPI - Python Version PyPI - License

Easy-to-use face detection framework, developed using pytorch-lightning.
Checkout documentation for more.

Key Features

  • :fire: Use pretrained models for inference with just few lines of code
  • :chart_with_upwards_trend: Evaluate models on different datasets
  • :hammer_and_wrench: Train and prototype new models, using pre-defined architectures
  • :rocket: Export trained models with ease, to use in production

Contents

Installation

From PyPI

pip install fastface -U

From source

git clone https://github.com/borhanMorphy/fastface.git
cd fastface
pip install .

Pretrained Models

Pretrained models can be accessable via fastface.FaceDetector.from_pretrained(<name>)

NameArchitectureConfigurationParametersModel SizeLink
lffd_originallffdoriginal2.3M9mbweights
lffd_slimlffdslim1.5M6mbweights

Demo

Using package

import fastface as ff
import imageio
from pytorch_lightning.utilities.model_summary import ModelSummary

# load image as RGB
img = imageio.imread("<your_image_file_path>")[:,:,:3]

# build model with pretrained weights
model = ff.FaceDetector.from_pretrained("lffd_original")
# model: pl.LightningModule

# get model summary
ModelSummary(model, max_depth=1)

# set model to eval mode
model.eval()

# [optional] move model to gpu
model.to("cuda")

# model inference
preds, = model.predict(img, det_threshold=.8, iou_threshold=.4)
# preds: {
#    'boxes': [[xmin, ymin, xmax, ymax], ...],
#    'scores':[<float>, ...]
# }

Using demo.py script

python demo.py --model lffd_original --device cuda --input <your_image_file_path>

sample output; alt text

Benchmarks

Following results are obtained with this repository

WIDER FACE

validation set results

NameEasyMediumHard
lffd_original0.8930.8660.758
lffd_slim0.8660.8540.742

Tutorials

References

Citations

@inproceedings{LFFD,
    title={LFFD: A Light and Fast Face Detector for Edge Devices},
    author={He, Yonghao and Xu, Dezhong and Wu, Lifang and Jian, Meng and Xiang, Shiming and Pan, Chunhong},
    booktitle={arXiv:1904.10633},
    year={2019}
}

Keywords

FAQs


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