
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
cvbase
is a miscellaneous set of tools which maybe helpful for computer vision research.
It comprises the following parts.
Try and start with
pip install cvbase
See documentation for more features and usage.
There are some popular features such as progress visualization, timer, video to frames/frames to videos.
Progress visualization
If you want to apply a method to a list of items and track the progress, track_progress
is a good choice. It will display a progress bar to tell the progress and ETA.
import cvbase as cvb
def func(item):
# do something
pass
tasks = [item_1, item_2, ..., item_n]
cvb.track_progress(func, tasks)
The output is like the following.
There is another method track_parallel_progress
, which wraps multiprocessing and
progress visualization.
import cvbase as cvb
def func(item):
# do something
pass
tasks = [item_1, item_2, ..., item_n]
cvb.track_parallel_progress(func, tasks, 8)
# 8 workers
Timer
It is convinient to computer the runtime of a code block with Timer
.
import time
with cvb.Timer():
# simulate some code block
time.sleep(1)
Or try a more flexible way.
timer = cvb.Timer()
# code block 1 here
print(timer.since_start())
# code block 2 here
print(timer.since_last_check())
print(timer.since_start())
Video/Frames conversion
To split a video into frames.
video = cvb.VideoReader('video_file.mp4')
video.cvt2frames('frame_dir')
Besides cvt2frames
, VideoReader
wraps many other useful methods to operate a video like a list object, like
video = cvb.VideoReader('video_file.mp4')
len(video) # get total frame number
video[5] # get the 6th frame
for img in video: # iterate over all frames
print(img.shape)
To generate a video from frames, use the frames2video
method.
video = cvb.frames2video('frame_dir', 'out_video_file.avi', fps=30)
Video editing (needs ffmpeg)
To cut a video.
cvb.cut_video('input.mp4', 'output.mp4', start=3, end=10)
To join two video clips.
cvb.concat_video(['clip1.mp4', 'clip2.mp4'], 'output.mp4')
To resize a video.
cvb.resize_video('input.mp4', 'resized.mp4', (360, 240))
# or
cvb.resize_video('input.mp4', 'resized.mp4', ratio=2)
To convert the format of a video.
cvb.convert_video('input.avi', 'output.mp4', vcodec='h264')
FAQs
Utils for computer vision research
We found that cvbase demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.