{"id":15695871,"url":"https://github.com/pinto0309/soc4onnx","last_synced_at":"2025-07-28T05:06:34.019Z","repository":{"id":57673680,"uuid":"482116438","full_name":"PINTO0309/soc4onnx","owner":"PINTO0309","description":"A very simple tool that forces a change in the opset of an ONNX graph. Simple Opset Changer for ONNX.","archived":false,"fork":false,"pushed_at":"2022-09-09T16:28:01.000Z","size":24,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-17T15:54:31.620Z","etag":null,"topics":["cli","model-converter","models","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}},"created_at":"2022-04-16T00:19:10.000Z","updated_at":"2024-04-19T15:04:26.000Z","dependencies_parsed_at":"2022-08-31T12:50:52.797Z","dependency_job_id":null,"html_url":"https://github.com/PINTO0309/soc4onnx","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/PINTO0309/soc4onnx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoc4onnx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoc4onnx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoc4onnx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoc4onnx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PINTO0309","download_url":"https://codeload.github.com/PINTO0309/soc4onnx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fsoc4onnx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267464522,"owners_count":24091505,"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-07-28T02:00:09.689Z","response_time":68,"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","models","onnx","python"],"created_at":"2024-10-03T19:05:15.431Z","updated_at":"2025-07-28T05:06:33.973Z","avatar_url":"https://github.com/PINTO0309.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# soc4onnx\nA very simple tool that forces a change in the opset of an ONNX graph. **S**imple **O**pset **C**hanger for **ONNX**.\n\nhttps://github.com/PINTO0309/simple-onnx-processing-tools\n\n[![Downloads](https://static.pepy.tech/personalized-badge/soc4onnx?period=total\u0026units=none\u0026left_color=grey\u0026right_color=brightgreen\u0026left_text=Downloads)](https://pepy.tech/project/soc4onnx) ![GitHub](https://img.shields.io/github/license/PINTO0309/soc4onnx?color=2BAF2B) [![PyPI](https://img.shields.io/pypi/v/soc4onnx?color=2BAF2B)](https://pypi.org/project/soc4onnx/) [![CodeQL](https://github.com/PINTO0309/soc4onnx/workflows/CodeQL/badge.svg)](https://github.com/PINTO0309/soc4onnx/actions?query=workflow%3ACodeQL)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/33194443/170156330-458c1df1-cdb9-47db-9eab-fadac9bf52a0.png\" /\u003e\n\u003c/p\u003e\n\n## 1. Setup\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 pip install -U soc4onnx\n```\n### 1-2. Docker\nhttps://github.com/PINTO0309/simple-onnx-processing-tools#docker\n\n## 2. CLI Usage\n```\n$ soc4onnx -h\n\nusage:\n    soc4onnx [-h]\n    -if INPUT_ONNX_FILE_PATH\n    -of OUTPUT_ONNX_FILE_PATH\n    -os OPSET\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  -of OUTPUT_ONNX_FILE_PATH, --output_onnx_file_path OUTPUT_ONNX_FILE_PATH\n        Output onnx file path.\n\n  -os OPSET, --opset OPSET\n        opset number to be changed. e.g. --opset 11\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$ python\n\u003e\u003e\u003e from soc4onnx import change\n\u003e\u003e\u003e help(change)\nHelp on function change in module soc4onnx.onnx_opset_change:\n\nchange(\n  opset: int,\n  input_onnx_file_path: Union[str, NoneType] = '',\n  output_onnx_file_path: Union[str, NoneType] = '',\n  onnx_graph: Union[onnx.onnx_ml_pb2.ModelProto, NoneType] = None,\n  non_verbose: Union[bool, NoneType] = False\n) -\u003e onnx.onnx_ml_pb2.ModelProto\n\n    Parameters\n    ----------\n    opset: int\n        opset number to be changed.\n        e.g. --opset 11\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\n    output_onnx_file_path: Optional[str]\n        Output onnx file path.\n        If output_onnx_file_path is not specified, no .onnx file is output.\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    non_verbose: Optional[bool]\n        Do not show all information logs. Only error logs are displayed.\n        Default: False\n\n    Returns\n    -------\n    changed_graph: onnx.ModelProto\n        opset changed onnx ModelProto\n```\n\n## 4. CLI Execution\n```bash\n$ soc4onnx \\\n--input_onnx_file_path NonMaxSuppression.onnx \\\n--output_onnx_file_path NonMaxSuppression_13.onnx \\\n--opset 13\n```\n\n## 5. In-script Execution\n```python\nfrom soc4onnx import change\n\nchanged_graph = change(\n    onnx_graph=graph,\n    opset=13,\n    non_verbose=True,\n)\n```\n\n## 6. Sample\n![image](https://user-images.githubusercontent.com/33194443/163655662-622b470c-c893-439a-82b0-85bd6a406647.png)\n```bash\n$ soc4onnx \\\n--input_onnx_file_path NonMaxSuppression.onnx \\\n--output_onnx_file_path NonMaxSuppression_13.onnx \\\n--opset 13\n```\n![image](https://user-images.githubusercontent.com/33194443/163655699-b456b01b-957a-40f6-9703-547c1769f8d8.png)\n\n## 7. Issues\nhttps://github.com/PINTO0309/simple-onnx-processing-tools/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fsoc4onnx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinto0309%2Fsoc4onnx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fsoc4onnx/lists"}