{"id":15662597,"url":"https://github.com/pinto0309/json2onnx","last_synced_at":"2025-05-05T23:12:46.849Z","repository":{"id":62572787,"uuid":"361459353","full_name":"PINTO0309/json2onnx","owner":"PINTO0309","description":"Converts a JSON file to an ONNX file.","archived":false,"fork":false,"pushed_at":"2023-09-02T04:40:32.000Z","size":24,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T23:12:39.629Z","etag":null,"topics":["cli","converter","json","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}},"created_at":"2021-04-25T15:03:19.000Z","updated_at":"2024-11-07T19:19:42.000Z","dependencies_parsed_at":"2024-10-23T08:25:05.813Z","dependency_job_id":"61a73857-9d83-48d6-8273-131bcb864d4e","html_url":"https://github.com/PINTO0309/json2onnx","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"b8d1d90d2a46aa83f7789c2ed4564ba884cc8a97"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjson2onnx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjson2onnx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjson2onnx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjson2onnx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PINTO0309","download_url":"https://codeload.github.com/PINTO0309/json2onnx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590628,"owners_count":21772940,"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","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","converter","json","model-converter","onnx","python"],"created_at":"2024-10-03T13:33:29.526Z","updated_at":"2025-05-05T23:12:46.824Z","avatar_url":"https://github.com/PINTO0309.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json2onnx\nConverts a JSON file to an ONNX file. Click here for **[onnx2json](https://github.com/PINTO0309/onnx2json)**.\n\nhttps://github.com/PINTO0309/simple-onnx-processing-tools\n\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/json2onnx?color=2BAF2B\u0026label=Downloads%EF%BC%8FInstalled)](https://pypistats.org/packages/json2onnx) ![GitHub](https://img.shields.io/github/license/PINTO0309/json2onnx?color=2BAF2B) [![PyPI](https://img.shields.io/pypi/v/json2onnx?color=2BAF2B)](https://pypi.org/project/json2onnx/)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/33194443/170163032-14b9f769-6f71-41b7-a67b-db168cff949e.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 protobuf \\\n\u0026\u0026 python3 -m pip install -U onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com \\\n\u0026\u0026 pip install -U json2onnx\n```\n### 1-2. Docker\nhttps://github.com/PINTO0309/simple-onnx-processing-tools#docker\n\n## 2. CLI Usage\n```\nusage:\n  json2onnx [-h]\n  --ij INPUT_JSON_PATH\n  -of OUTPUT_ONNX_FILE_PATH\n\noptional arguments:\n  -h, --help\n      show this help message and exit\n\n  -ij INPUT_JSON_PATH, --input_json_path INPUT_JSON_PATH\n      Input JSON file path (*.json)\n\n  -of OUTPUT_ONNX_FILE_PATH, --output_onnx_file_path OUTPUT_ONNX_FILE_PATH\n      Output ONNX model path (*.onnx)\n```\n\n## 3. In-script Usage\n```python\n\u003e\u003e\u003e from json2onnx import convert\n\u003e\u003e\u003e help(convert)\n\nHelp on function convert in module json2onnx.json2onnx:\n\nconvert(\n  input_json_path: Union[str, NoneType] = '',\n  json_dict: Union[dict, NoneType] = None,\n  output_onnx_file_path: Union[str, NoneType] = ''\n)\n\n    Parameters\n    ----------\n    input_json_path: Optional[str]\n        Input onnx file path.\n        Either input_json_path or json_dict must be specified.\n        Default: ''\n\n    json_dict: Optional[dict]\n        onnx.ModelProto.\n        Either input_onnx_file_path or json_dict must be specified.\n        json_dict If specified, ignore input_json_path and process json_dict.\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    Returns\n    -------\n    onnx_graph: onnx.ModelProto\n        Converted ONNX.\n```\n\n## 4. CLI Execution\n```bash\n$ json2onnx \\\n--input_json_path NonMaxSuppression.json \\\n--output_onnx_file_path NonMaxSuppression.onnx\n```\n\n## 5. In-script Execution\n```python\nfrom json2onnx import convert\n\nonnx_graph = convert(\n  input_json_path=\"NonMaxSuppression.json\",\n  output_onnx_file_path=\"NonMaxSuppression.onnx\",\n)\n\n# or\n\nonnx_graph = convert(\n  input_json_path=\"NonMaxSuppression.json\",\n)\n\n# or\n\nonnx_graph = convert(\n  json_dict=json_data,\n  output_onnx_file_path=\"NonMaxSuppression.onnx\",\n)\n\n# or\n\nonnx_graph = convert(\n  json_dict=json_data,\n)\n```\n\n## 6. Issues\nhttps://github.com/PINTO0309/simple-onnx-processing-tools/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fjson2onnx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinto0309%2Fjson2onnx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fjson2onnx/lists"}