imaging-server-kit 0.0.3__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/Dockerfile +2 -1
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/PKG-INFO +14 -9
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/README.md +13 -8
- imaging_server_kit-0.0.4/build.sh +6 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/main.py +4 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/_version.py +2 -2
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/client.py +6 -3
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/errors.py +14 -4
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/geometry.py +15 -18
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/registry.py +1 -1
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/serialization.py +1 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/server.py +21 -8
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/templates/info.html +1 -2
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/PKG-INFO +14 -9
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/SOURCES.txt +0 -1
- imaging_server_kit-0.0.4/start_registry.py +8 -0
- imaging_server_kit-0.0.3/Dockerfile-registry +0 -5
- imaging_server_kit-0.0.3/build.sh +0 -14
- imaging_server_kit-0.0.3/start_registry.py +0 -4
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/.dockerignore +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/.gitattributes +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/.github/workflows/publish.yml +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/.gitignore +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/Dockerfile-GPU +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/LICENSE +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/MANIFEST.in +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/examples/.gitkeep +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/pyproject.toml +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/setup.cfg +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/__init__.py +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/assets/style.css +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/encoding.py +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/static/index.css +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/static/info.css +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/templates/index.html +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/web_demo.py +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/dependency_links.txt +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/requires.txt +0 -0
- {imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: imaging-server-kit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Deploy image processing algorithms in FastAPI servers.
|
|
5
5
|
Author-email: Mallory Wittwer <mallory.wittwer@epfl.ch>
|
|
6
6
|
License: Copyright (c) 2024, EPFL
|
|
@@ -64,7 +64,12 @@ Requires-Dist: pytest
|
|
|
64
64
|

|
|
65
65
|
# 🪐 Imaging Server Kit
|
|
66
66
|
|
|
67
|
-
Deploy image processing algorithms in FastAPI servers and easily run them
|
|
67
|
+
Deploy image processing algorithms in FastAPI servers and easily run them from Napari, QuPath, and more.
|
|
68
|
+
|
|
69
|
+
The algorithm servers implement a common set of API endpoints for processing and to document the project. These include:
|
|
70
|
+
- `/process`: Runs the algorithm
|
|
71
|
+
- `/info`: Displays documentation about the algorithm usage
|
|
72
|
+
- `/sample_images`: Provides one or multiple sample images
|
|
68
73
|
|
|
69
74
|
## Usage
|
|
70
75
|
|
|
@@ -72,15 +77,15 @@ Deploy image processing algorithms in FastAPI servers and easily run them in Nap
|
|
|
72
77
|
|
|
73
78
|
Set up and run a server with one, or multiple algorithms from the Imaging Server Kit collection (or your own):
|
|
74
79
|
|
|
75
|
-
- [StarDist](https://github.com/Imaging-Server-Kit/serverkit-stardist)
|
|
76
|
-
- [CellPose](https://github.com/Imaging-Server-Kit/serverkit-cellpose)
|
|
77
|
-
- [Spotiflow](https://github.com/Imaging-Server-Kit/serverkit-spotiflow)
|
|
78
|
-
- [Rembg](https://github.com/Imaging-Server-Kit/serverkit-rembg)
|
|
79
|
-
- [
|
|
80
|
-
- [Orientationpy](https://github.com/Imaging-Server-Kit/serverkit-orientationpy)
|
|
80
|
+
- [StarDist](https://github.com/Imaging-Server-Kit/serverkit-stardist): Object detection with star-convex shapes
|
|
81
|
+
- [CellPose](https://github.com/Imaging-Server-Kit/serverkit-cellpose): A generalist algorithm for cellular segmentation
|
|
82
|
+
- [Spotiflow](https://github.com/Imaging-Server-Kit/serverkit-spotiflow): Accurate and efficient spot detection
|
|
83
|
+
- [Rembg](https://github.com/Imaging-Server-Kit/serverkit-rembg): A tool to remove images background
|
|
84
|
+
- [LoG detector](https://github.com/Imaging-Server-Kit/serverkit-skimage-LoG): Laplacian of Gaussian filter
|
|
85
|
+
- [Orientationpy](https://github.com/Imaging-Server-Kit/serverkit-orientationpy): Measurement of greyscale orientations
|
|
81
86
|
<!-- - [Tau Fibrils Detector](https://github.com/Imaging-Server-Kit/serverkit-tau-fibrils-yolo) -->
|
|
82
87
|
|
|
83
|
-
To
|
|
88
|
+
All of these algorithm servers can be installed locally or built and run with docker. To use docker and serve multiple algorithms, the recommended way is to edit a `docker-compose.yml` file and pull server images from `registry.rcp.epfl.ch` (EPFL users only):
|
|
84
89
|
|
|
85
90
|
```{docker-compose.yml}
|
|
86
91
|
services:
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|

|
|
2
2
|
# 🪐 Imaging Server Kit
|
|
3
3
|
|
|
4
|
-
Deploy image processing algorithms in FastAPI servers and easily run them
|
|
4
|
+
Deploy image processing algorithms in FastAPI servers and easily run them from Napari, QuPath, and more.
|
|
5
|
+
|
|
6
|
+
The algorithm servers implement a common set of API endpoints for processing and to document the project. These include:
|
|
7
|
+
- `/process`: Runs the algorithm
|
|
8
|
+
- `/info`: Displays documentation about the algorithm usage
|
|
9
|
+
- `/sample_images`: Provides one or multiple sample images
|
|
5
10
|
|
|
6
11
|
## Usage
|
|
7
12
|
|
|
@@ -9,15 +14,15 @@ Deploy image processing algorithms in FastAPI servers and easily run them in Nap
|
|
|
9
14
|
|
|
10
15
|
Set up and run a server with one, or multiple algorithms from the Imaging Server Kit collection (or your own):
|
|
11
16
|
|
|
12
|
-
- [StarDist](https://github.com/Imaging-Server-Kit/serverkit-stardist)
|
|
13
|
-
- [CellPose](https://github.com/Imaging-Server-Kit/serverkit-cellpose)
|
|
14
|
-
- [Spotiflow](https://github.com/Imaging-Server-Kit/serverkit-spotiflow)
|
|
15
|
-
- [Rembg](https://github.com/Imaging-Server-Kit/serverkit-rembg)
|
|
16
|
-
- [
|
|
17
|
-
- [Orientationpy](https://github.com/Imaging-Server-Kit/serverkit-orientationpy)
|
|
17
|
+
- [StarDist](https://github.com/Imaging-Server-Kit/serverkit-stardist): Object detection with star-convex shapes
|
|
18
|
+
- [CellPose](https://github.com/Imaging-Server-Kit/serverkit-cellpose): A generalist algorithm for cellular segmentation
|
|
19
|
+
- [Spotiflow](https://github.com/Imaging-Server-Kit/serverkit-spotiflow): Accurate and efficient spot detection
|
|
20
|
+
- [Rembg](https://github.com/Imaging-Server-Kit/serverkit-rembg): A tool to remove images background
|
|
21
|
+
- [LoG detector](https://github.com/Imaging-Server-Kit/serverkit-skimage-LoG): Laplacian of Gaussian filter
|
|
22
|
+
- [Orientationpy](https://github.com/Imaging-Server-Kit/serverkit-orientationpy): Measurement of greyscale orientations
|
|
18
23
|
<!-- - [Tau Fibrils Detector](https://github.com/Imaging-Server-Kit/serverkit-tau-fibrils-yolo) -->
|
|
19
24
|
|
|
20
|
-
To
|
|
25
|
+
All of these algorithm servers can be installed locally or built and run with docker. To use docker and serve multiple algorithms, the recommended way is to edit a `docker-compose.yml` file and pull server images from `registry.rcp.epfl.ch` (EPFL users only):
|
|
21
26
|
|
|
22
27
|
```{docker-compose.yml}
|
|
23
28
|
services:
|
|
@@ -7,6 +7,7 @@ from imaging_server_kit.errors import (
|
|
|
7
7
|
AlgorithmServerError,
|
|
8
8
|
InvalidAlgorithmParametersError,
|
|
9
9
|
ServerRequestError,
|
|
10
|
+
AlgorithmTimeoutError,
|
|
10
11
|
)
|
|
11
12
|
|
|
12
13
|
|
|
@@ -29,7 +30,7 @@ class Client:
|
|
|
29
30
|
services = response.json().get("services")
|
|
30
31
|
self.algorithms = services
|
|
31
32
|
else:
|
|
32
|
-
raise AlgorithmServerError(response.status_code, response.
|
|
33
|
+
raise AlgorithmServerError(response.status_code, response.text)
|
|
33
34
|
|
|
34
35
|
@property
|
|
35
36
|
def server_url(self) -> str:
|
|
@@ -68,8 +69,10 @@ class Client:
|
|
|
68
69
|
return serverkit.deserialize_result_tuple(response.json())
|
|
69
70
|
elif response.status_code == 422:
|
|
70
71
|
raise InvalidAlgorithmParametersError(response.status_code, response.json())
|
|
72
|
+
elif response.status_code == 504:
|
|
73
|
+
raise AlgorithmTimeoutError(response.status_code, response.text)
|
|
71
74
|
else:
|
|
72
|
-
raise AlgorithmServerError(response.status_code, response.
|
|
75
|
+
raise AlgorithmServerError(response.status_code, response.text)
|
|
73
76
|
|
|
74
77
|
def get_algorithm_parameters(self, algorithm=None) -> Dict:
|
|
75
78
|
algorithm = self._validate_algorithm(algorithm)
|
|
@@ -84,7 +87,7 @@ class Client:
|
|
|
84
87
|
if response.status_code == 200:
|
|
85
88
|
return response.json()
|
|
86
89
|
else:
|
|
87
|
-
raise AlgorithmServerError(response.status_code, response.
|
|
90
|
+
raise AlgorithmServerError(response.status_code, response.text)
|
|
88
91
|
|
|
89
92
|
def get_sample_images(
|
|
90
93
|
self, algorithm=None, first_only: bool = False
|
|
@@ -13,17 +13,27 @@ class AlgorithmServerError(Exception):
|
|
|
13
13
|
def __init__(self, status_code, response_body, message="Algorithm server returned an unexpected status_code"):
|
|
14
14
|
self.status_code = status_code
|
|
15
15
|
self.response_body = response_body
|
|
16
|
-
self.message = f"{message}: {status_code}\nResponse
|
|
16
|
+
self.message = f"{message}: {status_code}\nResponse: {response_body}"
|
|
17
|
+
super().__init__(self.message)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class AlgorithmTimeoutError(Exception):
|
|
21
|
+
"""Exception raised when a request to an algorithm server exceeds the time limit."""
|
|
22
|
+
|
|
23
|
+
def __init__(self, status_code, response_text, message="Algorithm server returned an unexpected status_code"):
|
|
24
|
+
self.status_code = status_code
|
|
25
|
+
self.response_text = response_text
|
|
26
|
+
self.message = f"{message}: {status_code}\nResponse: {response_text}"
|
|
17
27
|
super().__init__(self.message)
|
|
18
28
|
|
|
19
29
|
|
|
20
30
|
class InvalidAlgorithmParametersError(Exception):
|
|
21
31
|
"""Exception raised when a request to an algorithm server is made with invalid algorithm parameters."""
|
|
22
32
|
|
|
23
|
-
def __init__(self, status_code,
|
|
33
|
+
def __init__(self, status_code, response_text, message="Algorithm parameters were invalidated by the server"):
|
|
24
34
|
self.status_code = status_code
|
|
25
|
-
self.
|
|
26
|
-
pydantic_details =
|
|
35
|
+
self.response_text = response_text
|
|
36
|
+
pydantic_details = response_text.get("detail")[0]
|
|
27
37
|
pydantic_validation_msg = pydantic_details.get("msg")
|
|
28
38
|
pydantic_failing_param = pydantic_details.get("loc")[1]
|
|
29
39
|
pydantic_failing_param_value = pydantic_details.get("input")
|
|
@@ -17,37 +17,34 @@ def mask2features(segmentation_mask: np.ndarray) -> List[Feature]:
|
|
|
17
17
|
features = []
|
|
18
18
|
indices = np.unique(segmentation_mask)
|
|
19
19
|
indices = np.delete(indices, indices == 0) # remove background
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
n_pixels = []
|
|
31
|
-
for _, item in enumerate(contours_find):
|
|
32
|
-
n_pixels.append(len(item))
|
|
33
|
-
index = np.argmax(n_pixels)
|
|
34
|
-
contour = contours_find[index]
|
|
20
|
+
|
|
21
|
+
if indices.size == 0:
|
|
22
|
+
return features
|
|
23
|
+
|
|
24
|
+
# TODO: This is really inefficient for big images! Will need to improve it.
|
|
25
|
+
for i in indices.tolist():
|
|
26
|
+
mask = np.array(segmentation_mask == i)
|
|
27
|
+
mask = np.pad(mask > 0, 1)
|
|
28
|
+
contours_find = find_contours(mask, 0.5)
|
|
29
|
+
for detection_id, contour in enumerate(contours_find):
|
|
35
30
|
contour -= 1 # reset padding
|
|
36
31
|
contour_as_numpy = contour[:, np.argsort([1, 0])] # Fix XY
|
|
37
32
|
geom = Polygon([contour_as_numpy.tolist()])
|
|
38
|
-
features.append(Feature(geometry=geom, properties={"Detection ID": i}))
|
|
33
|
+
features.append(Feature(geometry=geom, properties={"Detection ID": detection_id, "Class": i}))
|
|
34
|
+
|
|
39
35
|
return features
|
|
40
36
|
|
|
41
37
|
|
|
42
38
|
def features2mask(features, image_shape):
|
|
43
39
|
segmentation_mask = np.zeros(image_shape, dtype=np.uint16)
|
|
44
40
|
for idx, feature in enumerate(features):
|
|
45
|
-
label_idx = idx+1 # Labels start at 1
|
|
46
41
|
feature_coordinates = np.array(feature["geometry"]["coordinates"])
|
|
47
42
|
feature_coordinates = np.squeeze(feature_coordinates)
|
|
48
43
|
feature_coordinates = feature_coordinates[:, ::-1] # Invert XY
|
|
49
44
|
feature_mask = polygon2mask(image_shape, feature_coordinates)
|
|
50
|
-
|
|
45
|
+
feature_properites = feature.get("properties")
|
|
46
|
+
feature_class = feature_properites.get("Class")
|
|
47
|
+
segmentation_mask[feature_mask] = feature_class
|
|
51
48
|
return segmentation_mask
|
|
52
49
|
|
|
53
50
|
|
|
@@ -74,7 +74,7 @@ class Registry:
|
|
|
74
74
|
# response = requests.get(f"{self.services.get(algorithm)}/demo")
|
|
75
75
|
# return HTMLResponse(content=response.text, status_code=response.status_code)
|
|
76
76
|
|
|
77
|
-
@self.app.get("/{algorithm}")
|
|
77
|
+
@self.app.get("/{algorithm}/")
|
|
78
78
|
async def get_algorithm(request: Request, algorithm: str):
|
|
79
79
|
algo_url = self.services.get(algorithm)
|
|
80
80
|
response = requests.get(f"{algo_url}/")
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/serialization.py
RENAMED
|
@@ -69,6 +69,7 @@ def serialize_result_tuple(result_data_tuple: List[Tuple]) -> List[Dict]:
|
|
|
69
69
|
if data_type == "image":
|
|
70
70
|
features = serverkit.encode_contents(data.astype(np.float32))
|
|
71
71
|
elif data_type == "labels":
|
|
72
|
+
data = data.astype(np.uint16)
|
|
72
73
|
features = serverkit.mask2features(data)
|
|
73
74
|
data_params['image_shape'] = data.shape
|
|
74
75
|
elif data_type == "labels3d":
|
|
@@ -5,15 +5,15 @@ from typing import List, Tuple, Type
|
|
|
5
5
|
import imaging_server_kit as serverkit
|
|
6
6
|
import requests
|
|
7
7
|
import yaml
|
|
8
|
-
from fastapi import FastAPI, Request, status
|
|
8
|
+
from fastapi import FastAPI, Request, status, HTTPException
|
|
9
9
|
from fastapi.responses import HTMLResponse
|
|
10
10
|
from fastapi.staticfiles import StaticFiles
|
|
11
11
|
from fastapi.templating import Jinja2Templates
|
|
12
12
|
from imaging_server_kit.web_demo import generate_dash_app
|
|
13
13
|
from pydantic import BaseModel, ConfigDict
|
|
14
14
|
from a2wsgi import WSGIMiddleware
|
|
15
|
-
# from starlette.middleware.wsgi import WSGIMiddleware
|
|
16
15
|
from contextlib import asynccontextmanager
|
|
16
|
+
import asyncio
|
|
17
17
|
|
|
18
18
|
templates_dir = importlib.resources.files("imaging_server_kit").joinpath("templates")
|
|
19
19
|
static_dir = importlib.resources.files("imaging_server_kit").joinpath("static")
|
|
@@ -65,9 +65,6 @@ class Server:
|
|
|
65
65
|
|
|
66
66
|
self.app.mount(f"/{algorithm_name}/demo", WSGIMiddleware(dash_app.server))
|
|
67
67
|
|
|
68
|
-
# self.app.on_event("startup")(self.register_with_registry)
|
|
69
|
-
# self.app.on_event("shutdown")(self.deregister_from_registry)
|
|
70
|
-
|
|
71
68
|
self.register_routes()
|
|
72
69
|
|
|
73
70
|
self.services = [self.algorithm_name]
|
|
@@ -134,10 +131,18 @@ class Server:
|
|
|
134
131
|
|
|
135
132
|
@self.app.post(f"/{self.algorithm_name}/process", status_code=status.HTTP_201_CREATED)
|
|
136
133
|
async def run_algo(algo_params: self.parameters_model):
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
try:
|
|
135
|
+
result_data_tuple = await asyncio.wait_for(self._run_algorithm(**algo_params.dict()), timeout=60)
|
|
136
|
+
except asyncio.TimeoutError: # This works but doesn't actually kill the process... we need something else to terminate it
|
|
137
|
+
raise HTTPException(status_code=504, detail="Request timeout during processing.")
|
|
138
|
+
try:
|
|
139
|
+
serialized_results = await asyncio.wait_for(self._serialize_result_tuple(result_data_tuple), timeout=10)
|
|
140
|
+
except asyncio.TimeoutError:
|
|
141
|
+
raise HTTPException(status_code=504, detail="Request timeout during serialization.")
|
|
142
|
+
|
|
139
143
|
return serialized_results
|
|
140
144
|
|
|
145
|
+
|
|
141
146
|
@self.app.get(f"/{self.algorithm_name}/parameters", response_model=dict)
|
|
142
147
|
def get_algo_params():
|
|
143
148
|
return self.parameters_model.model_json_schema()
|
|
@@ -150,8 +155,16 @@ class Server:
|
|
|
150
155
|
]
|
|
151
156
|
return {"sample_images": encoded_images}
|
|
152
157
|
|
|
158
|
+
async def _serialize_result_tuple(self, result_data_tuple):
|
|
159
|
+
serialized_results = await asyncio.to_thread(serverkit.serialize_result_tuple, result_data_tuple)
|
|
160
|
+
return serialized_results
|
|
161
|
+
|
|
162
|
+
async def _run_algorithm(self, **algo_params):
|
|
163
|
+
result_data_tuple = await asyncio.to_thread(self.run_algorithm, **algo_params)
|
|
164
|
+
return result_data_tuple
|
|
165
|
+
|
|
153
166
|
def load_sample_images(self) -> List["np.ndarray"]:
|
|
154
167
|
raise NotImplementedError("Subclasses should implement this method")
|
|
155
|
-
|
|
168
|
+
|
|
156
169
|
def run_algorithm(self, **algo_params) -> List[Tuple]:
|
|
157
170
|
raise NotImplementedError("Subclasses should implement this method")
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/templates/info.html
RENAMED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<p>Server Kit Repository</p>
|
|
39
39
|
</div>
|
|
40
40
|
</a>
|
|
41
|
-
<a href="
|
|
41
|
+
<a href="demo">
|
|
42
42
|
<div class="card-category">
|
|
43
43
|
<i class="fa-solid fa-rocket"></i>
|
|
44
44
|
<p>Web demo</p>
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
</a>
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
|
-
<!-- <h3><strong>Parameters</strong></h3> -->
|
|
50
49
|
<table>
|
|
51
50
|
<thead>
|
|
52
51
|
<tr>
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: imaging-server-kit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Deploy image processing algorithms in FastAPI servers.
|
|
5
5
|
Author-email: Mallory Wittwer <mallory.wittwer@epfl.ch>
|
|
6
6
|
License: Copyright (c) 2024, EPFL
|
|
@@ -64,7 +64,12 @@ Requires-Dist: pytest
|
|
|
64
64
|

|
|
65
65
|
# 🪐 Imaging Server Kit
|
|
66
66
|
|
|
67
|
-
Deploy image processing algorithms in FastAPI servers and easily run them
|
|
67
|
+
Deploy image processing algorithms in FastAPI servers and easily run them from Napari, QuPath, and more.
|
|
68
|
+
|
|
69
|
+
The algorithm servers implement a common set of API endpoints for processing and to document the project. These include:
|
|
70
|
+
- `/process`: Runs the algorithm
|
|
71
|
+
- `/info`: Displays documentation about the algorithm usage
|
|
72
|
+
- `/sample_images`: Provides one or multiple sample images
|
|
68
73
|
|
|
69
74
|
## Usage
|
|
70
75
|
|
|
@@ -72,15 +77,15 @@ Deploy image processing algorithms in FastAPI servers and easily run them in Nap
|
|
|
72
77
|
|
|
73
78
|
Set up and run a server with one, or multiple algorithms from the Imaging Server Kit collection (or your own):
|
|
74
79
|
|
|
75
|
-
- [StarDist](https://github.com/Imaging-Server-Kit/serverkit-stardist)
|
|
76
|
-
- [CellPose](https://github.com/Imaging-Server-Kit/serverkit-cellpose)
|
|
77
|
-
- [Spotiflow](https://github.com/Imaging-Server-Kit/serverkit-spotiflow)
|
|
78
|
-
- [Rembg](https://github.com/Imaging-Server-Kit/serverkit-rembg)
|
|
79
|
-
- [
|
|
80
|
-
- [Orientationpy](https://github.com/Imaging-Server-Kit/serverkit-orientationpy)
|
|
80
|
+
- [StarDist](https://github.com/Imaging-Server-Kit/serverkit-stardist): Object detection with star-convex shapes
|
|
81
|
+
- [CellPose](https://github.com/Imaging-Server-Kit/serverkit-cellpose): A generalist algorithm for cellular segmentation
|
|
82
|
+
- [Spotiflow](https://github.com/Imaging-Server-Kit/serverkit-spotiflow): Accurate and efficient spot detection
|
|
83
|
+
- [Rembg](https://github.com/Imaging-Server-Kit/serverkit-rembg): A tool to remove images background
|
|
84
|
+
- [LoG detector](https://github.com/Imaging-Server-Kit/serverkit-skimage-LoG): Laplacian of Gaussian filter
|
|
85
|
+
- [Orientationpy](https://github.com/Imaging-Server-Kit/serverkit-orientationpy): Measurement of greyscale orientations
|
|
81
86
|
<!-- - [Tau Fibrils Detector](https://github.com/Imaging-Server-Kit/serverkit-tau-fibrils-yolo) -->
|
|
82
87
|
|
|
83
|
-
To
|
|
88
|
+
All of these algorithm servers can be installed locally or built and run with docker. To use docker and serve multiple algorithms, the recommended way is to edit a `docker-compose.yml` file and pull server images from `registry.rcp.epfl.ch` (EPFL users only):
|
|
84
89
|
|
|
85
90
|
```{docker-compose.yml}
|
|
86
91
|
services:
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
PYTHON_VERSIONS=("3.9" "3.10" "3.11")
|
|
4
|
-
|
|
5
|
-
for version in "${PYTHON_VERSIONS[@]}"; do
|
|
6
|
-
echo "Building image for Python $version..."
|
|
7
|
-
docker build --build-arg PYTHON_VERSION=$version -t imaging-server-kit:$version .
|
|
8
|
-
done
|
|
9
|
-
|
|
10
|
-
# echo "Building image for Python 3.9, GPU-compatible..."
|
|
11
|
-
# docker build -t imaging-server-kit:gpu --file Dockerfile-GPU .
|
|
12
|
-
|
|
13
|
-
echo "Building image for Python 3.9, serverkit registry..."
|
|
14
|
-
docker build -t imaging-server-kit:registry --file Dockerfile-registry .
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/assets/style.css
RENAMED
|
File without changes
|
|
File without changes
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/static/index.css
RENAMED
|
File without changes
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/static/info.css
RENAMED
|
File without changes
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit/templates/index.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/requires.txt
RENAMED
|
File without changes
|
{imaging_server_kit-0.0.3 → imaging_server_kit-0.0.4}/src/imaging_server_kit.egg-info/top_level.txt
RENAMED
|
File without changes
|