Training custom dataset
사용자가 직접 Custom Dataset으로 훈련하는 방법에 대해 제시
다음 링크에서 데이터셋을 다운로드 받을 수있다 - https://github.com/prajnasb/observations
├── dataset
│ ├── with_mask [690 entries]
│ └── without_mask [686 entries]
├── examples
│ ├── example_01.png
│ ├── example_02.png
│ └── example_03.png
├── face_detector
│ ├── deploy.prototxt
│ └── res10_300x300_ssd_iter_140000.caffemodel
├── detect_mask_image.py
├── detect_mask_video.py
├── mask_detector.model
├── plot.png
└── train_mask_detector.py
현재 마스크를 착용한 690개의 이미지와 미착용한 686개의 이미지를 사용했다.

필요하다면, 사용자가 직접 custom dataset을 넣을 수 있다. 만약 모델이 기대만큼 못미친다면 사용자가 직접 훈련시킴으로써 인식률을 높일 수 있다.
그러기 위해선 마스크를 착용한 사진과 미착용한 사진이 필요하다.

더 많은 이미지는, 높은 정확도의 모델을 만들 수 있다. "without_mask"와 "with_mask"폴더를 만들었다면 이미지를 해당 폴더에 복사한 뒤 다음 명령어를 입력한다.
cd src/training custom dataset
pip install sklearn imutils
python train_mask_detector.py --dataset dataset
그렇다면 "plot.png"를 face_detector_folder에서 확인 할 수 있고, 모델이 업그레이드 된 것을 확인할 수 있다.


Last updated
Was this helpful?