Socket
Socket
Sign inDemoInstall

fastface

Package Overview
Dependencies
23
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fastface

A face detection framework for edge devices using pytorch lightning


Maintainers
1

Readme

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 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc