기술
CORS 두 장 설명
https://www.udemy.com/course/best-aws-certified-solutions-architect-associate/?couponCode=ST10MT30325G1 웹 클라이언트 제작할 떄, 왼쪽이 localhost:3000, 오른쪽이 https://dev.~~ 등의 api 서버라고 생각하기. 더보기CORS에 관해 궁금한 게 있어. 내가 아는 상황을 설명해줄게. A.com 사이트가 있고 B.com 사이트가 있어. 클라이언트가 A.com에 요청을 하는 상황이야. 이 떄 1. A.com에서 클라이언트에 a.html을 준다. 2. a.html을 분석하는 중, 이 파일 안에 B.com의 파일이 있어 Get 요청을 해야 한다. 3. 이때, 클라이언트가 B.com으로 요청을 날리는지, 아니면..
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
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...