Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
pip install processingtools
import processingtools as pt
import time
for i in pt.ProgressBar(range(50)):
time.sleep(0.1)
or
import processingtools as pt
import time
for i in pt.ProgressBar(range(50), bar_length=40, start_mark=None, finish_mark='progress done!', total=False):
time.sleep(0.1)
Then,
|████████████████████████████████████████| 100.0% | 50/50 | 0s |
progress finished!(5311ms)
class pt.ProgressBar(in_loop, bar_length: int = 40, start_mark: str = None, finish_mark='progress done!', total: int = None, detail_func: callable = None)
import processingtools as pt
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--save_path', type=str)
args = parser.parse_args()
recoder = pt.EnvReco('/save/path')
args = recoder.arg2abs(args)
recoder.record_arg(args)
recoder.record_code()
recoder.record_os()
recoder.record_gpu()
recoder.put_space()
recoder.print('record logs')
Then, record information in the log file
Args:
{
save_path: None
}
OS Env:
{
ALLUSERSPROFILE: ...
APPDATA: ...
COMMONPROGRAMFILES: ...
⋮
}
GPU Info:
{
cuda: True
num: 1
names: ['...']
}
[2023-7-3 19:50:9.78]: record logs
⚠️ This description was written almost by copilot, with some minor modifications. ⚠️
This class provides a set of tools for running functions in parallel using multiple processes. This class is designed to simplify the process of parallel execution, making it easier to utilize multiple CPU cores for improved performance.
__init__(self, cpu_n: int = mp.cpu_count())
duplicate_func(self, func, args_list: typing.Union[tuple, list], progress_args: typing.Union[dict, bool] = True)
multi_func(self, funcs: typing.Union[tuple, list], args: typing.Union[tuple, list], progress_args: typing.Union[dict, bool] = True)
split_list(self, *args)
self.cpu_n
wrapper(data, *args, **kwargs)
dill
adapt_function(function, order=False)
This provides a set of tools for handling video files, including video capture initialization, frame extraction, video resizing, and video-to-GIF conversion.
__init__(self, video_path: str)
initial_video_capture(self)
FileNotFoundError
if the video cannot be readvideo2images(self, save_path: str, extension: str = 'jpg', start: float = 0, end: float = None, jump: float = 1, option: str = 'frame', size=None) -> True
video_resize(self, save_path: str, size) -> True
second2frame(self, *args)
video2gif(self, save_path: str, speed: float = 1, size=1)
ModuleNotFoundError
if moviepy
is not installedA PyTorch module for automatically processing and normalizing input images. This class wraps a given model and provides functionality to read, preprocess, and forward images through the model. It supports custom transformers and normalization parameters.
__init__(self, model, size: typing.Union[tuple, list, None] = None, mean: typing.Union[float, list, torch.Tensor, None] = None, std: typing.Union[float, list, torch.Tensor, None] = None, transformer=None)
image_read(self, path: str) -> torch.Tensor
forward(self, x: torch.Tensor) -> torch.Tensor
to(self, device: str)
Prints the given text with specified color (RGB) and style.
'bold'
, 'tilt'
, 'underscore'
, and 'cancel'
.Prints the given text with specified color and style.
'bold'
, 'tilt'
, 'underscore'
, and 'cancel'
.Save images in PNG files.
'./'
).FAQs
https://github.com/ysy9997/ProcessingTools.git
We found that processingtools 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.