Skip to main content
Remote tissue segmentation mask model. Wraps a tissue segmentation EndpointModel as a TissueMaskModel, forwarding each ModelRequest to the remote tissue segmentation endpoint.

BioptimusTissueMaskModel

class BioptimusTissueMaskModel(TissueMaskModel)
Tissue mask model backed by a segmentation endpoint. Forwards each ModelRequest to the EndpointModel and returns the ModelResponse.
backbone
An EndpointModel configured for tissue segmentation.
Example:
from bioptimus.models.backbones import Backbone

backbone = Backbone("tissue-seg", base_url="http://localhost:8080")
model = BioptimusTissueMaskModel(backbone)
response = model.process(request)

tile_spec

@property
def tile_spec() -> TileSpec | None
Returns the tile spec from the backbone’s model spec.

process

def process(request: ModelRequest) -> ModelResponse
Sends a request to the remote tissue segmentation endpoint.
request
ModelRequest
required
A ModelRequest containing the tile image and metadata.
returns
ModelResponse
A ModelResponse with the segmentation output.

process_async

async def process_async(request: ModelRequest,
                        session: Any = None) -> ModelResponse
Sends a request asynchronously to the segmentation endpoint.
request
ModelRequest
required
A ModelRequest containing the tile image and metadata.
session
Any
An ClientSession for connection pooling.
returns
ModelResponse
A ModelResponse with the segmentation output.