기술

    nn.AdaptiveAvgPool1d

    https://pytorch.org/docs/stable/generated/torch.nn.AdaptiveAvgPool1d.html AdaptiveAvgPool1d — PyTorch 1.10 documentation Shortcuts pytorch.org 이미지 사이즈를 torch.nn.AdaptiveAvgPool1d(output_size) 의 output_size로 맞춘다. 물론 여기선 1d인거고, 2d, 3d도 마찬가지일거임.

    self-supervised learning

    http://dmqm.korea.ac.kr/activity/seminar/302 고려대학교 DMQA 연구실 고려대학교 산업경영공학부 데이터마이닝 및 품질애널리틱스 연구실 dmqa.korea.ac.kr

    Multi-task learning

    https://www.youtube.com/watch?v=klFFAndQia8&ab_channel=naverd2

    DistributedDataParallel 관련 링크 정리

    https://pytorch.org/docs/stable/notes/cuda.html?highlight=torch%20distributed%20init_process_group CUDA semantics — PyTorch 1.10.1 documentation CUDA semantics torch.cuda is used to set up and run CUDA operations. It keeps track of the currently selected GPU, and all CUDA tensors you allocate will by default be created on that device. The selected device can be changed with a torch.cuda.device c..

    conv1d, conv2d, conv3d

    https://pytorch.org/docs/stable/generated/torch.nn.Conv1d.html#torch.nn.Conv1d Conv1d — PyTorch 1.10.0 documentation Shortcuts pytorch.org https://pytorch.org/docs/stable/generated/torch.nn.Conv2d.html#torch.nn.Conv2d Conv2d — PyTorch 1.10.0 documentation Shortcuts pytorch.org https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html Conv3d — PyTorch 1.10.0 documentation Shortcuts pytorch.o..

    youtube data api 사용했던 방법

    ============= 과제용 보고서에 작성했던거 ================ 이 밑으로는 주어지지 않았던 구독자 수 데이터가 나온다. youtube data api를 사용하였다. 어떻게 되는지 설명하면 우선 api key를 발급받고 url 에서 "https://www.youtube.com/watch?v=t-9WoZnDo10" v= 뒤에있는 걸 복사하고 밑의 api 설명처럼 형식에 맞춰 get을 요청한다. Videos: list | YouTube Data API | Google Developers Videos: list | YouTube Data API | Google Developers Videos: list API 요청 매개변수와 일치하는 동영상의 목록을 반환합니다. 지금 사용해 보거나 예를 참조..

    랜덤 샘플 이미지

    @torch.no_grad() def inference(weight, name, img): if img is None: img = np.random.randint(0, 255, size=(112, 112, 3), dtype=np.uint8) else: img = cv2.imread(img) img = cv2.resize(img, (112, 112)) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) img = np.transpose(img, (2, 0, 1)) img = torch.from_numpy(img).unsqueeze(0).float() img.div_(255).sub_(0.5).div_(0.5) net = get_model(name, fp16=False) net.lo..

    torchvision.models 의 IntermediateLayerGetter

    레이어 결과를 중간에 낚아채게 해주는거임 https://github.com/biubug6/Pytorch_Retinaface/blob/master/models/retinaface.py GitHub - biubug6/Pytorch_Retinaface: Retinaface get 80.99% in widerface hard val using mobilenet0.25. Retinaface get 80.99% in widerface hard val using mobilenet0.25. - GitHub - biubug6/Pytorch_Retinaface: Retinaface get 80.99% in widerface hard val using mobilenet0.25. github.com 위에거 보다 알아냈다. 만..

    image normalize, inverse normalize

    normalize는 torchvision의 transforms를 쓰든, albumentations를 사용하든 하면 되고, 중요한건 안에 Normalize로 주는 means, std 매개변수들만 바꿔주면 됨. import albumentations as A from albumentations.pytorch import ToTensorV2 from torchvision import transforms self.transform = A.Compose([ A.Normalize(mean=(0.548, 0.504, 0.479), std=(0.237, 0.247, 0.246)), ToTensorV2(), ]) invTrans = transforms.Compose([transforms.Normalize(mean=[0...

    tensor image to numpy image, numpy image to tensor image

    여기서 말하는 tensor는 pytorch tensor임. 변환방법 1. 바닐라 방법(제일 좋은듯) def image_tensor_to_numpy(tensor_image): # If this is already a numpy image, just return it if type(tensor_image) == np.ndarray: return tensor_image # Make sure this is a tensor and not a variable if type(tensor_image) == Variable: tensor_image = tensor_image.data # Convert to numpy and move to CPU if necessary np_img = tensor_image.detach(..