네이버 부스트캠프/LEVEL-1

[부스트캠프][P-stage][WK04 / Day1] Image Classification 1

1. 금일 목표

  • 문제 정의 및 컴피티션 내용 정리
  • 데이터 labeling 및 EDA

2. 진행사항

1) 문제 정의 및 컴피티션 내용 정리

코로나 시국에 공공장소에서 모든 사람들의 올바른 마스크 착용 상태를 검사하기 위해 카메라로 비춰진 사람 얼굴 이미지 만으로 이 사람이 마스크를 쓰고 있는지, 쓰지 않았는지, 정확히 쓴 것이 맞는지 자동으로 가려낼 수 있는 시스템을 개발하는 것을 목적으로 진행되는 컴피티션입니다.


위와 같이 마스크 착용여부, 성별, 나이를 기준으로 총 18개의 클래스가 있습니다.

  • Evaluation Metric

2) 데이터 labeling 및 EDA

# 폴더 내부 모든 이미지의 경로 가져오기
def find_path(self, df,image_dir):
    file_path = []
    for img_path in df.path:
        for img in os.listdir(os.path.join(image_dir, img_path)):
            if (img.split('.')[0] != '') and (img.split('.')[-1] != 'ipynb_checkpoints'):
                file_path.append(os.path.join(image_dir, img_path, img))
    return file_path

img_paths = find_path(self.df, os.path.join(img_paths, 'images'))

# class label 달아주기
def make_label(self,img_paths):
    gender = img_paths.split('/')[-2].split('_')[1]
    age = int(img_paths.split('/')[-2].split('_')[-1])

    if img_paths.split('/')[-1].split('.')[0] not in ['incorrect_mask','normal']:
        wear = 'mask'
    else:
        wear = img_paths.split('/')[-1].split('.')[0]

    gender_class = 0 if gender=='male' else 1
    age_class = int(age/30)
    if wear=='mask':
        wear_class = 0
    elif wear=='incorrect_mask':
        wear_class = 1
    else:
        wear_class = 2

    return 6*wear_class + 3*gender_class + age_class

3. 피어세션 정리

https://hackmd.io/LdnsTb1aSCumiB2pyPb1iw?view


4. 학습 회고

첫날이라 부담스럽지 않은 내용이었습니다. eda를 시도하고 있으며 추후 보충해서 수정할 예정입니다. 이미지 데이터의 eda는 처음이라 익숙하지 않지만 그림을 봐서 그런지 즐거웠습니다 ㅎㅎ
최대한 빨리 제출해 보는 것이 목표입니다.