22 lines
579 B
Python
22 lines
579 B
Python
|
|
import os
|
||
|
|
|
||
|
|
from PIL import Image, ImageFilter, ImageMath
|
||
|
|
|
||
|
|
import numpy as np
|
||
|
|
from sklearn.feature_extraction import image
|
||
|
|
|
||
|
|
STUDY_PATH = "/media/cifs/shares/SRS/storage/tmp/MRI With_Without Contrast--Brain_53820330"
|
||
|
|
|
||
|
|
MODEL_PATH = '/home/xfr/nni/model-5-64/TwNuKtj7/best_zdoyO.pth'
|
||
|
|
|
||
|
|
|
||
|
|
for jpg_file in sorted(os.listdir(STUDY_PATH)):
|
||
|
|
jpg_path = os.path.join(STUDY_PATH, jpg_file)
|
||
|
|
print(jpg_path)
|
||
|
|
img = Image.open(jpg_path).convert('L')
|
||
|
|
print(img)
|
||
|
|
one_image = np.array(img)
|
||
|
|
print(one_image)
|
||
|
|
patches = image.extract_patches_2d(one_image, (2, 2))
|
||
|
|
exit()
|