{"id":27604017,"url":"https://github.com/wkentaro/osam","last_synced_at":"2026-01-16T06:58:01.097Z","repository":{"id":221177266,"uuid":"743132894","full_name":"wkentaro/osam","owner":"wkentaro","description":"Get up and running with SAM, EfficientSAM, YOLO-World, and other promptable vision models locally.","archived":false,"fork":false,"pushed_at":"2025-03-15T11:15:32.000Z","size":17051,"stargazers_count":52,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-20T07:40:58.356Z","etag":null,"topics":["computer-vision","deep-learning","foundation-models","onnx","segment-anything"],"latest_commit_sha":null,"homepage":"https://github.com/wkentaro/osam","language":"Python","has_issues":true,"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/wkentaro.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":"2024-01-14T12:41:28.000Z","updated_at":"2025-04-16T08:20:03.000Z","dependencies_parsed_at":"2024-02-12T12:57:43.142Z","dependency_job_id":"a3f5728e-5b33-40ef-a334-06186e6d0d7e","html_url":"https://github.com/wkentaro/osam","commit_stats":null,"previous_names":["wkentaro/osam","osamproject/osam"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkentaro%2Fosam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkentaro%2Fosam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkentaro%2Fosam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkentaro%2Fosam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wkentaro","download_url":"https://codeload.github.com/wkentaro/osam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306836,"owners_count":21408978,"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":["computer-vision","deep-learning","foundation-models","onnx","segment-anything"],"created_at":"2025-04-22T19:22:34.772Z","updated_at":"2026-01-16T06:58:01.085Z","avatar_url":"https://github.com/wkentaro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"logo\" height=\"200px\" src=\"https://github.com/wkentaro/osam/raw/main/.readme/icon.png\" \u003e\n  \u003ch1\u003eOsam\u003c/h1\u003e\n  \u003cp\u003e\n    Get up and running with promptable vision models locally.\n  \u003c/p\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/div\u003e\n\n*Osam* (/oʊˈsɑm/) is a tool to run open-source promptable vision models locally\n(inspired by [Ollama](https://github.com/ollama/ollama)).\n\n*Osam* provides:\n\n- **Promptable Vision Models** - Segment Anything Model (SAM), EfficientSAM, YOLO-World;\n- **Local APIs** - CLI \u0026 Python \u0026 HTTP interface;\n- **Customization** - Host custom vision models.\n\n\n## Installation\n\n### Pip\n\n\u003ca href=\"https://pypi.org/project/osam\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/osam.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pypi.python.org/pypi/osam\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/osam.svg\"\u003e\u003c/a\u003e\n\n```bash\npip install osam\n```\n\n**For `osam serve`**:\n\n```bash\npip install osam[serve]\n```\n\n## Quickstart\n\nTo run with EfficientSAM:\n\n```bash\nosam run efficientsam --image \u003cimage_file\u003e\n```\n\nTo run with YOLO-World:\n\n```bash\nosam run yoloworld --image \u003cimage_file\u003e\n```\n\n## Model library\n\nHere are models that can be downloaded:\n\n| Model             | Parameters | Size  | Download                     |\n|-------------------|------------|-------|------------------------------|\n| SAM 100M          | 94M        | 100MB | `osam run sam:100m`          |\n| SAM 300M          | 313M       | 310MB | `osam run sam:300m`          |\n| SAM 600M          | 642M       | 630MB | `osam run sam`               |\n| SAM2 Tiny         | 39M        | 150MB | `osam run sam2:tiny`         |\n| SAM2 Small        | 46M        | 170MB | `osam run sam2:small`        |\n| SAM2 BasePlus     | 82M        | 300MB | `osam run sam2`              |\n| SAM2 Large        | 227M       | 870MB | `osam run sam2:large`        |\n| SAM3              | 893M       | 3.4GB | `osam run sam3`              |\n| EfficientSAM 10M  | 10M        | 40MB  | `osam run efficientsam:10m`  |\n| EfficientSAM 30M  | 26M        | 100MB | `osam run efficientsam`      |\n| YOLO-World XL     | 168M       | 640MB | `osam run yoloworld`         |\n\nPS. `sam`, `efficientsam` is equivalent to `sam:latest`, `efficientsam:latest`.\n\n## Usage\n\n### CLI\n\n```bash\n# Run a model with an image\nosam run efficientsam --image examples/_images/dogs.jpg \u003e output.png\n\n# Get a JSON output\nosam run efficientsam --image examples/_images/dogs.jpg --json\n# {\"model\": \"efficientsam\", \"mask\": \"...\"}\n\n# Give a prompt\n# 1. point prompt (background=0, foreground=1)\nosam run efficientsam --image examples/_images/dogs.jpg \\\n  --prompt '{\"points\": [[1439, 504], [1439, 1289]], \"point_labels\": [1, 1]}' \\\n  \u003e efficientsam_point.png\n# 2. box prompt (lt=2, rb=3)\nosam run sam2 --image examples/_images/dogs.jpg \\\n  --prompt '{\"points\": [[1233, 376], [1649, 691]], \"point_labels\": [2, 3]}' \\\n  \u003e sam2_box.png\n# 3. text prompt\nosam run sam3 --image examples/_images/dogs.jpg --prompt '{\"texts\": [\"dog\"]}' \\\n  \u003e sam3_text.png\n```\n\n\u003cimg src=\"https://github.com/wkentaro/osam/raw/main/.readme/dogs_efficientsam.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/wkentaro/osam/raw/main/.readme/dogs_sam2.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/wkentaro/osam/raw/main/.readme/dogs_sam3.png\" width=\"30%\"\u003e  \n\u003ci\u003eOutput images: 'efficientsam_point.png', 'sam2_box.png', 'sam3_text.png'\u003c/i\u003e\n\n### Python\n\n```python\nimport osam.apis\nimport osam.types\n\nrequest = osam.types.GenerateRequest(\n    model=\"efficientsam\",\n    image=np.asarray(PIL.Image.open(\"examples/_images/dogs.jpg\")),\n    prompt=osam.types.Prompt(points=[[1439, 504], [1439, 1289]], point_labels=[1, 1]),\n)\nresponse = osam.apis.generate(request=request)\nPIL.Image.fromarray(response.mask).save(\"mask.png\")\n```\n\u003cimg src=\"https://github.com/wkentaro/osam/raw/main/examples/_images/dogs.jpg\" width=\"35%\"\u003e \u003cimg src=\"https://github.com/wkentaro/osam/raw/main/.readme/dogs_efficientsam_mask.png\" width=\"35%\"\u003e  \n\u003ci\u003eInput and output images ('dogs.jpg', 'mask.png').\u003c/i\u003e\n\n### HTTP\n\n```bash\n# pip install osam[serve]  # required for `osam serve`\n\n# Get up the server\nosam serve\n\n# POST request\ncurl 127.0.0.1:11368/api/generate -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"model\\\": \\\"efficientsam\\\", \\\"image\\\": \\\"$(cat examples/_images/dogs.jpg | base64)\\\"}\" \\\n  | jq -r .mask | base64 --decode \u003e mask.png\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkentaro%2Fosam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwkentaro%2Fosam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkentaro%2Fosam/lists"}