- Professor: ThS. Cáp Phạm Đình Thăng ([email protected])
- Course Id: CS406.P11 (Xử lý ảnh và ứng dụng)
Name | MSSV | Roles |
---|---|---|
Nguyễn Hữu Nam | 22520917 | Leader |
Nguyễn Trần Phúc | 22521135 | Member |
Hồ Trọng Duy Quang | 22521200 | Member |
Overview: this project focus on detecting PPE (Hardhat, Helmet, Gloves) and classify each person if they are missing one of these
- Image: detect + classify violation
- Video: detect + track + classify violation (video result: drive)
CS406-PPE-detection/
├── data/
│ ├── data-ppe.yaml
│ └── split/ #contain train, val, test
├── logs/
├── notebooks/
├── output/
├── sample/
├── scripts/
│ ├── detect_faster_rcnn.py
│ ├── detect_yolo.py
│ ├── loader_faster_rcnn.py
│ └── tracker_yolo.py
├── src/
│ ├── loader/
│ ├── models/
│ ├── parsers/
│ ├── trackers/
│ └── utils/
├── tools/
├── web/
│ ├── app.py
│ └── output/ #output of web
├── weights/
│ ├── best_faster_rcnn.pt
│ └── best_yolo.pt
├── README.md
├── requirements.txt
└── setup.py
git clone https://github.com/Beeditor04/CS406-PPE-detection.git
cd CS406-PPE-detection
pip install -r requirements.txt
python setup.py develop
you can download our pretrain faster-rcnn
and yolov5n
model here:
And then put it in folder weights
.
streamlit run web/app.py
- remember to create
.yaml
file, put it in the folderdata/
or wherever you want
python scripts/train_faster_rcnn.py --data_dir "data/split" --batch_size 8 --epochs 10 --eval_every 5 --iter_every 5 --num_classes 7 --yaml "data/data-ppe.yaml" --lr 0.005 --resize 640 --is_aug 0
- (it've done in jupyter notebook, in
notebooks/train_yolo
)
python scripts/detect_faster_rcnn.py --weights weights/best_faster_rcnn.pt --img_path sample/images/1.jpg
python scripts/detect_yolo.py --weights weights/best_yolo.pt --img_path sample/images/1.jpg
python scripts/tracker_yolo.py --weights weights/best_yolo.pt --vid_dir sample/videos/1.mp4
python scripts/tracker_faster_rcnn.py --weights weights/best_faster_rcnn.pt --vid_dir sample/videos/1.mp4
- split dataset
python scripts/split_dataset.py --data_dir data/ --output_dir data/split/ --train_size 0.7 --test_size 0.1
- split dataset 10% for exps
python scripts/split_dataset_01.py --data_dir data/ --output_dir data/split_01/ --train_size 0.7 --test_size 0.1
- count dataset
python scripts/count.py --main data/split
- valid dataset
python scripts/is_valid_dataset.py