import numpy as np def hist_match ( source , template ): """ Adjust the pixel values of a grayscale image such that its histogram matches that of a target image Arguments: ----------- source: np.ndarray Image to transform; the histogram is computed over the flattened array template: np.ndarray Template image; can have different dimensions to source Returns: ----------- matched: np.ndarray The transformed output image """ oldshape = source . shape source = source . ravel () template = template . ravel () # get the set of unique pixel values and their corresponding indices and # counts s_values , bin_idx , s_counts = np . unique ( source , return_inverse = True , return_counts = True ) t_values , t_counts = np . unique ( template , return_counts = True ) ...
파이토치 인스털:
답글삭제pip install http://download.pytorch.org/whl/cu80/torch-0.1.12.post2-cp27-none-linux_x86_64.whl
pip install torchvision
운영체계 및 파이썬 버전별 설치:
https://github.com/pytorch/pytorch
파이토치 설치여부 확인:
답글삭제python에서 import torch 가 먹어줘야 ...
# 분류망 통과에 클래스 갯수 조정 !
답글삭제model_ft.fc = nn.Linear(num_ftrs, 3)