본문 바로가기

computer vision/dna_study16

python albumentation 라이브러리 설명 albumentation은 이미지를 손쉽게 augmentation 해주는 python 라이브러리이다. 다양한 영상변환 알고리즘을 제공하고 있고, 처리속도도 매우 빨라 딥러닝 전처리 용으로 유용하게 사용할 수 있다. A.Resize(224,224) 이미지를 resize 해줌 A.Transpose(p=0.5) 이미지는 transpose 해줌 A.HorizontalFlip(p=0.5) 이미지 좌우뒤집기 A.VerticalFlip(p=0.5) 이미지 수직뒤집기 A.ShiftScaleRotate(p=0.5) 이미지의 크기나 회전을 랜덤으로 변경시켜줌 A.HueSaturationValue(p=0.5) RGB값을 임의로 변경 A.RandomBrightnessContrast(brightness_limit=(-0.1,0.. 2023. 3. 17.
pytorch 데이터셋 augmentation(transformer 적용) 이전의 데이터셋 포스팅을 보시면 더 이해가 잘될거같습니다. https://dohun-0714.tistory.com/27 pytorch 데이터셋 클래스 https://github.com/dohun-mat/dna_study_semina/blob/main/%EA%B3%BC%EC%A0%9C/week4_%EA%B3%BC%EC%A0%9C_2.ipynb GitHub - dohun-mat/dna_study_semina Contribute to dohun-mat/dna_study_semina development by creating an account on GitHub. github.com 코드는 깃 dohun-0714.tistory.com 자세한코드는 깃허브를 참고하면됩니다. https://github.com/doh.. 2023. 3. 17.
pytorch 데이터셋 클래스 https://github.com/dohun-mat/dna_study_semina/blob/main/%EA%B3%BC%EC%A0%9C/week4_%EA%B3%BC%EC%A0%9C_2.ipynb GitHub - dohun-mat/dna_study_semina Contribute to dohun-mat/dna_study_semina development by creating an account on GitHub. github.com 코드는 깃허브에 자세하게있다. 파이토치 데이터셋 클래스는 init, getitem, len의 특수 메소드3개를 요구하고 이 메소드는 전부 오버라이딩되어있다. root_path, mode(train or validation or test), transform(전처리&Augmenta.. 2023. 3. 17.
python 이미지생성 image = PILImage.open(dolphin_img_list[j]) # 방법 3 -> 경로를 인자로 받아서 바로 읽음 ax.imshow(image) 이 두줄의코드가 이미지를 읽고 시각화하는 코드 ax.text(image.size[0]/2,image.size[1]*1.2,image.size,size=10,verticalalignment='bottom' , horizontalalignment='center' ) 이미지밑에 이미지사이즈를 적어주는 코드 반복문을 2번사용해서 각 클래스별로 3개의 이미지가 생성되도록 하였다. 2023. 3. 16.