-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'spec_v0_5' into spec_v0_5__fixing_pytorch_conversion
- Loading branch information
Showing
16 changed files
with
697 additions
and
988 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from typing import Any, Dict, Generic, List, Literal, NamedTuple, TypeVar, Union | ||
|
||
import numpy as np | ||
import xarray as xr | ||
from attr import dataclass | ||
from typing_extensions import Final | ||
|
||
from bioimageio.core.stat_measures import Measure | ||
from bioimageio.spec.model import v0_4, v0_5 | ||
from bioimageio.spec.model.v0_5 import TensorId | ||
|
||
TensorId = v0_5.TensorId | ||
AxisId = v0_5.AxisId | ||
|
||
Sample = Dict[TensorId, xr.DataArray] | ||
|
||
ProcessingDescrBase = Union[v0_4.ProcessingDescrBase, v0_5.ProcessingDescrBase] | ||
ProcessingKwargs = Union[v0_4.ProcessingKwargs, v0_5.ProcessingKwargs] | ||
|
||
PER_SAMPLE = "per_sample" | ||
PER_DATASET = "per_dataset" | ||
|
||
|
||
MeasureVar = TypeVar("MeasureVar", bound=Measure) | ||
ModeVar = TypeVar("ModeVar", Literal["per_sample"], Literal["per_dataset"]) | ||
|
||
|
||
@dataclass(frozen=True) | ||
class RequiredMeasure(Generic[MeasureVar, ModeVar]): | ||
measure: MeasureVar | ||
tensor_id: TensorId | ||
mode: ModeVar | ||
|
||
|
||
@dataclass(frozen=True) | ||
class SampleMeasure(RequiredMeasure[MeasureVar, Literal["per_sample"]]): | ||
pass | ||
|
||
|
||
@dataclass(frozen=True) | ||
class DatasetMeasure(RequiredMeasure[MeasureVar, Literal["per_dataset"]]): | ||
pass | ||
|
||
|
||
MeasureValue = xr.DataArray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
105 changes: 0 additions & 105 deletions
105
bioimageio/core/prediction_pipeline/_combined_processing.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.