Skip to main content

SPEK - Simple Python Extraction Kit

SPEK is a simple Python library for real-time object detection using YOLOv8 and OpenCV.
It supports webcam, video, or static image detection and is designed for ease of use.

Logo

Features

  • Live detection from webcam or video files
  • Static image detection
  • Filter detection by specific class (e.g., person, dog, car)
  • Headless mode (no preview window) for servers
  • Callbacks on detection for custom behavior
  • Quick-start helper functions

Installation

pip install spek

Usage/Examples

1 Live webcam detection (default)

import spek
# model sizes are n, s, m, l, x
# Detect "person" using YOLOv8s model on webcam
# target_class="person" targets a person
spek.run_live_detection(target_class="person", model_name_or_size="s")

2 Detect a specific target class and run a function

from spek import detect_objects

# Define the callback function
def your_function(info):
    print("Detected person")

# Run detection for "person"
detect_objects(
    target_class="person",
    on_detected=your_function,
    source=0,
    model_size="s"
)

or

from spek import detect_objects

# Define the callback function
def your_function(info):
    print("Detected person")

# Run detection for "person"
detect_objects(target_class="person", on_detected=your_function, source=0, model_size="s")

3 Detect objects from a video file

from spek import detect_objects

# Detect objects from a local video file
detect_objects(source="video.mp4", model_size="m")

4 Detect objects from a static image

from spek import detect_objects

# Detect objects in a single image
detect_objects(source="image.jpg", model_size="l")

5 Run in headless mode (no display, useful for servers)

from spek import detect_objects

# Process webcam feed without displaying window
detect_objects(source=0, model_size="s", headless=True)

6 CLI usage After installation, you can run live detection from the command line:

python -m spek --source 0 --target person --model s

7 Static image via CLI

python -m spek --image input.jpg --target dog --model m

Authors

License

MIT

Metadata

Release files for SPEK 0.0.4

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

Source distribution (sdist)

Source distribution for SPEK 0.0.4
File Size Uploaded Provenance
spek-0.0.4.tar.gz 7.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for SPEK 0.0.4
File Interpreter ABI Platform
spek-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / spek-0.0.4.tar.gz

Download URL spek-0.0.4.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4a77bdefd883f186095b1de529b4e6a00360f6eaf08a99f79e75122a2d63bd05
BLAKE2b-256 checksum
How to use checksums
94ee1b913723a603a98b9809f9c638a8f29a695ea0b72532043e0ea3fd5adcf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / spek-0.0.4-py3-none-any.whl

Download URL spek-0.0.4-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afb3e2f3e0df70cd6839a80d88234c7f785923a81aaa23f6dab4c74e106e0903
BLAKE2b-256 checksum
How to use checksums
243050a028e35038845f1702d8a9fc2e21c25fff2e1f3f1680baf49d2cf1694c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for SPEK 0.0.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

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