Wider-Yolo Kütüphanesi ile Yüz Tespit Uygulamanı Yap
Project description
WIDER-YOLO : Yüz Tespit Uygulaması Yap
Wider-Yolo Kütüphanesinin Kullanımı
1. Wider Face Veri Setini İndir
Not: İndirilen veri setini ismini değiştirmeden wider_data klasörün içine atın.
2. Dosyaları Düzeni:
datasets/
wider_face_split/
- wider_face_train_bbx_gt.txt
- wider_face_val_bbx_gt.txt
WIDER_train/
- images
WIDER_train_annotations
WIDER_val
- images
WIDER_val_annotations
Not: WIDER_train_annotations ve WIDER_val_annotations klasörleri oluşturmanıza gerek yoktur.
3. Wider Veri Setini Voc Xml Formatına Çevir
python ./wider_to_xml.py -ap ./wider_data/wider_face_split/wider_face_train_bbx_gt.txt -tp ./wider_data/WIDER_train_annotations/ -ip ./wider_data/WIDER_train/images/
python ./wider_to_xml.py -ap ./wider_data/wider_face_split/wider_face_val_bbx_gt.txt -tp ./wider_data/WIDER_val_annotations/ -ip ./wider_data/WIDER_val/images/
4. Voc Xml Veri Setini Yolo Formatına Çevir
python ./xml_to_yolo --path ./wider_data/WIDER_train_annotations/
python ./xml_to_yolo --path ./wider_data/WIDER_val_annotations/
5. Yolo Modelini Eğit
!yolov5 train --data data.yaml --weights 'yolov5n.pt' --batch-size 16 --epochs 100 --imgs 512
6. Yolo Modelini Test Et
Tek resim test etmek için:
!yolov5 detect --weights wider-yolo.pth --source file.jpg
Tüm resim dosyasını test etmek için
!yolov5 detect --weights wider-yolo.pth --source path/*.jpg
Not: Yeterli Gpu kaynağına sahip olamadığım için wider seti için düşük parametre değerleri verdim. Parametre Değerleri:
batch-size: 256, epochs: 5, imgs 320
6. Yolov5 + Sahi Algoritmasını Test Et
from sahi.model import Yolov5DetectionModel
from sahi.utils.cv import read_image
from sahi.predict import get_prediction, get_sliced_prediction, predict
from IPython.display import Image
detection_model = Yolov5DetectionModel(
model_path="last.pt",
confidence_threshold=0.3,
device="cpu",
)
result = get_sliced_prediction(
"test_data/2.jpg",
detection_model,
slice_height = 256,
slice_width = 256,
overlap_height_ratio = 0.8,
overlap_width_ratio = 0.8
)
result.export_visuals(export_dir="demo_data/")
Image("demo_data/prediction_visual.png")
Sahi Algoritması ile ilgili Örnek Proje:
Referanslar:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wideryolo-0.0.8.tar.gz.
File metadata
- Download URL: wideryolo-0.0.8.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef97971dc74a3def78a1c09ed190f7ba0d4cc59d706b82e7558af3397000ec3d
|
|
| MD5 |
2de11e52d49dcde109a8de60448d5a4f
|
|
| BLAKE2b-256 |
cb390036e6648f9968a5a730b28928b48dfed8ea6142c6492d024499b453210b
|
File details
Details for the file wideryolo-0.0.8-py3-none-any.whl.
File metadata
- Download URL: wideryolo-0.0.8-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4c2d4b49040c1b343df3c227bc242e4ddf77cc639b24f9c01226eb7b300cde6
|
|
| MD5 |
2e6b012946e63109b9fafc4a90f3bf46
|
|
| BLAKE2b-256 |
27dd82e4fe48bf96d4af3f624bd265bea4045ed7d461b2fb806a9424901a4ed1
|