imRender
Image Display
- Draw label annotations in labelme format onto the image.
- Customize the display of flags attributes.
Quick Start
渲染逻辑是调用时通过just_flags参数控制是否优先使用shape内指定的flags信息渲染, 其次使用类别名查找渲染等级, 两种方式都需要使用flags_key_map转义关键字. 若都没有指定, 则使用默认配置default_report.
Install:
pip install imRender
Usage:
step1: 快速导入并实例化
from imRender import LabelmeChineseRenderer
# 自定义类别渲染
renderer = LabelmeChineseRenderer(
font_path=Path.home() / ".config/elfin/fonts/Arial.Unicode.ttf",
verbose=False,
flags_key_map={
"person": "critical", # 指定渲染类别的等级
"car": "high",
}
)
# 使用标注实例中的flags自定义的渲染
renderer = LabelmeChineseRenderer(
font_path=Path.home() / ".config/elfin/fonts/Arial.Unicode.ttf",
verbose=False,
)
# 自定义默认渲染等级与渲染颜色
renderer = LabelmeChineseRenderer(
font_path=Path.home() / ".config/elfin/fonts/Arial.Unicode.ttf",
verbose=False,
default_report=("critical", (0, 0, 255)) # 红色 - 关键/严重问题
)
step2: 调用渲染接口
# 调用单张图片渲染
renderer.render_image(
image_path="path/to/image", # 可以直接传图像数据ndarray
json_path="path/to/json", # 可以直接传labelme格式的标注字典
output_path="path/to/save_image",
just_flags=True, # 只使用标注中的flags信息渲染, 未标记的实例不渲染
show_score=True, # 渲染时带上置信度
ind=0, # 当前图像的序号
)
# 批次调用
renderer.render_batch(
images_dir=Path("path/to/images"),
labels_dir=Path("path/to/labels") or None,
output_dir=Path("render_images/"),
just_flags=False, # 未使用flags标记的标签也要渲染
show_score=True,
)
Metadata
Release files for imRender 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imrender-0.1.3.tar.gz | 11.2 kB | Without provenance | Details for imrender-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imrender-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for imrender-0.1.3-py3-none-any.whl |
Total release size: 23.3 kB
Release files / imrender-0.1.3.tar.gz
| Download URL | imrender-0.1.3.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1f0c4c8e89b98b75839fd01957df72f34ef4092368d95b92474db6e154910f2
|
|
BLAKE2b-256 checksum How to use checksums |
fe2539f2fdb434f715b9ebc913d1944fcd5cad7c6c9cde5b7216307ee3d39b97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / imrender-0.1.3-py3-none-any.whl
| Download URL | imrender-0.1.3-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5258b3faacc39b1016b0b9b8a063758b50eebda4c89da93b21056d4dd097de9
|
|
BLAKE2b-256 checksum How to use checksums |
ec44c284087b374d93b5710e2316ff7ccf89efa9938815ee582b66ca8cc1be7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for imRender 0.1.3
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.