Distracted-Driver-Detection-0.0.3
توضیحات
Distracted Driver Detection Project
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | Distracted-Driver-Detection-0.0.3 |
| نام | Distracted-Driver-Detection |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Mohamed Sebaie |
| ایمیل نویسنده | mohamedsebaie1@gmail.com |
| آدرس صفحه اصلی | https://github.com/MohamedSebaie/Distracted_Driver_Detection_Project |
| آدرس اینترنتی | https://pypi.org/project/Distracted-Driver-Detection/ |
| مجوز | - |
<h1 color="green"><b>Distracted Driver Detection Package</b></h1>
---
<h1 color="green"><b>Abstract</b></h1>
<p>This project focuses on driver distraction activities detection via images, which is useful for vehicle accident precaution. We aim to build a high-accuracy classifiers to distinguish whether drivers is driving safely or experiencing a type of distraction activity.</p>
<h1 color="green"><b>Instructions to Install our Distracted Driver Detection Package</b></h1>
1. Install:
```python
pip install Distracted-Driver-Detection
```
2. Download the Finetunned Model Weights
```python
import gdown
PytorchURL = 'https://drive.google.com/uc?id=1P9r7pCc-5eTmW4krT4GZ1F6w_miTtxJA'
TfLiteURL = 'https://drive.google.com/uc?id=1WbZD6PMETHIH6oMj0bzyG3BoDUlyO2Ll'
PytorchModel = 'model_ft.pth'
TfLiteModel = 'model.tflite'
gdown.download(PytorchURL, PytorchModel, quiet=False)
gdown.download(TfLiteURL, TfLiteModel, quiet=False)
```
3. Import the DistractedDriverDetection_Utils from distracted_driver_detection :
```python
from distracted_driver_detection import DistractedDriverDetection_Utils
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
```
4. Detect The Distraction Class for the Driver Using Pytorch Weights:
```python
# Run the Below Function by Input your image Path to get the outPut class and probability for the driver distraction class then show it
class_,pro = DistractedDriverDetection_Utils.PredictClass(imgPath)
print(class_,pro)
plt.imshow(mpimg.imread(imgPath));
# Plot Batch of Test Images from directory with Detection
DistractedDriverDetection_Utils.predMulti_images(test_img_dir,nImages=5)
```
5. Detect The Distraction Class for the Driver Using Tesorflow Lite Model:
```python
# Run the Below Function by Input your image Path to get the outPut class and probability for the driver distraction class then show it
class_,pro = DistractedDriverDetection_Utils.tfliteModel_Prediction(imgPath)
print(class_,pro)
plt.imshow(mpimg.imread(imgPath));
# Plot Batch of Test Images from directory with Detection
DistractedDriverDetection_Utils.tfliteModel_Plot(test_img_dir,nImages=5)
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl Distracted-Driver-Detection-0.0.3:
pip install Distracted-Driver-Detection-0.0.3.whl
نصب پکیج tar.gz Distracted-Driver-Detection-0.0.3:
pip install Distracted-Driver-Detection-0.0.3.tar.gz