본문 바로가기

Experience43

KT AIVLE School 8주차 정리 - 미니프로젝트 3차 후기 1 - 3 일 주제: CNN 으로 이미지 이진 분류 문제를 풀기 1일차 - 이미지 데이터 정리 및 전처리 2일차 - CNN 모델 설계, 학습, 평가 3일차 - 전이학습 및 파인튜닝 1일차 - 이미지 데이터 정리 및 전처리 shutil import shutil shutil.copyfile("./test1/test1.txt", "./test2.txt") shutil.copy("./test1/test1.txt", "./test3.txt") shutil.copy2("./test1/test1.txt", "./test4.txt") splitfolders import splitfolders splitfolders.ratio(input='넣을 데이터 경로', output='내보낼 경로', seed=2023, ratio.. 2023. 3. 20.
KT AIVLE School 7주차 정리 - Object Detection 23.03.17 이렇게 정리를 하지만.. 논문이나 책을 참고한 것이 아니므로 가볍게 읽어주세요! Object Detection Bounding box, Classification, Confidence Score + CNN bounding box regression + multi class classification 이 합쳐진 문제로 이해 localization + classification 이 합쳐진 문제로 이해 CNN 의 역할 뼈대로서의 기능 (Backbone) + + 우리 문제에 맞춰서 추가 구성 (Head) Bounding box 하나의 object가 포함되어 있는 최소크기의 박스 좌표 x, y, 크기 w, h에 대한 예측값을 만들어 내고 여기에 다가가기를 .. 2023. 3. 15.
KT AIVLE School 7주차 정리 - 전이 학습과 파인 튜닝 전이 학습과 파인 튜닝을 하는 방법은 정말 쉬웠습니다. 배우면서도 엄청 간단해서 이래도 되나 싶을 정도였습니다. 하지만 저의 수준과 경험으로는 파인 튜닝을 통해 성능을 올리는 것은 어렵다는 것을 알게 되었고, 인터넷을 봐도 이러한 정보는 다 꽁꽁 숨겨놓거나 데이터마다 다르기 때문에 여러방면에 경험을 많이 해야겠습니다! 전이 학습하는 코드 틀 https://keras.io/guides/sequential_model/ # Load a convolutional base with pre-trained weights base_model = keras.applications.Xception( weights='imagenet', include_top=False, pooling='avg') # Freeze the ba.. 2023. 3. 15.
KT AIVLE School 7주차 정리 - Colab에서 이미지 파일 정리 colab에서 dataset이 zip으로 된 파일을 받아서 이미지 파일들을 알맞은 폴더에 맞게 정리하는 작업을 정돈해놔야했다. 여러 모듈에 대한 이해도가 부족해서 이렇게라도 해놓아야 다시 쓸 수 있는 것 같았습니다 ㅠㅠ 후에 os, shutil, Path, yaml, glob, random, json 에 대해서 정리를 해야겠다는 생각을 했습니다. 구글드라이브 연동 from google.colab import drive drive.mount('/content/drive') split-folers 모듈을 사용해서 train, valid, test 폴더 생성, 그 안에 클래스별로 폴더가 분리 drive_path = '/content/drive/MyDrive/Datasets/' zipfile_name = 'zi.. 2023. 3. 15.
KT AIVLE School 7주차 정리 - 상황별 Data Augmentation 미니프로젝트 때 꼭 사용되는 ImageDataGenerator에 대해서 정확하게 알지 못하다보니, 팀원간에 이미지 데이터를 전처리하는 방식에 따라서 Data Augmentation하는 방식이 달라 헤맸던 기억이 있어서 후에 상황별로 정리를 합니다! x_train, y_train 데이터가 이미 있을 때 합치는 방법 train_datagen = ImageDataGenerator(rotation_range=20, width_shift_range=0.1, height_shift_range=0.1, zoom_range=0.1, shear_range=0.1, horizontal_flip=True, vertical_flip=True) # 데이터 증강한 훈련용 이미지 데이터 셋 생성 train_datagen.fit(x.. 2023. 3. 15.
KT AIVLE School 7주차 정리 - CNN 모델 만들고 사용하기 이미지 전처리는 제일 밑에 링크를 걸어 둔 곳으로 가서 보시면 됩니다! 이미지 경로를 train, valid, test 폴더로 정리한 후 데이터 로드 def make_x_dataset(train_path, valid_path, test_path): for indx, path in enumerate([train_path, valid_path, test_path]): Images = [] for img_path in os.listdir(path): img = load_img(path + img_path, target_size=(IMG_SIZE, IMG_SIZE)) img = img_to_array(img) Images.append(img) if indx == 0: x_train = np.array(Image.. 2023. 3. 15.