Skip to main content

Extract Faces

A Python desktop app built with Qt for extracting PNG face crops from videos using forensicface. Play a video, draw a rectangular search area, choose an output folder, and configure the detector and extraction settings. The app also displays video dimensions, frame rate, duration, and media codecs.

Run locally

Requires Python 3.13 or newer. From this project folder:

uv sync
uv run extract-faces

Alternatively, install with pip install ., then run extract-faces or python -m extract_faces. Once published to PyPI, installation will be pip install extractfaces-gui.

Face detector setup

The app uses forensicface's SCRFD detector with optional attributes and embeddings disabled. Place its det_10g.onnx model at:

~/.forensicface/models/detection/scrfd/det_10g.onnx

On Windows, ~ means your user folder, such as C:\Users\rafael. See forensicface's model documentation for the layout and model credits. The app does not download model weights. CPU processing is the default; enable GPU only with a compatible GPU/runtime. Forensicface installs CUDA dependencies even when using CPU, so installation can be a large download. ONNX Runtime is constrained to the 1.25 series on all platforms because newer CUDA extras currently lack compatible Windows wheels.

Use the app

  1. Open a video with the file picker or drop a video file onto the app (the first local file is opened if several are dropped). Playback is silent. Metadata includes dimensions, frame rate, duration, and codecs when available.
  2. Pause or drag a rectangle on the preview. Detection searches that area in every processed frame. Clear the region to search the full frame.
  3. Choose an empty output folder, crop size multiplier, frames to skip, and start time. A multiplier of 2 doubles the detected box's dimensions; skipping 4 frames processes every fifth frame. Set Detector size (det_size) and Detection threshold (det_thresh) before extraction to configure SCRFD. Defaults are 320 and 0.5. Larger detector sizes take longer; lower thresholds may accept more false positives.
  4. Click Extract faces. Progress counts sampled frames. Cancel takes effect after the current detector operation; crops already saved are kept.

Click Show console output to expand the console pane. It captures Python standard output and errors, including forensicface initialization, progress, and extraction tracebacks, even while collapsed. The most recent 2,000 lines are kept. Native-library output written directly to the operating system's console is not captured. Dropping another video is disabled during extraction.

Extraction reads the original video. The rectangle restricts detection; added crop margins may extend beyond the rectangle, within the full frame. Closing during extraction requests cancellation; close again after it stops.

Code layout

All UI and extraction code is in src/extract_faces/app.py:

  • VideoView paints frames and handles the rectangle in image coordinates.
  • ExtractionWorker runs forensicface in a background thread. A small adapter crops the detector input and restores coordinates before forensicface saves crops from the original frame.
  • MainWindow creates the controls and connects their actions.

__init__.py is the installed command's entry point; __main__.py supports python -m extract_faces. No separate services or application layers.

Run the tests with uv run python -m unittest discover -s tests -v. They exercise the GUI without a visible window and use a fake detector with forensicface's real video extraction method, so model weights are unnecessary.

Metadata

Release files for extractfaces-gui 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extractfaces-gui 0.1.1
File Size Uploaded Provenance Actions
extractfaces_gui-0.1.1.tar.gz 9.3 kB With provenance Details for extractfaces_gui-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for extractfaces-gui 0.1.1
File Interpreter ABI Platform Actions
extractfaces_gui-0.1.1-py3-none-any.whl Python 3 none any Details for extractfaces_gui-0.1.1-py3-none-any.whl

Total release size: 20.2 kB

Release files / extractfaces_gui-0.1.1.tar.gz

Download URL extractfaces_gui-0.1.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
04f71b5a12890efd8d812666f311d16532a0d30e57b0a3040a96b36c012104a8
BLAKE2b-256 checksum
How to use checksums
f71bf2e298689c8788291779fb07a2e25a853624098b9b0609e76d1bd68bf886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / extractfaces_gui-0.1.1-py3-none-any.whl

Download URL extractfaces_gui-0.1.1-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35ea3f39c4801b4a224a34263387322c811e388b10b99dbccc998c2987304351
BLAKE2b-256 checksum
How to use checksums
e67f160bd4b6cc02e5e5202122cd36831e7a963b909b26423a6bbfe2849097e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Security for extractfaces-gui 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for extractfaces_gui-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page