Skip to content

Commit 9599e59

Browse files
Merge branch 'main' into docs/add-model-download-instructions
2 parents 9135377 + 7dff9c3 commit 9599e59

26 files changed

+1726
-101
lines changed

β€ŽCODE_OF_CONDUCT.mdβ€Ž

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others’ private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.
36+
37+
Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
38+
39+
## Enforcement
40+
41+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at https://gssoc.girlscript.tech/team.
42+
43+
All complaints will be reviewed and investigated promptly and fairly.
44+
45+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
46+
47+
## Enforcement Guidelines
48+
49+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
50+
51+
### 1. Correction
52+
53+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
54+
55+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
56+
57+
### 2. Warning
58+
59+
**Community Impact**: A violation through a single incident or series of actions.
60+
61+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
62+
63+
### 3. Temporary Ban
64+
65+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
66+
67+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
68+
69+
### 4. Permanent Ban
70+
71+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
72+
73+
**Consequence**: A permanent ban from any sort of public interaction within the community.
74+
75+
## Attribution
76+
77+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at
78+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html)
79+
80+
Community Impact Guidelines were inspired by [Mozilla’s code of conduct enforcement ladder](https://github.com/mozilla/diversity).
81+
82+
[homepage]: https://www.contributor-covenant.org
83+
84+
For answers to common questions about this code of conduct, see the FAQ at
85+
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq).
86+
87+
---

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 70 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,84 @@
11
# Contributing to Driver Drowsiness Detection System πŸš—πŸ’€
22

3-
Thanks for your interest in contributing! This guide will help you get started.
3+
First off, thank you for considering contributing to this project! Your help is greatly appreciated.
44

5-
πŸ™ **If you haven't already, please consider [starring the repository ⭐](https://github.com/Gagandeep-2003/Driver-Drowsiness-Detection-System)** to show your support and help others discover the project.
5+
πŸ™ **If you haven't already, please consider starring the [repository](https://github.com/Gagandeep-2003/Driver-Drowsiness-Detection-System) ⭐ to show your support and help others discover the project.**
66

77
---
88

