목록분류 전체보기 (295)
UOMOP
import cv2 import numpy as np import torch import torch.nn.functional as F def patch_std(image, patch_size=2): # Calculate the standard deviation within each patch H, W = image.shape std_map = np.zeros((H // patch_size, W // patch_size)) for i in range(0, H, patch_size): for j in range(0, W, patch_size): patch = image[i:i+patch_size, j:j+patch_size] std_map[i // patch_size, j // patch_size] = np..
import cv2 import numpy as np import torch import torch.nn.functional as F def patch_std(image, patch_size=2): # Calculate the standard deviation within each patch H, W = image.shape std_map = np.zeros((H // patch_size, W // patch_size)) for i in range(0, H, patch_size): for j in range(0, W, patch_size): patch = image[i:i+patch_size, j:j+patch_size] std_map[i // patch_size, j // patch_size] = np..
import matplotlib.pyplot as plt import torchvision.transforms as transforms import torchvision.datasets as datasets import torch def select_patches_to_mask(images, patch_size, mask_ratio): B, C, H, W = images.shape n_patches_horizontal = H // patch_size n_patches_vertical = W // patch_size total_patches = n_patches_horizontal * n_patches_vertical n_patches_to_mask = int(total_patches * mask_rati..
import matplotlib.pyplot as plt # 데이터 정의 X = [0, 15, 30] # 각 선택 메커니즘별 데이터, MR = 100% 제외 Y_low = [ [15.752, 18.992, 19.364], # MR = 0% [15.761, 18.909, 19.272], # MR = 25% [15.718, 18.706, 19.015], # MR = 50% [15.572, 18.021, 18.232] # MR = 75% ] Y_high = [ [15.773, 18.986, 19.371], # MR = 0% [15.763, 18.903, 19.264], # MR = 25% [15.685, 18.683, 19.012], # MR = 50% [15.532, 17.897, 18.102] # MR =..
import matplotlib.pyplot as plt X = [0, 15, 30] Y_0 = [15.795, 18.989, 19.363] Y_25 = [15.723, 18.881, 19.243] Y_50 = [15.713, 18.634, 18.945] Y_75 = [15.448, 17.907, 18.111] Y_1 = [12.096, 12.095, 12.096] plt.plot(X, Y_0, 'o-', color='blue', label='MR = 0%') plt.plot(X, Y_25, 's--', color='red', label='MR = 25%') plt.plot(X, Y_50, '^-', color='green', label='MR = 50%') plt.plot(X, Y_75, 'x:', c..
import matplotlib.pyplot as plt X = [0, 15, 30] Y_0 = [15.773, 18.986, 19.371] Y_25 = [15.763, 18.903, 19.264] Y_50 = [15.685, 18.683, 19.012] Y_75 = [15.532, 17.897, 18.102] Y_1 = [12.095, 12.096, 12.096] plt.plot(X, Y_0, 'o-', color='blue', label='MR = 0%') plt.plot(X, Y_25, 's--', color='red', label='MR = 25%') plt.plot(X, Y_50, '^-', color='green', label='MR = 50%') plt.plot(X, Y_75, 'x:', c..