{"id":27310595,"url":"https://github.com/danielfrg/astro-react-onnx-template","last_synced_at":"2025-04-12T05:58:14.225Z","repository":{"id":278962515,"uuid":"937259512","full_name":"danielfrg/astro-react-onnx-template","owner":"danielfrg","description":"Template for an Astro website that loads an ONNX model, all in client side","archived":false,"fork":false,"pushed_at":"2025-02-23T17:59:02.000Z","size":326,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T05:58:07.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://danielfrg.github.io/astro-react-onnx-template/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielfrg.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":"2025-02-22T17:58:03.000Z","updated_at":"2025-02-23T17:59:05.000Z","dependencies_parsed_at":"2025-02-22T20:29:28.045Z","dependency_job_id":"127ad45b-ca69-42ab-b56b-b69c6852c99d","html_url":"https://github.com/danielfrg/astro-react-onnx-template","commit_stats":null,"previous_names":["danielfrg/astro-react-onnx-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfrg%2Fastro-react-onnx-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfrg%2Fastro-react-onnx-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfrg%2Fastro-react-onnx-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfrg%2Fastro-react-onnx-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielfrg","download_url":"https://codeload.github.com/danielfrg/astro-react-onnx-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525154,"owners_count":21118616,"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":[],"created_at":"2025-04-12T05:58:13.469Z","updated_at":"2025-04-12T05:58:14.217Z","avatar_url":"https://github.com/danielfrg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astro React ONNX runtime template\n\nTemplate for an Astro website that loads an ONNX model and uses ONNX runtime\nto run it, all in client side.\n\n- Creates a test model is that doubles a vector\n- Web Worker that loads the models and communicates with a React Component\n\nDemo: [danielfrg.github.io/astro-react-onnx-template](https://danielfrg.github.io/astro-react-onnx-template/)\n\n![alt text](https://github.com/danielfrg/astro-react-onnx-template/blob/main/public/images/preview.png?raw=true)\n\n## Create the test model\n\nThis is done using Python, since most models are done in Python.\n\n```\ncd python\n\nuv sync\n\nuv run python gen_double_model.py\n```\n\nOptimization: For most models you want to pass the models through a simplifier\nlike [`onnxsim`](https://github.com/daquexian/onnx-simplifier/)\nand possible also convert them to ORT:\n\n```\nonnxsim model model.sim.onnx\nuv run python -m onnxruntime.tools.convert_onnx_models_to_ort model.onnx\n```\n\n## Web setup\n\nRegular astro website:\n\n```\nnpm install\n```\n\nCopy the WASM ONNX Runtime from `node_modules` to the to the `/public` dir so\nthey can be loaded.\n\n```\njust copy-onnx-wasm\n```\n\n```\nnpm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfrg%2Fastro-react-onnx-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielfrg%2Fastro-react-onnx-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfrg%2Fastro-react-onnx-template/lists"}