Skip to main content

rutils

Utils for computer vision

Install

pip install rutils

Modules

Common

str2path

from argparse import ArgumentParser
from rutils.common import str2path

opt_parser = ArgumentParser()
opt_parser.add_argument('--txt_path', type=str2path)
opt = opt_parser.parse_args()
print(type(opt.txt_path))

Run command

from rutils.common import run_command

command = 'echo "Run command example"'
run_command(command)

Video

Read video

video_path = Path('./test.mp4')
video_reader = rutils.video.VideoReader(in_video_path=video_path)
print(video_reader.num_frames)
for _ in range(num_frames):
    frame = video_reader.get_next_frame()

Write video

Support two method:

  • Use OpenCV
video_writer = rutils.video.VideoWriter(
    out_path,
    video_w,
    video_h,
    fps=25,
    encoding='H264',
    video_bitrate='11M',
    mode='opencv'
)
video_writer.write_frame(frame)
video_writer.release()
  • Use FFMpeg
video_writer = rutils.video.VideoWriter(
    out_path,
    video_w,
    video_h,
    fps=25,
    encoding='H264',
    video_bitrate='11M',
    mode='ffmpeg'
)
video_writer.write_frame(frame)
video_writer.release()

Metadata

Release files for rutils 0.4.0

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

Built distribution (wheel)

Table of built distributions (wheels) for rutils 0.4.0
File Interpreter ABI Platform Actions
rutils-0.4.0-py3-none-any.whl Python 3 none any Details for rutils-0.4.0-py3-none-any.whl

Release files / rutils-0.4.0-py3-none-any.whl

Download URL rutils-0.4.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40c71ed8e3f6ed7850e9178cdf55bd546289aec98aac6c6c9b58f1dc24c78260
BLAKE2b-256 checksum
How to use checksums
bbdbd07d83efb93382d8128e8635d03b01cba6b9b4565d62c69305a0edcaf861
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.17

Security for rutils 0.4.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.

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.

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