-
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.
image distribution 계산 함수 추가 (issue #2)
- Loading branch information
1 parent
2ada0f1
commit f395d35
Showing
3 changed files
with
65 additions
and
1 deletion.
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,27 @@ | ||
import numpy as np | ||
from cosas.transforms import get_image_stats | ||
|
||
|
||
def test_get_image_stats(): | ||
|
||
images = np.random.randint(0, 256, size=(10, 224, 224, 3), dtype=np.uint8) | ||
|
||
# get image stats | ||
means, stds = get_image_stats(images) | ||
|
||
assert means.shape == (3,) | ||
assert stds.shape == (3,) | ||
|
||
|
||
def test_get_image_stats_list(): | ||
|
||
images = [ | ||
np.random.randint(0, 256, size=(224, 224, 3), dtype=np.uint8) | ||
for i in range(0, 10) | ||
] | ||
|
||
# get image stats | ||
means, stds = get_image_stats(images) | ||
|
||
assert means.shape == (3,) | ||
assert stds.shape == (3,) |
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 |
---|---|---|
|
@@ -11,4 +11,7 @@ torchvision | |
torchaudio | ||
|
||
segmentation-models-pytorch | ||
albumentations | ||
albumentations | ||
|
||
# for CI | ||
pytest==8.2.2 |