Skip to content

Commit

Permalink
Merge to main
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Sep 2, 2024
1 parent dd4defd commit a0152e8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bioimageio/engine/ray_app_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def create_ray_serve_config(app_info):
if "hypha-rpc" not in runtime_env["pip"]:
runtime_env["pip"].append("hypha-rpc")
runtime_env["pip"].append(
"https://github.com/bioimage-io/bioengine/archive/refs/heads/support-ray-apps.zip"
"https://github.com/bioimage-io/bioengine/archive/refs/heads/main.zip"
)
return ray_serve_config

Expand Down
2 changes: 1 addition & 1 deletion bioimageio/engine/ray_app_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"runtime_env": {
"pip": [
"hypha-rpc",
"https://github.com/bioimage-io/bioengine/archive/refs/heads/support-ray-apps.zip",
"https://github.com/bioimage-io/bioengine/archive/refs/heads/main.zip",
]
}
}
Expand Down
26 changes: 26 additions & 0 deletions tests/test_micro_sam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from hypha_rpc.sync import connect_to_server
import numpy as np


def test_get_service(
server_url: str="https://hypha.aicell.io",
workspace_name: str="bioengine-apps",
service_id: str="micro_sam",
):
client = connect_to_server({"server_url": server_url, "method_timeout": 5})
assert client

sid = f"{workspace_name}/{service_id}"
segment_svc = client.get_service(sid)
assert segment_svc.config.workspace == workspace_name
assert segment_svc.get("compute_embedding")
assert segment_svc.get("segment")
assert segment_svc.get("reset_embedding")

assert segment_svc.compute_embedding("vit_b", np.random.rand(256, 256))
features = segment_svc.segment([[128, 128]], [1])
assert features
assert segment_svc.reset_embedding()

if __name__ == "__main__":
test_get_service()

0 comments on commit a0152e8

Please sign in to comment.