kiui


Namekiui JSON
Version 0.2.8 PyPI version JSON
download
home_pagehttps://github.com/ashawkey/kiuikit
SummaryA toolkit for 3D vision
upload_time2024-04-25 08:30:20
maintainerNone
docs_urlNone
authorkiui
requires_pythonNone
licenseNone
keywords utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
    <picture>
    <img alt="kiuikit_logo" src="docs/source/_static/logo.png" width="50%">
    </picture>
    </br>
    <b>Kiuikit</b>
    </br>
    <code>pip install kiui</code>
    &nbsp;&nbsp;&bull;&nbsp;&nbsp;
    <a href="https://kit.kiui.moe/">Documentation</a>
</p>

A toolkit for computer vision (especially 3D vision) tasks.

**Features**:
* Collection of *maintained, reusable and trustworthy* code snippets.
* Always using lazy import so the code is not slowed down by `import kiui`.
* Useful CLI tools, such as a GUI mesh renderer.

https://github.com/ashawkey/kiuikit/assets/25863658/d8cbcf0f-a6d8-4fa7-aee9-afbbf25ed167

> ["Seahourse3"](https://skfb.ly/6TwFv) by seanhepburn is licensed under [Creative Commons Attribution](http://creativecommons.org/licenses/by/4.0/).

### Install

```bash
# released
pip install kiui # install the minimal package
pip install kiui[full] # install optional dependencies

# latest
pip install git+https://github.com/ashawkey/kiuikit.git # only the minimal package
```

### Basic Usage

```python
import kiui

### quick inspection of array-like object
x = torch.tensor(...)
y = np.array(...)

kiui.lo(x)
kiui.lo(x, y) # support multiple objects
kiui.lo(kiui) # or any other object (just print with name)

### io utils
# read image as-is in RGB order
img = kiui.read_image('image.png', mode='float') # mode: float (default), pil, uint8, tensor
# write image
kiui.write_image('image.png', img)

### visualization tools
img_tensor = torch.rand(3, 256, 256) 
# tensor of [3, H, W], [1, H, W], [H, W] / array of [H, W ,3], [H, W, 1], [H, W] in [0, 1]
kiui.vis.plot_image(img)
kiui.vis.plot_image(img_tensor)

### mesh utils
from kiui.mesh import Mesh
mesh = Mesh.load('model.obj')
kiui.lo(mesh.v, mesh.f) # CUDA torch.Tensor suitable for nvdiffrast
mesh.write('new.obj')
mesh.write('new.glb') # support exporting to GLB/GLTF too (texture embedded).

# perceptual loss (from https://github.com/richzhang/PerceptualSimilarity)
from kiui.lpips import LPIPS
lpips = LPIPS(net='vgg').cuda()
loss = lpips(input, target) # [B, 3, H, W] image in [-1, 1]
```

CLI tools:
```bash
# sr (Real-ESRGAN from https://github.com/ai-forever/Real-ESRGAN/tree/main)
python -m kiui.sr --help
python -m kiui.sr image.jpg --scale 2 # save to image_2x.jpg
kisr image.jpg --scale 2 # short cut cmd

# mesh format conversion (only for a single textured mesh in obj/glb)
python -m kiui.cli.convert input.obj output.glb
kico input.obj output.glb # short cut cmd
kico mesh_folder video_folder --in_fmt .glb --out_fmt .mp4 # render all glb meshes into rotating videos

# aesthetic predictor v2 (https://github.com/christophschuhmann/improved-aesthetic-predictor)
python -m kiui.cli.aes --help

# compare content of two directories
python -m kiui.cli.dircmp <dir1> <dir2>

# lock requirements.txt package versions based on current environment
python -m kiui.cli.lock_version <requirements.txt>
```

GUI tools:
```bash
# open a GUI to render a mesh (extra dep: nvdiffrast)
python -m kiui.render --help
python -m kiui.render mesh.obj
python -m kiui.render mesh.glb --pbr # render with PBR (metallic + roughness)
python -m kiui.render mesh.obj --save_video out.mp4 --wogui # save 360 degree rotating video
kire --help # short cut cmd

# open a GUI to render and edit pose (openpose convention, controlnet compatible)
python -m kiui.poser --help
python -m kiui.poser --load 3head # load preset 3 headed skeleton
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ashawkey/kiuikit",
    "name": "kiui",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "utility",
    "author": "kiui",
    "author_email": "ashawkey1999@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d2/7f/aa68cf1db675d4c4a57bd2de60d94293bcb6cedc2e66d0e119dd77bf4677/kiui-0.2.8.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n    <picture>\n    <img alt=\"kiuikit_logo\" src=\"docs/source/_static/logo.png\" width=\"50%\">\n    </picture>\n    </br>\n    <b>Kiuikit</b>\n    </br>\n    <code>pip install kiui</code>\n    &nbsp;&nbsp;&bull;&nbsp;&nbsp;\n    <a href=\"https://kit.kiui.moe/\">Documentation</a>\n</p>\n\nA toolkit for computer vision (especially 3D vision) tasks.\n\n**Features**:\n* Collection of *maintained, reusable and trustworthy* code snippets.\n* Always using lazy import so the code is not slowed down by `import kiui`.\n* Useful CLI tools, such as a GUI mesh renderer.\n\nhttps://github.com/ashawkey/kiuikit/assets/25863658/d8cbcf0f-a6d8-4fa7-aee9-afbbf25ed167\n\n> [\"Seahourse3\"](https://skfb.ly/6TwFv) by seanhepburn is licensed under [Creative Commons Attribution](http://creativecommons.org/licenses/by/4.0/).\n\n### Install\n\n```bash\n# released\npip install kiui # install the minimal package\npip install kiui[full] # install optional dependencies\n\n# latest\npip install git+https://github.com/ashawkey/kiuikit.git # only the minimal package\n```\n\n### Basic Usage\n\n```python\nimport kiui\n\n### quick inspection of array-like object\nx = torch.tensor(...)\ny = np.array(...)\n\nkiui.lo(x)\nkiui.lo(x, y) # support multiple objects\nkiui.lo(kiui) # or any other object (just print with name)\n\n### io utils\n# read image as-is in RGB order\nimg = kiui.read_image('image.png', mode='float') # mode: float (default), pil, uint8, tensor\n# write image\nkiui.write_image('image.png', img)\n\n### visualization tools\nimg_tensor = torch.rand(3, 256, 256) \n# tensor of [3, H, W], [1, H, W], [H, W] / array of [H, W ,3], [H, W, 1], [H, W] in [0, 1]\nkiui.vis.plot_image(img)\nkiui.vis.plot_image(img_tensor)\n\n### mesh utils\nfrom kiui.mesh import Mesh\nmesh = Mesh.load('model.obj')\nkiui.lo(mesh.v, mesh.f) # CUDA torch.Tensor suitable for nvdiffrast\nmesh.write('new.obj')\nmesh.write('new.glb') # support exporting to GLB/GLTF too (texture embedded).\n\n# perceptual loss (from https://github.com/richzhang/PerceptualSimilarity)\nfrom kiui.lpips import LPIPS\nlpips = LPIPS(net='vgg').cuda()\nloss = lpips(input, target) # [B, 3, H, W] image in [-1, 1]\n```\n\nCLI tools:\n```bash\n# sr (Real-ESRGAN from https://github.com/ai-forever/Real-ESRGAN/tree/main)\npython -m kiui.sr --help\npython -m kiui.sr image.jpg --scale 2 # save to image_2x.jpg\nkisr image.jpg --scale 2 # short cut cmd\n\n# mesh format conversion (only for a single textured mesh in obj/glb)\npython -m kiui.cli.convert input.obj output.glb\nkico input.obj output.glb # short cut cmd\nkico mesh_folder video_folder --in_fmt .glb --out_fmt .mp4 # render all glb meshes into rotating videos\n\n# aesthetic predictor v2 (https://github.com/christophschuhmann/improved-aesthetic-predictor)\npython -m kiui.cli.aes --help\n\n# compare content of two directories\npython -m kiui.cli.dircmp <dir1> <dir2>\n\n# lock requirements.txt package versions based on current environment\npython -m kiui.cli.lock_version <requirements.txt>\n```\n\nGUI tools:\n```bash\n# open a GUI to render a mesh (extra dep: nvdiffrast)\npython -m kiui.render --help\npython -m kiui.render mesh.obj\npython -m kiui.render mesh.glb --pbr # render with PBR (metallic + roughness)\npython -m kiui.render mesh.obj --save_video out.mp4 --wogui # save 360 degree rotating video\nkire --help # short cut cmd\n\n# open a GUI to render and edit pose (openpose convention, controlnet compatible)\npython -m kiui.poser --help\npython -m kiui.poser --load 3head # load preset 3 headed skeleton\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A toolkit for 3D vision",
    "version": "0.2.8",
    "project_urls": {
        "Homepage": "https://github.com/ashawkey/kiuikit"
    },
    "split_keywords": [
        "utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8315066807c7c0fe4f538b9ef0b4f5fa7eb2ccc238e85fdc620ee8e449a0fe5",
                "md5": "f904eb77c5f425cd4b073b9d588ebe73",
                "sha256": "59f9c28dcd1be9e8c2d04ebe0c78bb1af807af6eaade9b5e4c659c6e088f9ac8"
            },
            "downloads": -1,
            "filename": "kiui-0.2.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f904eb77c5f425cd4b073b9d588ebe73",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3082482,
            "upload_time": "2024-04-25T08:30:18",
            "upload_time_iso_8601": "2024-04-25T08:30:18.508619Z",
            "url": "https://files.pythonhosted.org/packages/c8/31/5066807c7c0fe4f538b9ef0b4f5fa7eb2ccc238e85fdc620ee8e449a0fe5/kiui-0.2.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d27faa68cf1db675d4c4a57bd2de60d94293bcb6cedc2e66d0e119dd77bf4677",
                "md5": "c308ab8d895ffc8abb3b2562a31a6222",
                "sha256": "5ba4fda321a192f897b4a6e00955b2ad595b19bea56cead65ed7e4e158b911a1"
            },
            "downloads": -1,
            "filename": "kiui-0.2.8.tar.gz",
            "has_sig": false,
            "md5_digest": "c308ab8d895ffc8abb3b2562a31a6222",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3056819,
            "upload_time": "2024-04-25T08:30:20",
            "upload_time_iso_8601": "2024-04-25T08:30:20.484104Z",
            "url": "https://files.pythonhosted.org/packages/d2/7f/aa68cf1db675d4c4a57bd2de60d94293bcb6cedc2e66d0e119dd77bf4677/kiui-0.2.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 08:30:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ashawkey",
    "github_project": "kiuikit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "kiui"
}
        
Elapsed time: 0.25103s