-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from dianna-ai/Experiments
Added script to run Experiments
- Loading branch information
Showing
8 changed files
with
342 additions
and
151 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,26 @@ | ||
from typing import Any | ||
import numpy as np | ||
|
||
from scipy.stats import wasserstein_distance | ||
from numpy.typing import NDArray | ||
from skimage.segmentation import slic | ||
from typing import Optional | ||
|
||
|
||
class Slic_Wrapper(): | ||
def __init__(self, | ||
n_segments: int = 10, | ||
compactness: float = 10., | ||
sigma: float = 0.): | ||
self.n_segments= n_segments | ||
self.compactness = compactness | ||
self.sigma = sigma | ||
|
||
def __call__(self, image): | ||
return slic(image, | ||
n_segments=self.n_segments, | ||
compactness=self.compactness, | ||
sigma = self.sigma) | ||
|
||
def __repr__(self): | ||
return f'slic(n_segments={self.n_segments}, compactness={self.compactness}, sigma={self.sigma})' |
This file was deleted.
Oops, something went wrong.
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.