onnigiri


Nameonnigiri JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/Idein/onnigiri
Summaryonnx-divider
upload_time2023-11-14 06:23:36
maintainer
docs_urlNone
authorIdein Inc.
requires_python>=3.9,<4.0
licenseApache-2.0
keywords onnx
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # onnigiri
onnx-divider

The purpose of this package is to create subgraphs by partitioning computational graphs in order to facilitate the development of applications.

One of the problems in developing applications using deep learning models is that the DL model is not applicable by itself.
For example, they may be have unnecessary nodes and some nodes are not supported some DL tools.
This tool enable us to edit an onnx model freely and easily.

## Installation
From [PyPI](https://pypi.org/project/onnigiri/):

```
$ pip3 install onnigiri
```

From [Dockerhub](https://hub.docker.com/repository/docker/idein/onnigiri)

```
$ docker pull idein/onnigiri:20231114
```


## Usage
[SSD](https://github.com/onnx/models/tree/main/vision/object_detection_segmentation/ssd)

```
$ onnigiri ssd-10.onnx -o ssd-10-main.onnx --from image --to Transpose_472 Transpose_661
$ onnigiri ssd-10.onnx -o ssd-10-post.onnx --from Transpose_472 Transpose_661 --to bboxes labels scores
```

With docker:

```
$ docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/onnigiri:20221014 ssd-10.onnx -o ssd-10-main.onnx --from image --to Transpose_472 Transpose_661
$ docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/onnigiri:20221014 ssd-10.onnx -o ssd-10-post.onnx  --from Transpose_472 Transpose_661 --to bboxes labels scores
```

[UltraFace](https://github.com/onnx/models/tree/main/vision/body_analysis/ultraface)

```
$ onnigiri version-RFB-640.onnx -o version-RFB-640-main.onnx --from input --to 460 scores
$ onnigiri version-RFB-640.onnx -o version-RFB-640-post.onnx --from 460 --to boxes
```

[tiny-yolov3](https://github.com/onnx/models/tree/main/vision/object_detection_segmentation/tiny-yolov3)

```
$ onnigiri tiny-yolov3-11.onnx --fix-input-shape 'input_1' '1,3,256,256' 'image_shape' '1,2' -o tiny-yolov3-11-main.onnx --from input_1 --to 'TFNodes/yolo_evaluation_layer_1/Reshape_3:0' 'model_1/leaky_re_lu_10/LeakyRelu:0' 'model_1/leaky_re_lu_5/LeakyRelu:0'
$ onnigiri tiny-yolov3-11.onnx --fix-input-shape 'input_1' '1,3,256,256' 'image_shape' '1,2' -o tiny-yolov3-11-post.onnx --from image_shape 'TFNodes/yolo_evaluation_layer_1/Reshape_3:0' 'model_1/leaky_re_lu_10/LeakyRelu:0' 'model_1/leaky_re_lu_5/LeakyRelu:0' --to 'yolonms_layer_1' 'yolonms_layer_1:1' 'yolonms_layer_1:2'
```

## Q&A

- How to get the name of values?

Use [Netron](https://netron.app).

- Why is the extracted subgraph different from the original subgraph?

onnigiri apply [onnx-simplifier](https://github.com/daquexian/onnx-simplifier) before extraction. You can disable the graph optimization by the onnx-simplifier using the `--no-optimization` option.

## Development Guide

```
$ poetry install
```

### Build docker image

```
$ nix build '.#dockerimage' -o image
$ docker load < ./image
```

## Related project

- [onnion](https://github.com/Idein/onnion)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Idein/onnigiri",
    "name": "onnigiri",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "onnx",
    "author": "Idein Inc.",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/d5/6e/b740e671073dbd62aee68cfa845fe1295e36f9993f3290de7bab703a0485/onnigiri-0.4.0.tar.gz",
    "platform": null,
    "description": "# onnigiri\nonnx-divider\n\nThe purpose of this package is to create subgraphs by partitioning computational graphs in order to facilitate the development of applications.\n\nOne of the problems in developing applications using deep learning models is that the DL model is not applicable by itself.\nFor example, they may be have unnecessary nodes and some nodes are not supported some DL tools.\nThis tool enable us to edit an onnx model freely and easily.\n\n## Installation\nFrom [PyPI](https://pypi.org/project/onnigiri/):\n\n```\n$ pip3 install onnigiri\n```\n\nFrom [Dockerhub](https://hub.docker.com/repository/docker/idein/onnigiri)\n\n```\n$ docker pull idein/onnigiri:20231114\n```\n\n\n## Usage\n[SSD](https://github.com/onnx/models/tree/main/vision/object_detection_segmentation/ssd)\n\n```\n$ onnigiri ssd-10.onnx -o ssd-10-main.onnx --from image --to Transpose_472 Transpose_661\n$ onnigiri ssd-10.onnx -o ssd-10-post.onnx --from Transpose_472 Transpose_661 --to bboxes labels scores\n```\n\nWith docker:\n\n```\n$ docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/onnigiri:20221014 ssd-10.onnx -o ssd-10-main.onnx --from image --to Transpose_472 Transpose_661\n$ docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/onnigiri:20221014 ssd-10.onnx -o ssd-10-post.onnx  --from Transpose_472 Transpose_661 --to bboxes labels scores\n```\n\n[UltraFace](https://github.com/onnx/models/tree/main/vision/body_analysis/ultraface)\n\n```\n$ onnigiri version-RFB-640.onnx -o version-RFB-640-main.onnx --from input --to 460 scores\n$ onnigiri version-RFB-640.onnx -o version-RFB-640-post.onnx --from 460 --to boxes\n```\n\n[tiny-yolov3](https://github.com/onnx/models/tree/main/vision/object_detection_segmentation/tiny-yolov3)\n\n```\n$ onnigiri tiny-yolov3-11.onnx --fix-input-shape 'input_1' '1,3,256,256' 'image_shape' '1,2' -o tiny-yolov3-11-main.onnx --from input_1 --to 'TFNodes/yolo_evaluation_layer_1/Reshape_3:0' 'model_1/leaky_re_lu_10/LeakyRelu:0' 'model_1/leaky_re_lu_5/LeakyRelu:0'\n$ onnigiri tiny-yolov3-11.onnx --fix-input-shape 'input_1' '1,3,256,256' 'image_shape' '1,2' -o tiny-yolov3-11-post.onnx --from image_shape 'TFNodes/yolo_evaluation_layer_1/Reshape_3:0' 'model_1/leaky_re_lu_10/LeakyRelu:0' 'model_1/leaky_re_lu_5/LeakyRelu:0' --to 'yolonms_layer_1' 'yolonms_layer_1:1' 'yolonms_layer_1:2'\n```\n\n## Q&A\n\n- How to get the name of values?\n\nUse [Netron](https://netron.app).\n\n- Why is the extracted subgraph different from the original subgraph?\n\nonnigiri apply [onnx-simplifier](https://github.com/daquexian/onnx-simplifier) before extraction. You can disable the graph optimization by the onnx-simplifier using the `--no-optimization` option.\n\n## Development Guide\n\n```\n$ poetry install\n```\n\n### Build docker image\n\n```\n$ nix build '.#dockerimage' -o image\n$ docker load < ./image\n```\n\n## Related project\n\n- [onnion](https://github.com/Idein/onnion)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "onnx-divider",
    "version": "0.4.0",
    "project_urls": {
        "Homepage": "https://github.com/Idein/onnigiri",
        "Repository": "https://github.com/Idein/onnigiri"
    },
    "split_keywords": [
        "onnx"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba3e511cc6e167b0ec3cebdfd1789ce9719dafb3f53fee595c35bfecd3f6109b",
                "md5": "82f07b70571786464060dffebf580f44",
                "sha256": "8e29eb2ef08346932ca6e4c24eff2bd4463f8985f42c08b6501af1bfb1b13445"
            },
            "downloads": -1,
            "filename": "onnigiri-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "82f07b70571786464060dffebf580f44",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 4611,
            "upload_time": "2023-11-14T06:23:33",
            "upload_time_iso_8601": "2023-11-14T06:23:33.221583Z",
            "url": "https://files.pythonhosted.org/packages/ba/3e/511cc6e167b0ec3cebdfd1789ce9719dafb3f53fee595c35bfecd3f6109b/onnigiri-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d56eb740e671073dbd62aee68cfa845fe1295e36f9993f3290de7bab703a0485",
                "md5": "18dc308a16c8e047eb1743fd0ced9ed3",
                "sha256": "bcb5f67d23d094e0698a454151e83fb1473c211a8253fc76571ea58c97ee226b"
            },
            "downloads": -1,
            "filename": "onnigiri-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "18dc308a16c8e047eb1743fd0ced9ed3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 3930,
            "upload_time": "2023-11-14T06:23:36",
            "upload_time_iso_8601": "2023-11-14T06:23:36.457532Z",
            "url": "https://files.pythonhosted.org/packages/d5/6e/b740e671073dbd62aee68cfa845fe1295e36f9993f3290de7bab703a0485/onnigiri-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-14 06:23:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Idein",
    "github_project": "onnigiri",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "lcname": "onnigiri"
}
        
Elapsed time: 2.11824s