목록Main (34)
UOMOP
import matplotlib.pyplot as plt import torchvision.transforms as transforms import torch.nn.functional as F import math import torch import torchvision import torch.nn as nn import torch.optim as optim import torch.nn.functional as f from torch.utils.data import DataLoader, Dataset import time from params import * import os from tqdm import tqdm import numpy as np import cv2 device = torch.devic..
import numpy as np import cv2 import torch import torch.nn.functional as F import torchvision.transforms as transforms import torchvision.datasets as datasets from torch.utils.data import DataLoader import matplotlib.pyplot as plt 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 ..
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 =..