defdemo_trt_infer():
import numpy as np
from pathlib import Path
from zhousflib.infer_framework.ann import to_numpy
from zhousflib.infer_framework.ann.torch.torch_to_onnx import example_inputs_demo
from zhousflib.infer_framework.ann.tensorrt.tensorrt_infer import RTInfer
args = example_inputs_demo(input_size=1)
batch = np.asarray([to_numpy(args[0].int()), to_numpy(args[1].int()), to_numpy(args[2].int())])
rt_engine = RTInfer(trt_file_path=Path(r"F:\torch\onnx\model_32.trt"), device_id=0, use_stack=True)
data = rt_engine.infer(input_arr=batch)
print(data)
算法数据集制作
datasets/classification:数据集制作
datasets/coco:数据集制作、格式转换、可视化、统计、数据更新/合并/提取
datasets/labelme:数据集制作、格式转换、可视化、统计、数据更新/合并/提取
datasets/segmentation:数据集制作
ML
ml/feature_vector:特征向量表示器
ml/model_cluster:kmeans聚类
ml/model_lr:线性回归
ml/model_gbdt:GBDT
数据库
db/lmdb:内存映射数据库
db/tinydb:轻量数据库,线程不安全
装饰器
decorator:异常捕获,AOP
文件操作
download:文件批量异步下载
delete_file:文件删除
字体
font:宋体、特殊符号字体
并发压测工具
locust:demo
表格文件工具
pandas:excel/csv操作、大文件读取
pdf文件工具
pdf:pdf导出图片、pdf文本和表格提取
so加密工具
so:python工程加密成so,防逆向
web相关
web:flask日志工具、响应体、配置
通用工具包
util
[util/cv_util]:opencv读写中文路径图片,图像相关处理
[util/char_util]:字符相关处理,全角、半角
[util/encrypt_util]:AES加密
[util/iou_util]:IoU计算
[util/json_util]:json读写
[util/poly_util]:按照宽高对图片进行网格划分/切图
[util/re_util]:re提取数字、字母、中文
[util/singleton]:单例
[util/string_util]:非空、包含、补齐
[util/time_util]:日期、毫秒级时间戳、微秒级时间戳、日期比较
FAQs
a python library of zhousf
We found that zhousf-lib 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.
Malicious Go packages are impersonating popular libraries to install hidden loader malware on Linux and macOS, targeting developers with obfuscated payloads.
Bybit's $1.46B hack by North Korea's Lazarus Group pushes 2025 crypto losses to $1.6B in just two months, already surpassing all of 2024's $1.49B total.
OpenSSF has published OSPS Baseline, an initiative designed to establish a minimum set of security-related best practices for open source software projects.