server
¤
Functions:
| Name | Description |
|---|---|
load_model |
Load a model into the server's model cache. This can be used to pre-load a model before running predictions to avoid the overhead of loading the model during the first prediction request. |
main |
|
predict |
Run prediction on a sample |
root |
|
test_model |
Run the bioimageio model test and return the validation summary. Returns None if testing failed. |
Attributes:
| Name | Type | Description |
|---|---|---|
app |
|
load_model
¤
load_model(model: str, sha256: str) -> dict[Literal['message'], str]
Load a model into the server's model cache. This can be used to pre-load a model before running predictions to avoid the overhead of loading the model during the first prediction request.
Source code in src/bioimageio/core/remote_backends/gradio/server.py
169 170 171 172 173 174 175 176 | |
main
¤
main(port: Optional[int] = None) -> str
Source code in src/bioimageio/core/remote_backends/gradio/server.py
241 242 243 244 245 | |
predict
¤
predict(model: str, sha256: str, input_sample: Iterable[SerializedSampleBlock], blocksize: Optional[Union[int, Literal['blockwise_as_serialized'], PerMember[PerAxis[int]]]] = None, skip_preprocessing: bool = False, skip_postprocessing: bool = False, skip_input_padding: bool = False, skip_output_cropping: bool = False, batch_size: Optional[int] = None) -> Iterable[SerializedSampleBlock]
Run prediction on a sample
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Iterable[SerializedSampleBlock]
|
Input sample as a sequence of serialized sample blocks. Use bioimageio.core.backends.gradio_backend.GradioModelAdapter.serialize_sample to create this from a Sample object. |
required |
|
str
|
A model source: URL, nickname or base64 encoded model package (if len(model) > 2083). |
required |
|
str
|
Sha256 hash of the model's bioimageio.yaml file at the model source or of the encoded model package. |
required |
|
Optional[Union[int, Literal['blockwise_as_serialized'], PerMember[PerAxis[int]]]]
|
|
None
|
|
bool
|
If True, skip preprocessing steps defined in the model. |
False
|
|
bool
|
If True, skip postprocessing steps defined in the model. |
False
|
|
bool
|
If True, skip input padding for non-blockwise prediction. Set this flag when predicting an (overlapping) sample block rather than a full sample. |
False
|
|
bool
|
If True, skip output cropping for non-blockwise prediction. Set this flag when predicting an (overlapping) sample block rather than a full sample. |
False
|
|
Optional[int]
|
Optional batch size only applicable to predicting input samples with batch dimension. |
None
|
Source code in src/bioimageio/core/remote_backends/gradio/server.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
root
¤
root()
Source code in src/bioimageio/core/remote_backends/gradio/server.py
234 235 236 237 238 | |
test_model
¤
test_model(model: str, sha256: str) -> str
Run the bioimageio model test and return the validation summary. Returns None if testing failed.
Source code in src/bioimageio/core/remote_backends/gradio/server.py
179 180 181 182 183 184 185 186 187 | |