Welcome to the frontend repository of the "Snapchat-Face-Filter" project! This repository contains the code for the frontend application that works in conjunction with the "Snapchat-Face-Filter-Backend" repository to provide a face filter experience.
Before running the application, ensure that you have the following installed:
- Python3: Download and install Python
- Web browser: Any modern web browser like Chrome, Firefox, or Safari.
- OpenCV Python:
pip install opencv-python
- Python SocketIO:
pip install python-socketio
- Requests:
pip install requests
- Websocket Client:
pip install websocket-client
-
Clone the repository:
- Open your preferred Code Editor (I recommend using VS Code).
- Click
Terminal
->New Terminal
. - Run the command
git clone https://github.com/ayush4460/Snapchat-Face-Filter.git
in the Terminal. - Git will start cloning the repository to your local machine.
- Once the cloning process is complete, you will have a local copy of the repository in the specified directory.
- Navigate to the project directory:
cd Snapchat-Face-Filter
.
-
Run the Python script:
- Open a terminal or command prompt.
- Navigate to the project directory:
cd Snapchat-Face-Filter
. - Run the command
python a.py
or directly run the python file. - This will start the Python script and open the camera with applied face filters.
-
Open the web page:
- Open a web browser (Chrome, Firefox, or Safari).
- In the address bar, enter the path to the
index.html
file located in the cloned repository, e.g.,file:///path/to/Snapchat-Face-Filter/index.html
. - If you have Live Server extension on VS Code just click "Go Live" present on the bottom right.
- The web page will open, displaying the available face filters.
-
Select and apply filters:
-
On the web page, you will see a variety of face filters.
-
Click on a filter to apply it to the camera feed.
-
Swiping the filter will also apply it to the camera feed.
-
For Swipe functionality, follow these steps:
- Click
Ctrl+Shift+i
in the keyboard to open Console. - Now, Click
Ctrl+Shift+m
in the keyboard to open Toggle Device Toolbar. - On the top, Select
Dimensions -> Click on any device mentioned there
. - Hover on the filters and
Swipe right or left
to apply that filter to the camera feed .
-
-
Capture an image:
- Once you are satisfied with the selected filter, click the "Capture" button on the web page.
- The captured image will be saved in the "image" folder of the repository.
NOTE:
- Note that you need to open both the frontend and backend code on Local Machine ie. both should have a HTTP connection
- Don't forget to run the backend files present in my
Snapchat-Face-Filter-Backend
repository
Feel free to explore and modify the code to customize the filters and add new functionalities to enhance your Snapchat face filter experience.
Contributions to the project are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
To contribute:
- Fork the repository on GitHub.
- Clone your forked repository to your local machine.
- Create a new branch for your feature or bug fix.
- Make the necessary changes and commit them.
- Push your changes to your forked repository.
- Submit a pull request to the original repository.
This project is licensed under the MIT License.
Go through the Security Policy of this Project
The python a.py
file is made by my colleague Mit, so all credits to him.
Feel free to update the content of this README file to match your project structure and provide additional information as needed.