{"id":19024019,"url":"https://github.com/cvhub520/sam-hq","last_synced_at":"2025-09-06T19:32:32.842Z","repository":{"id":206823112,"uuid":"717776035","full_name":"CVHub520/sam-hq","owner":"CVHub520","description":"This project showcases the deployment of the encoder and decoder model using ONNXRUNTIME in Python.","archived":false,"fork":false,"pushed_at":"2023-11-13T02:01:31.000Z","size":49846,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-08T20:47:46.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/CVHub520.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":"2023-11-12T15:04:13.000Z","updated_at":"2024-10-14T09:21:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"4cc63451-55ce-413b-92c1-7bc65fd80322","html_url":"https://github.com/CVHub520/sam-hq","commit_stats":null,"previous_names":["cvhub520/sam-hq"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVHub520%2Fsam-hq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVHub520%2Fsam-hq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVHub520%2Fsam-hq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVHub520%2Fsam-hq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CVHub520","download_url":"https://codeload.github.com/CVHub520/sam-hq/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232141318,"owners_count":18478341,"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":"2024-11-08T20:34:29.348Z","updated_at":"2025-01-02T01:26:30.947Z","avatar_url":"https://github.com/CVHub520.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Segment Anything in High Quality\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/segment-anything-in-high-quality/zero-shot-segmentation-on-segmentation-in-the)](https://paperswithcode.com/sota/zero-shot-segmentation-on-segmentation-in-the?p=segment-anything-in-high-quality)\n\u003ca href=\"https://colab.research.google.com/drive/1QwAbn5hsdqKOD5niuBzuqQX4eLCbNKFL?usp=sharing\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"\u003e\u003c/a\u003e\n[![Huggingfaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/sam-hq-team/sam-hq)\n[![Open in OpenXLab](https://cdn-static.openxlab.org.cn/app-center/openxlab_app.svg)](https://openxlab.org.cn/apps/detail/keleiwhu/sam-hq)\n\n\n\u003e [**Segment Anything in High Quality**](https://arxiv.org/abs/2306.01567)           \n\u003e NeurIPS 2023  \n\u003e ETH Zurich \u0026 HKUST\n\n## **ONNX export**\nThe HQ-SAM's heavy encoder and lightweight mask decoder can be exported to ONNX format so that it can be run in any environment that supports ONNX runtime. Export the model with `run.sh`\n\n[Option-1]\n\nYou can see the [example notebook](https://colab.research.google.com/drive/11U2La49c2IxahzJkAV-EzPqEH3cz_5hq?usp=sharing) for details on how to combine image preprocessing via HQ-SAM's backbone with mask prediction using the ONNX model. It is recommended to use the latest stable version of PyTorch for ONNX export.\n\n[Option-2]\n\nIf you are targeting a deployment scenario, it's recommended refer to the example in `scripts/main.py`. Similarly, you can find the execution command in the `run.sh` script.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./workdir/ort_demo_results/example4_box.png\" alt=\"example4_box\" width=\"250\"/\u003e\n  \u003cimg src=\"./workdir/ort_demo_results/example4_point1.png\" alt=\"example4_point1\" width=\"250\"/\u003e\n  \u003cimg src=\"./workdir/ort_demo_results/example4_point2.png\" alt=\"example4_point2\" width=\"250\"/\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\u003cstrong\u003eOnnxRuntime Demo Results\u003c/strong\u003e\u003c/p\u003e\n\u003c/div\u003e\n\nCitation\n---------------\nIf you find HQ-SAM useful in your research or refer to the provided baseline results, please star :star: this repository and consider citing :pencil::\n```\n@article{sam_hq,\n    title={Segment Anything in High Quality},\n    author={Ke, Lei and Ye, Mingqiao and Danelljan, Martin and Liu, Yifan and Tai, Yu-Wing and Tang, Chi-Keung and Yu, Fisher},\n    journal = {arXiv:2306.01567},\n    year = {2023}\n}  \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvhub520%2Fsam-hq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvhub520%2Fsam-hq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvhub520%2Fsam-hq/lists"}