-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
555 additions
and
97 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
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,22 @@ | ||
from abc import abstractmethod | ||
|
||
import numpy as np | ||
|
||
from histolab.tile import Tile | ||
|
||
try: | ||
from typing import Protocol, runtime_checkable | ||
except ImportError: | ||
from typing_extensions import Protocol, runtime_checkable | ||
|
||
|
||
@runtime_checkable | ||
class Scorer(Protocol): | ||
@abstractmethod | ||
def __call__(self, tile: Tile) -> float: | ||
raise NotImplementedError | ||
|
||
|
||
class RandomScorer(Scorer): | ||
def __call__(self, tile: Tile) -> float: | ||
return np.random.random() |
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
Oops, something went wrong.