{"id":15934747,"url":"https://github.com/pinto0309/soa4onnx","last_synced_at":"2025-09-10T04:37:06.227Z","repository":{"id":57690802,"uuid":"494426538","full_name":"PINTO0309/soa4onnx","owner":"PINTO0309","description":"Simple model Output OP Additional tools for ONNX.","archived":false,"fork":false,"pushed_at":"2025-03-21T13:46:55.000Z","size":649,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-18T16:57:52.018Z","etag":null,"topics":["cli","model-converter","onnx","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PINTO0309.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-20T10:49:33.000Z","updated_at":"2025-03-21T13:46:59.000Z","dependencies_parsed_at":"2024-10-07T03:21:07.933Z","dependency_job_id":"d0afee45-7000-4045-80fc-71d9093ee164","html_url":"https://github.com/PINTO0309/soa4onnx","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/PINTO0309/soa4onnx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoa4onnx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoa4onnx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoa4onnx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoa4onnx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PINTO0309","download_url":"https://codeload.github.com/PINTO0309/soa4onnx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoa4onnx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274412253,"owners_count":25280197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","model-converter","onnx","python"],"created_at":"2024-10-07T03:20:56.095Z","updated_at":"2025-09-10T04:37:06.179Z","avatar_url":"https://github.com/PINTO0309.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# soa4onnx\n**S**imple model **O**utput OP **A**dditional tools for **ONNX**.\n\nhttps://github.com/PINTO0309/simple-onnx-processing-tools\n\n[![Downloads](https://static.pepy.tech/personalized-badge/soa4onnx?period=total\u0026units=none\u0026left_color=grey\u0026right_color=brightgreen\u0026left_text=Downloads)](https://pepy.tech/project/soa4onnx) ![GitHub](https://img.shields.io/github/license/PINTO0309/soa4onnx?color=2BAF2B) [![PyPI](https://img.shields.io/pypi/v/soa4onnx?color=2BAF2B)](https://pypi.org/project/soa4onnx/) [![CodeQL](https://github.com/PINTO0309/soa4onnx/workflows/CodeQL/badge.svg)](https://github.com/PINTO0309/soa4onnx/actions?query=workflow%3ACodeQL)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/33194443/170158425-7d8a87c3-b1e7-44cb-8b8f-bd3e9806f020.png\" /\u003e\n\u003c/p\u003e\n\n## 1. Setup\n\n### 1-1. HostPC\n```bash\n### option\n$ echo export PATH=\"~/.local/bin:$PATH\" \u003e\u003e ~/.bashrc \\\n\u0026\u0026 source ~/.bashrc\n\n### run\n$ pip install -U onnx \\\n\u0026\u0026 python3 -m pip install -U onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com \\\n\u0026\u0026 pip install -U soa4onnx\n```\n### 1-2. Docker\nhttps://github.com/PINTO0309/simple-onnx-processing-tools#docker\n\n## 2. CLI Usage\n```\n$ soa4onnx -h\n\nusage:\n    soa4onnx [-h]\n    -if INPUT_ONNX_FILE_PATH\n    -on OUTPUT_OP_NAMES [OUTPUT_OP_NAMES ...]\n    -of OUTPUT_ONNX_FILE_PATH\n    [-d]\n    [-n]\n\noptional arguments:\n  -h, --help\n        show this help message and exit.\n\n  -if INPUT_ONNX_FILE_PATH, --input_onnx_file_path INPUT_ONNX_FILE_PATH\n        Input onnx file path.\n\n  -on OUTPUT_OP_NAMES [OUTPUT_OP_NAMES ...], \\\n    --output_op_names OUTPUT_OP_NAMES [OUTPUT_OP_NAMES ...]\n        Output name to be added to the models output OP.\n        e.g.\n        --output_op_names \"onnx::Gather_76\" \"onnx::Add_89\"\n\n  -of OUTPUT_ONNX_FILE_PATH, --output_onnx_file_path OUTPUT_ONNX_FILE_PATH\n        Output onnx file path.\n\n  -d, --do_not_type_check\n        Whether not to check that input and output tensors have data types defined.'\n\n  -n, --non_verbose\n        Do not show all information logs. Only error logs are displayed.\n```\n\n## 3. In-script Usage\n```python\n\u003e\u003e\u003e from soa4onnx import outputs_add\n\u003e\u003e\u003e help(outputs_add)\n\nHelp on function outputs_add in module soa4onnx.onnx_model_output_adder:\n\noutputs_add(\n    input_onnx_file_path: Union[str, NoneType] = '',\n    onnx_graph: Union[onnx.onnx_ml_pb2.ModelProto, NoneType] = None,\n    output_op_names: Union[List[str], NoneType] = [],\n    output_onnx_file_path: Union[str, NoneType] = '',\n    do_not_type_check: Union[bool, NoneType] = False,\n    non_verbose: Union[bool, NoneType] = False\n) -\u003e onnx.onnx_ml_pb2.ModelProto\n\n    Parameters\n    ----------\n    input_onnx_file_path: Optional[str]\n        Input onnx file path.\n        Either input_onnx_file_path or onnx_graph must be specified.\n        Default: ''\n\n    onnx_graph: Optional[onnx.ModelProto]\n        onnx.ModelProto.\n        Either input_onnx_file_path or onnx_graph must be specified.\n        onnx_graph If specified, ignore input_onnx_file_path and process onnx_graph.\n\n    output_op_names: List[str]\n        Output name to be added to the models output OP.\n        If an output OP name other than one that already exists in the model is\n        specified, it is ignored.\n        e.g.\n        output_op_names = [\"onnx::Gather_76\", \"onnx::Add_89\"]\n\n    output_onnx_file_path: Optional[str]\n        Output onnx file path. If not specified, no ONNX file is output.\n        Default: ''\n\n    do_not_type_check: Optional[bool]\n        Whether not to check that input and output tensors have data types defined.\n        Default: False\n\n    non_verbose: Optional[bool]\n        Do not show all information logs. Only error logs are displayed.\n        Default: False\n\n    Returns\n    -------\n    outputops_added_graph: onnx.ModelProto\n        onnx.ModelProto with output OP added\n```\n\n## 4. CLI Execution\n```bash\n$ soa4onnx \\\n--input_onnx_file_path fusionnet_180x320.onnx \\\n--output_op_names \"onnx::Gather_76\" \"onnx::Add_89\" \\\n--output_onnx_file_path fusionnet_180x320_added.onnx\n```\n\n## 5. In-script Execution\n```python\nfrom soa4onnx import outputs_add\n\nonnx_graph = outputs_add(\n    input_onnx_file_path=\"fusionnet_180x320.onnx\",\n    output_op_names=[\"onnx::Gather_76\", \"onnx::Add_89\"],\n    output_onnx_file_path=\"fusionnet_180x320_added.onnx\",\n)\n```\n\n## 6. Sample\n```bash\n$ soa4onnx \\\n--input_onnx_file_path fusionnet_180x320.onnx \\\n--output_op_names \"onnx::Gather_76\" \"onnx::Add_89\" \\\n--output_onnx_file_path fusionnet_180x320_added.onnx\n```\n### Before\n![image](https://user-images.githubusercontent.com/33194443/169518171-aa0f7a40-18ad-4393-a409-31ac0eea24bc.png)\n![image](https://user-images.githubusercontent.com/33194443/169518858-c6230f56-23c3-4925-906f-5db9f7bf8a19.png)\n![image](https://user-images.githubusercontent.com/33194443/169519158-8f0e5025-a002-44f5-8856-3267110d053a.png)\n\n### After\n![image](https://user-images.githubusercontent.com/33194443/169518194-76b9306a-1bf9-4f06-ae1b-821fd84cdf02.png)\n\n## 7. Reference\n1. https://github.com/onnx/onnx/blob/main/docs/Operators.md\n2. https://docs.nvidia.com/deeplearning/tensorrt/onnx-graphsurgeon/docs/index.html\n3. https://github.com/NVIDIA/TensorRT/tree/main/tools/onnx-graphsurgeon\n4. https://github.com/PINTO0309/simple-onnx-processing-tools\n5. https://github.com/PINTO0309/PINTO_model_zoo\n\n## 8. Issues\nhttps://github.com/PINTO0309/simple-onnx-processing-tools/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fsoa4onnx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinto0309%2Fsoa4onnx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fsoa4onnx/lists"}