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.14 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 Windows 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.0

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.0
File Size Uploaded Provenance Actions
extractfaces_gui-0.1.0.tar.gz 9.3 kB With provenance Details for extractfaces_gui-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 20.2 kB

Release files / extractfaces_gui-0.1.0.tar.gz

Download URL extractfaces_gui-0.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4721711d7e8e5c48586828572346431736569558da68a4f1f6d88ab3f1dd2d20
BLAKE2b-256 checksum
How to use checksums
6be4fbbd8d958581645419ebb263bd01a559f9121f3b0ef22c3250778014a6fa
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.0-py3-none-any.whl

Download URL extractfaces_gui-0.1.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eca7a584a4b4a177ea3dfec993ac59acc536fb2f96ae933c347cb33371fdff0b
BLAKE2b-256 checksum
How to use checksums
218dca12c63c2bdf87f5b10a8b6ea0cf3ddaeb464a359ed01183a74efa25e3c9
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.0

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