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. Click or drag the playback timeline to seek; Left and Right seek by 10 seconds. 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, sampling interval, and start time. A multiplier of 2 doubles the detected box's dimensions. Process every Nth frame: 1 processes every frame; 5 processes one in five. Enable Stop at to specify an optional stop time in seconds, later than the start time. Frames at or after the stop time are excluded. Leave it off to process to the end. Both times have a Use current position button. 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 real video reading and crop saving, so model weights are unnecessary.

Metadata

Release files for extractfaces-gui 0.2.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.2.0
File Size Uploaded Provenance Actions
extractfaces_gui-0.2.0.tar.gz 10.6 kB With provenance Details for extractfaces_gui-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 22.6 kB

Release files / extractfaces_gui-0.2.0.tar.gz

Download URL extractfaces_gui-0.2.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
75718bdab6794b369f923b77f1cc0e9229606b51a846df81bf952b34cbba2227
BLAKE2b-256 checksum
How to use checksums
ec56c50c79943336de7e4b8d74544885819b7bcf7f3024aceaade1d83c6d93af
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.2.0-py3-none-any.whl

Download URL extractfaces_gui-0.2.0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f00fe2c03170a528a4fc5555916eb947adbdeb3a193668ce6449cc88639e212
BLAKE2b-256 checksum
How to use checksums
185bcabeca50a43050106186e0c8d15eb4a6bc090241493a2c77fcbc4c98619b
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.2.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.2.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