
This application is a distinctive and entertaining that allows users to discover which StarWars character they resemble the most, utilizing advanced vector search and face recognition technologies. It integrates the robustness of a React-based frontend, MongoDB Atlas Vector Search, and Python Face Recognition API to offer a seamless and enjoyable user experience.
This application is not just a source of entertainment but can also serve as a reference or starting point for developers looking to integrate face recognition and vector search in their projects. It can be used as an educational tool for those interested in learning about the integration of different technologies to create a cohesive application.
MONGO_URI in the Flask application flask_server.py with your MongoDB URI.face_recognition Python libraryNavigate to the backend directory and install the required Python packages:
cd starwars-backend
pip install -r requirements.txt
python flask_server.pyOnly run the encode-characters the first time you setup, as it will generate vectors for all starwars_characters_images and store them in a MongoDB namepspace: starwars.characters
curl -X POST http://127.0.0.1:5000/encode-characters -H "Content-Type: application/json" -d '{"path": "starwars_characters_images"}'Create Atlas Search index, on database starwars and collection characters using the JSON config and lappy below config
{
"mappings": {
"dynamic": true,
"fields": {
"encoding": {
"dimensions": 128,
"similarity": "euclidean",
"type": "knnVector"
}
}
}
}Navigate to the frontend directory and install the required npm packages:
cd starwars-frontend
npm install
npm startThe React application should now be running on http://localhost:3000, and the Flask application should be running on http://localhost:5000.
This project is licensed under the MIT License - see the LICENSE.md file for details.
face_recognition Python library for providing the face encoding functionality.use starwars
db.characters.deleteMany({})Doing the above means that you will need to regenerate the vectors for the starwars characters using the below:
curl -X POST http://127.0.0.1:5000/encode-characters -H "Content-Type: application/json" -d '{"path": "starwars_characters_images"}'The StarWars Look-a-Like Finder is a captivating application that combines modern technologies to provide users with an amusing way to find their StarWars twin. Its user-friendly interface, advanced face recognition capabilities, and efficient database interactions ensure that users receive accurate and swift results, making it an exciting and educational platform for StarWars fans and tech enthusiasts alike.