반응형
https://colab.research.google.com/drive/1zodLzCvhWQNVDOApQcbaWB87o9RIzP1a
The Hijab Object-Detection with YOLOv5
The hijab object detection is an object detection task that detects whether people are wearing hijabs or masks in videos. This repository includes a demo for building a face hijab or mask detector using YOLOv5 model.
Dataset
The model was trained on dataset which contains 377 hijab or mask images belonging to 4 classes. The classes are defined as follows:
- burqz
- chador
- mask
- niqab
→ This model will be further trained on a dataset that contains about 2,000 hijab or mask images belonging to 4 classes.
Setup
- Clone this repository and install YOLOv5
git clone ~ # 추가 예정
# install YOLO v5
git clone <https://github.com/ultralytics/yolov5.git>
cd yolov5
pip install -r requirements.txt
Training
- --data : yaml file path (yaml file with data set information)
- --weights : Pre-Trained model file path (pt format file), if no value is entered (‘’), initialize and train with a random weight value
- --epochs : epoch size
- --batch : batch size
- --cfg : The model size determined above (saved as a yaml file in the yolov5/models folder)
- s is the lightest model x is the heaviest model Of course, s has the lowest performance but the highest FPS, and x has the highest performance but the lowest FPS.
python train.py --img 640 --batch 16 --epochs 50 --data ./dataset/hijab.yaml --cfg ./models/yolov5s.yaml --weights yolov5s.pt --name hijab_yolov5s_results
Inference
- If training the model was finished, use the following command for inference.
val_img_path = '../dataset/hijab/images/test/chador/84.jpeg'
!python detect.py --weights ../yolov5/runs/train/hijab_yolov5s_results/weights/best.pt --source "{val_img_path}"
Result
'AI & BigData' 카테고리의 다른 글
[AI] 사이킷런을 활용해 훈련 세트와 테스트 세트로 나누기 (0) | 2023.06.22 |
---|---|
[AI] 로지스틱 손실 함수 - 크로스 엔트로피, 연쇄 법칙(Cross Entropy & Chain Rule) (3) | 2023.06.18 |
[AI] 당뇨병 환자의 1년 후 병의 진전된 정도를 예측하는 모델 만들기 - 1 (0) | 2023.05.26 |
[AI] 선형회귀분석(Linear regression) (0) | 2023.05.23 |
[Doing Data Science] 시작 (0) | 2023.05.17 |