Metadata-Version: 2.1
Name: Distracted-Driver-Detection
Version: 0.0.2
Summary: Distracted Driver Detection Project
Home-page: https://github.com/MohamedSebaie/Distracted_Driver_Detection_Project
Author: Mohamed Sebaie
Author-email: mohamedsebaie1@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENCE


 

<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=1-8am1oC-NUfTfuXtWMS4HXKlEgpxv1-U'
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
```

4. Detect The Distraction Class for the Driver Using Pytorch Weights:

```python
# Run the Below Function by Input your Test image Path to get the outPut class and probability for the driver distraction class
class_,pro = DistractedDriverDetection_Utils.PredictClass(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 Test image Path to get the outPut class and probability for the driver distraction class
class_,pro = DistractedDriverDetection_Utils.tfliteModel_Prediction(imgPath)
# Plot Batch of Test Images from directory with Detection
DistractedDriverDetection_Utils.tfliteModel_Plot(test_img_dir,nImages=5)
```