99
## πŸ› οΈ Project Setup
10-
11-
1. **Fork the repository**
12-
Click the `Fork` button on the top right of the repo.
13-
14-
2. **Clone your fork**
15-
```bash
16-
git clone https://github.com/Gagandeep-2003/driver-drowsiness-detection-system.git
17-
cd driver-drowsiness-detection-system
18-
19-
Create a virtual environment (optional but recommended)
20-
21-
python -m venv venv
22-
source venv/bin/activate # or venv\Scripts\activate on Windows
23-
24-
Install dependencies
25-
10+
Follow these steps to get the project running on your local machine.
11+
12+
### 1. **Fork and Clone**
13+
1. **Fork the repository**: Click the `Fork` button on the top right of the repo.
14+
2. **Clone your fork**:
15+
16+
```bash
17+
git clone https://github.com/YOUR-USERNAME/driver-drowsiness-detection-system.git
18+
cd driver-drowsiness-detection-system
19+
```
20+
21+
### 2. **Set Up Your Environment**
22+
1. **Create a virtual environment** (optional but highly recommended):
23+
24+
```bash
25+
# On Windows
26+
py -m venv venv
27+
venv\Scripts\activate
28+
29+
# On macOS/Linux
30+
python3 -m venv venv
31+
source venv/bin/activate
32+
```
33+
34+
2. **Install dependencies**:
35+
36+
```bash
2637
pip install -r requirements.txt
38+
```
39+
40+
3. **Download the dlib facial landmark model**
41+
The blink detection feature requires a pre-trained model.
42+
* Download the file from [this link](https://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2).
43+
* Unzip it and place the `shape_predictor_68_face_landmarks.dat` file inside the `/models` directory.
44+
45+
<br>
46+
47+
## πŸ”„ How to Contribute
48+
49+
1. **Find an issue**: Check the existing [issues](https://github.com/Gagandeep-2003/Driver-Drowsiness-Detection-System/issues) to see if you can help, or raise a new issue if you have a new idea.
50+
2. **Create a new branch**:
51+
52+
```bash
53+
git checkout -b your-feature-name
54+
```
55+
56+
3. **Make your changes**: Write your code and make sure to follow the project's style.
57+
4. **Commit your changes**:
58+
59+
```bash
60+
git add .
61+
git commit -m "feat: Add feature XYZ"
62+
```
63+
64+
5. **Push and create a pull request (PR)**:
65+
66+
```bash
67+
git push origin your-feature-name
68+
```
69+
70+
Then, go to your fork on GitHub and click "Compare & pull request".
2771
28-
Download the facial landmark model
29-
30-
The dlib facial landmark model is required for blink detection. Download it from the link below, unzip it, and place the `shape_predictor_68_face_landmarks.dat` file inside the `/models` directory.
31-
* **Download Link**: [shape_predictor_68_face_landmarks.dat](https://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2)
32-
33-
πŸ”„ How to Contribute
34-
35-
Check existing issues or ask to be assigned one on Discord.
36-
37-
Create a new branch
38-
39-
git checkout -b feature-name
40-
41-
Make your changes
42-
43-
Commit your changes
44-
45-
git add .
46-
git commit -m "Added feature XYZ"
47-
48-
Push and create a pull request (PR)
49-
50-
git push origin feature-name
51-
52-
Then go to your fork on GitHub and click "Compare & pull request".
53-
54-
βœ… Guidelines
55-
56-
Keep your code clean and readable
57-
58-
Follow existing naming and code style
59-
60-
Comment your code where needed
72+
---
6173
62-
One feature or bug fix per PR
74+
## βœ… Contribution Guidelines
75+
* Keep your code clean, readable, and well-commented where necessary.
76+
* Follow the existing naming conventions and code style.
77+
* Ensure each pull request addresses only one feature or bug fix.
78+
* Comment your code where needed.
6379
64-
πŸ™Œ Need Help?
80+
## πŸ™Œ Need Help?
6581
6682
Feel free to ask questions in the GSSoC Discord or open a discussion!
6783
68-
Let’s build something amazing together πŸš€
69-
70-
71-
---
72-
73-
Let me know if you want to add sections like testing instructions or folder structure too!
84+
> Let’s build something amazing together πŸš€

β€ŽDEPLOYMENT.mdβ€Ž

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# πŸš€ PWA Deployment Guide
2+
3+
## Quick Start
4+
5+
1. **Install Dependencies**
6+
```bash
7+
pip install -r requirements.txt
8+
```
9+
10+
2. **Launch PWA-Enhanced App**
11+
```bash
12+
cd streamlit_app
13+
streamlit run streamlit_app_pwa.py
14+
```
15+
16+
3. **Access the App**
17+
- Local: http://localhost:8501
18+
- Network: Your local IP on port 8501
19+
20+
## 🌐 Production Deployment
21+
22+
### Option 1: Streamlit Cloud (Recommended)
23+
1. Push your code to GitHub
24+
2. Go to [share.streamlit.io](https://share.streamlit.io)
25+
3. Connect your GitHub repo
26+
4. Select `streamlit_app/streamlit_app_pwa.py` as main file
27+
5. Deploy - PWA features will work with HTTPS
28+
29+
### Option 2: Heroku
30+
```bash
31+
# Create Procfile
32+
echo "web: streamlit run streamlit_app/streamlit_app_pwa.py --server.port $PORT" > Procfile
33+
34+
# Deploy to Heroku
35+
heroku create your-app-name
36+
git push heroku main
37+
```
38+
39+
### Option 3: Docker
40+
```dockerfile
41+
FROM python:3.9-slim
42+
43+
WORKDIR /app
44+
COPY requirements.txt .
45+
RUN pip install -r requirements.txt
46+
47+
COPY . .
48+
EXPOSE 8501
49+
50+
CMD ["streamlit", "run", "streamlit_app/streamlit_app_pwa.py", "--server.address", "0.0.0.0"]
51+
```
52+
53+
## πŸ“± Testing PWA Installation
54+
55+
### Desktop Testing
56+
1. Open Chrome/Edge
57+
2. Navigate to your deployed app (HTTPS required)
58+
3. Look for install icon in address bar
59+
4. Click "Install" and test offline functionality
60+
61+
### Mobile Testing
62+
1. Open in Chrome (Android) or Safari (iOS)
63+
2. Add to Home Screen
64+
3. Launch from home screen
65+
4. Test app-like behavior
66+
67+
## πŸ”§ Customization Options
68+
69+
### Modify App Theme
70+
Edit `manifest.json`:
71+
```json
72+
{
73+
"theme_color": "#your-color",
74+
"background_color": "#your-bg-color"
75+
}
76+
```
77+
78+
### Update App Icons
79+
1. Replace icons in `/icons/` folder
80+
2. Or regenerate: `python3 generate_icons.py`
81+
82+
### Configure Caching
83+
Edit `sw.js` to modify cache strategy:
84+
```javascript
85+
const urlsToCache = [
86+
'/',
87+
'/your-additional-assets'
88+
];
89+
```
90+
91+
## 🎯 PWA Best Practices
92+
93+
- βœ… Use HTTPS in production
94+
- βœ… Optimize icon sizes (under 1MB total)
95+
- βœ… Test on multiple devices
96+
- βœ… Implement proper error handling
97+
- βœ… Keep offline page informative
98+
99+
## πŸ“Š PWA Analytics
100+
101+
Track PWA performance:
102+
- Installation rates
103+
- Offline usage patterns
104+
- User engagement metrics
105+
- Performance improvements
106+
107+
---
108+
109+
**Your PWA is ready! πŸŽ‰**
110+
111+
Users can now install your drowsiness detection app like a native application on any device.

0 commit comments

Comments
Β (0)