<!-- DO NOT EDIT THIS FILE MANUALLY. This file is generated by generate_readme.py. -->
<h1 align="center">
imgviz
</h1>
<h4 align="center">
Image Visualization Tools
</h4>
<div align="center">
<a href="https://pypi.python.org/pypi/imgviz"><img src="https://img.shields.io/pypi/v/imgviz.svg"></a>
<a href="https://pypi.org/project/imgviz"><img src="https://img.shields.io/pypi/pyversions/imgviz.svg"></a>
<a href="https://github.com/wkentaro/imgviz/actions"><img src="https://github.com/wkentaro/imgviz/workflows/ci/badge.svg"></a>
</div>
<div align="center">
<a href="https://github.com/wkentaro/imgviz/blob/main/#installation?raw=true"><b>Installation</b></a> |
<a href="https://github.com/wkentaro/imgviz/blob/main/#getting-started"><b>Getting Started</b></a> |
<a href="https://github.com/wkentaro/imgviz/blob/main/#examples"><b>Examples</b></a> |
<a href="https://github.com/wkentaro/imgviz-cpp"><b>C++ Version</b></a>
</div>
<br/>
<div align="center">
<img src="https://github.com/wkentaro/imgviz/blob/main/.readme/getting_started.jpg?raw=true" width="95%">
</div>
## Installation
```bash
pip install imgviz
# there are optional dependencies like skimage, below installs all.
pip install imgviz[all]
```
## Dependencies
- [matplotlib](https://pypi.org/project/matplotlib)
- [numpy](https://pypi.org/project/numpy)
- [Pillow>=5.3.0](https://pypi.org/project/Pillow)
- [PyYAML](https://pypi.org/project/PyYAML)
## Getting Started
```python
# getting_started.py
import imgviz
# sample data of rgb, depth, class label and instance masks
data = imgviz.data.arc2017()
rgb = data["rgb"]
gray = imgviz.rgb2gray(rgb)
# colorize depth image with JET colormap
depth = data["depth"]
depthviz = imgviz.depth2rgb(depth, min_value=0.3, max_value=1)
# colorize label image
class_label = data["class_label"]
labelviz = imgviz.label2rgb(
class_label, image=gray, label_names=data["class_names"], font_size=20
)
# instance bboxes
bboxes = data["bboxes"].astype(int)
labels = data["labels"]
masks = data["masks"] == 1
captions = [data["class_names"][l] for l in labels]
maskviz = imgviz.instances2rgb(gray, masks=masks, labels=labels, captions=captions)
# tile instance masks
insviz = [
(rgb * m[:, :, None])[b[0] : b[2], b[1] : b[3]] for b, m in zip(bboxes, masks)
]
insviz = imgviz.tile(imgs=insviz, border=(255, 255, 255))
insviz = imgviz.resize(insviz, height=rgb.shape[0])
# tile visualization
tiled = imgviz.tile(
[rgb, depthviz, labelviz, maskviz, insviz],
shape=(1, 5),
border=(255, 255, 255),
border_width=5,
)
```
## [Examples](https://github.com/wkentaro/imgviz/blob/main/examples)
<table>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/centerize.py">examples/centerize.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/centerize.jpg?raw=true" width="53.333333333333336%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/depth2rgb.py">examples/depth2rgb.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/depth2rgb.jpg?raw=true" width="78.16091954022988%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/draw.py">examples/draw.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/draw.jpg?raw=true" width="37.79047619047619%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/flow2rgb.py">examples/flow2rgb.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/flow2rgb.jpg?raw=true" width="52.21052631578947%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/instances2rgb.py">examples/instances2rgb.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/instances2rgb.jpg?raw=true" width="66.35451505016722%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/label2rgb.py">examples/label2rgb.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/label2rgb.jpg?raw=true" width="76.01532567049807%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/nchannel2rgb.py">examples/nchannel2rgb.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/nchannel2rgb.jpg?raw=true" width="52.21052631578947%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/plot_trajectory.py">examples/plot_trajectory.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/plot_trajectory.jpg?raw=true" width="26.86868686868687%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/resize.py">examples/resize.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/resize.jpg?raw=true" width="47.238095238095234%" /></td>
</tr>
<tr>
<td><pre><a href="https://github.com/wkentaro/imgviz/blob/main/examples/tile.py">examples/tile.py</a></pre></td>
<td><img src="https://github.com/wkentaro/imgviz/blob/main/examples/.readme/tile.jpg?raw=true" width="35.812274368231044%" /></td>
</tr>
</table>
Raw data
{
"_id": null,
"home_page": "http://github.com/wkentaro/imgviz",
"name": "imgviz",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "",
"author": "Kentaro Wada",
"author_email": "www.kentaro.wada@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a5/7f/fd91c69caa4820bdf93dfdcf68c350e75f4e7183e595157339958e026027/imgviz-1.7.5.tar.gz",
"platform": null,
"description": "<!-- DO NOT EDIT THIS FILE MANUALLY. This file is generated by generate_readme.py. -->\n\n<h1 align=\"center\">\n imgviz\n</h1>\n\n<h4 align=\"center\">\n Image Visualization Tools\n</h4>\n\n<div align=\"center\">\n <a href=\"https://pypi.python.org/pypi/imgviz\"><img src=\"https://img.shields.io/pypi/v/imgviz.svg\"></a>\n <a href=\"https://pypi.org/project/imgviz\"><img src=\"https://img.shields.io/pypi/pyversions/imgviz.svg\"></a>\n <a href=\"https://github.com/wkentaro/imgviz/actions\"><img src=\"https://github.com/wkentaro/imgviz/workflows/ci/badge.svg\"></a>\n</div>\n\n<div align=\"center\">\n <a href=\"https://github.com/wkentaro/imgviz/blob/main/#installation?raw=true\"><b>Installation</b></a> |\n <a href=\"https://github.com/wkentaro/imgviz/blob/main/#getting-started\"><b>Getting Started</b></a> |\n <a href=\"https://github.com/wkentaro/imgviz/blob/main/#examples\"><b>Examples</b></a> |\n <a href=\"https://github.com/wkentaro/imgviz-cpp\"><b>C++ Version</b></a>\n</div>\n\n<br/>\n\n<div align=\"center\">\n <img src=\"https://github.com/wkentaro/imgviz/blob/main/.readme/getting_started.jpg?raw=true\" width=\"95%\">\n</div>\n\n## Installation\n\n```bash\npip install imgviz\n\n# there are optional dependencies like skimage, below installs all.\npip install imgviz[all]\n```\n\n\n## Dependencies\n\n- [matplotlib](https://pypi.org/project/matplotlib)\n- [numpy](https://pypi.org/project/numpy)\n- [Pillow>=5.3.0](https://pypi.org/project/Pillow)\n- [PyYAML](https://pypi.org/project/PyYAML)\n\n## Getting Started\n\n```python\n# getting_started.py\n\nimport imgviz\n\n# sample data of rgb, depth, class label and instance masks\ndata = imgviz.data.arc2017()\n\nrgb = data[\"rgb\"]\ngray = imgviz.rgb2gray(rgb)\n\n# colorize depth image with JET colormap\ndepth = data[\"depth\"]\ndepthviz = imgviz.depth2rgb(depth, min_value=0.3, max_value=1)\n\n# colorize label image\nclass_label = data[\"class_label\"]\nlabelviz = imgviz.label2rgb(\n class_label, image=gray, label_names=data[\"class_names\"], font_size=20\n)\n\n# instance bboxes\nbboxes = data[\"bboxes\"].astype(int)\nlabels = data[\"labels\"]\nmasks = data[\"masks\"] == 1\ncaptions = [data[\"class_names\"][l] for l in labels]\nmaskviz = imgviz.instances2rgb(gray, masks=masks, labels=labels, captions=captions)\n\n# tile instance masks\ninsviz = [\n (rgb * m[:, :, None])[b[0] : b[2], b[1] : b[3]] for b, m in zip(bboxes, masks)\n]\ninsviz = imgviz.tile(imgs=insviz, border=(255, 255, 255))\ninsviz = imgviz.resize(insviz, height=rgb.shape[0])\n\n# tile visualization\ntiled = imgviz.tile(\n [rgb, depthviz, labelviz, maskviz, insviz],\n shape=(1, 5),\n border=(255, 255, 255),\n border_width=5,\n)\n```\n\n## [Examples](https://github.com/wkentaro/imgviz/blob/main/examples)\n\n<table>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/centerize.py\">examples/centerize.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/centerize.jpg?raw=true\" width=\"53.333333333333336%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/depth2rgb.py\">examples/depth2rgb.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/depth2rgb.jpg?raw=true\" width=\"78.16091954022988%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/draw.py\">examples/draw.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/draw.jpg?raw=true\" width=\"37.79047619047619%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/flow2rgb.py\">examples/flow2rgb.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/flow2rgb.jpg?raw=true\" width=\"52.21052631578947%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/instances2rgb.py\">examples/instances2rgb.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/instances2rgb.jpg?raw=true\" width=\"66.35451505016722%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/label2rgb.py\">examples/label2rgb.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/label2rgb.jpg?raw=true\" width=\"76.01532567049807%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/nchannel2rgb.py\">examples/nchannel2rgb.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/nchannel2rgb.jpg?raw=true\" width=\"52.21052631578947%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/plot_trajectory.py\">examples/plot_trajectory.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/plot_trajectory.jpg?raw=true\" width=\"26.86868686868687%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/resize.py\">examples/resize.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/resize.jpg?raw=true\" width=\"47.238095238095234%\" /></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre><a href=\"https://github.com/wkentaro/imgviz/blob/main/examples/tile.py\">examples/tile.py</a></pre></td>\n\t\t<td><img src=\"https://github.com/wkentaro/imgviz/blob/main/examples/.readme/tile.jpg?raw=true\" width=\"35.812274368231044%\" /></td>\n\t</tr>\n</table>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Image Visualization Tools",
"version": "1.7.5",
"project_urls": {
"Homepage": "http://github.com/wkentaro/imgviz"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a57ffd91c69caa4820bdf93dfdcf68c350e75f4e7183e595157339958e026027",
"md5": "4fd73f8123136598f84f06f7c035bc09",
"sha256": "dad88868aa450deb105e08c389d3cc7ffd4f62cc7bc30885e33ce38ba2919a89"
},
"downloads": -1,
"filename": "imgviz-1.7.5.tar.gz",
"has_sig": false,
"md5_digest": "4fd73f8123136598f84f06f7c035bc09",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 7674810,
"upload_time": "2023-12-30T07:55:04",
"upload_time_iso_8601": "2023-12-30T07:55:04.386829Z",
"url": "https://files.pythonhosted.org/packages/a5/7f/fd91c69caa4820bdf93dfdcf68c350e75f4e7183e595157339958e026027/imgviz-1.7.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-30 07:55:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wkentaro",
"github_project": "imgviz",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "imgviz"
}