Skip to main content

moduler multi purpose video player for debugging algorithms in python

Project description

Introduction

CV video player is a Python-based customizable video player that helps computer vision practitioners to develop, analyze, and debug their video-related algorithms and models.

The video player is interactive, operating only with keyboard presses (no UI buttons). The user can register shortcuts using the VideoPlayer class's API.

The player is designed as a callback system. When initialized the player receives a list of callbacks, each with optional hooks for setup, before frame resize, and after frame resize. on runtime the callbacks hooks will run in order as specified in the input list.

See it in action

Running frame by frame

frame_by_frame

Play/Pause and control play speed and direction

playpause

Draw bounding boxes and adjust labels

bboxes

Installation

pip install cvvideoplayer

Quick Start

from cvvideoplayer import create_video_player
from cvvideoplayer.frame_editors import FrameInfoOverlay, HistogramEqualizer, FrameNormalizer, KeyMapOverlay

VIDEO_OR_FRAME_FOLDER_PATH = "<add local path here>"

def run_player():
    video_player = create_video_player(
        video_source=VIDEO_OR_FRAME_FOLDER_PATH,
        frame_edit_callbacks=[
            FrameInfoOverlay(),
            HistogramEqualizer(),
            FrameNormalizer(),
            KeyMapOverlay(),
        ],
        record=True,
    )

    video_player.run()


if __name__ == "__main__":
    run_player()

In this example, we initiate a very basic video player that will play "example_video.mp4" with added basic frame edit callbacks:

  • FrameInfoOverlay: Prints the current frame number and original frame resolution in the top left corner
  • HistogramEqualizer: Preforms histogram equalization on the image
  • FrameNormalizer: Allows the user to set a dynamic range for the image.
  • KeyMapOverlay: prints all optional shortcuts registered by all callbacks

Check out the ./demos folder which shows the use of other cool frame edit callback such as OpticalFlow and DetectionCsvPlotter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvvideoplayer-1.1.2.tar.gz (21.1 kB view details)

Uploaded Source

File details

Details for the file cvvideoplayer-1.1.2.tar.gz.

File metadata

  • Download URL: cvvideoplayer-1.1.2.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for cvvideoplayer-1.1.2.tar.gz
Algorithm Hash digest
SHA256 80fe25e5ede48091311f84f77b0b83aa950872619a2cc58976385d3133b16485
MD5 3d14768f29f2fe4b67587c674440a193
BLAKE2b-256 92462c578ae7a73d382a8e9bb6f3df5a2e362c5900bcc015ab6c0869289989dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page