From 5d73a6b268015a6b31cd9a59e1ad4b5d3fd93555 Mon Sep 17 00:00:00 2001 From: Nils Mechtel Date: Thu, 24 Oct 2024 23:43:24 +0200 Subject: [PATCH] update service id --- bioimageio_colab/register_sam_service.py | 3 +-- plugins/bioimageio-colab-annotator.imjoy.html | 2 +- test/test_model_service.py | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bioimageio_colab/register_sam_service.py b/bioimageio_colab/register_sam_service.py index ecf977d..d699607 100644 --- a/bioimageio_colab/register_sam_service.py +++ b/bioimageio_colab/register_sam_service.py @@ -247,10 +247,9 @@ async def register_service(args: dict) -> None: } ) sid = service_info["id"] - client_service = sid.split("/")[1] logger.info(f"Registered service with ID: {sid}") logger.info( - f"Test the service here: {args.server_url}/{args.workspace_name}/services/{client_service}/hello" + f"Test the service here: {args.server_url}/{args.workspace_name}/services/{args.service_id}/hello" ) diff --git a/plugins/bioimageio-colab-annotator.imjoy.html b/plugins/bioimageio-colab-annotator.imjoy.html index 0fbeabb..c3978cf 100644 --- a/plugins/bioimageio-colab-annotator.imjoy.html +++ b/plugins/bioimageio-colab-annotator.imjoy.html @@ -47,7 +47,7 @@ await api.alert("Please provide the annotation service ID in the configuration."); return; } - const samServiceId = "bioimageio-colab/*:microsam"; + const samServiceId = "bioimageio-colab/microsam"; // Create and display the viewer window const viewer = await api.createWindow({src: "https://kaibu.org/#/app", fullscreen: true}); diff --git a/test/test_model_service.py b/test/test_model_service.py index c64a867..b76d609 100644 --- a/test/test_model_service.py +++ b/test/test_model_service.py @@ -9,7 +9,7 @@ def test_service_available(): - service_url = f"{SERVER_URL}/{WORKSPACE_NAME}/services/*:{SERVICE_ID}/hello" + service_url = f"{SERVER_URL}/{WORKSPACE_NAME}/services/{SERVICE_ID}/hello" response = requests.get(service_url) assert response.status_code == 200 assert response.json() == "Welcome to the Interactive Segmentation service!" @@ -18,9 +18,8 @@ def test_get_service(): client = connect_to_server({"server_url": SERVER_URL, "method_timeout": 5}) assert client - sid = f"{WORKSPACE_NAME}/*:{SERVICE_ID}" + sid = f"{WORKSPACE_NAME}/{SERVICE_ID}" segment_svc = client.get_service(sid, {"mode": "random"}) - assert segment_svc.id == sid assert segment_svc.config.workspace == WORKSPACE_NAME assert segment_svc.get("segment") assert segment_svc.get("clear_cache")