Code Monkey home page Code Monkey logo

babyfaceai's Introduction

BabyFace

🔧 Dependencies

google-cloud-aiplatform==1.36.4
redis==5.0.1
twilio==8.10.2

Vertex AI

Install the Vertex AI SDK for Python with this link. Ensure that the Python version (Python 3.10 or 3.11 as of 11/19/23) for the virtual environment fits the python requirement for Vertex AI SDK. Then, set up the Application Default Credentials for your Google Cloud Services. Finally, ensure to do source ~/.bashrc at the end.

Redis

Install Redis for Python with this link or using pip install redis . Please refer to the Redis Documentation for more help.

Twilio

Install and setup Twilio for Python using this link or using pip install twilio.

📖 Implementation

Diagram

Workflow

Redis Database

Create library to use in other files to create the same Redis instance

Conversationer

Initiates conversation with Vertex AI and sends/receives messages from a Redis Database.

Initializes Google API Platform
Initializes Redis Database
Initializes a Vertex AI ChatModel using a pre-trained model named "chat-bison"
Retrieves context and input message from the Redis database
Starts a chat with the Vertex AI model using the provided context
Sends the input message to the model and receives a response
Tries to establish a connection to another Redis database to verify connectivity.
Stores the model's response back into the Redis database for the user

Image Question and Answer

Use Vertex AI image text model to answer a series of questions about baby’s situation.

Initialize Google Cloud and Vertex AI Model
Load the input image 
Generate the answers given the series of questions 
Initialize the Redis database 
Formulate and publish the answers as the context for 
	the Conversationer 

Twilio App

Contains SMS interactions with Parent

Initializes Redis Database 
Create a Twilio Client 
Retrieve and publish the Parent's Message 
	for Conversationer
Retrieve Conversationer's Message and send to the Parent

Image Capturer

Takes image from laptops' webcam

Open a connection to camera
Once every 10 second has passed since the last capture, 
	capture a new image

🚀 Launch

  1. Navigate to first_demo folder
  2. Ensure that Google Application Default Credentials are set up
  3. Confirm that Twilio’s Account SID, Authentication Code, and Phone Numbers are correct
  4. Learn the virtual environment that you have created with the main dependencies
  5. Execute capture_image.py on a terminal
  6. Execute ngrok http 5000 on a different terminal and copy ngrok URL into Twilio Webhook
    1. ⚠️MacOS needs to turn off Airplay Receiver in Settings
  7. Execute Twilio Flask App twilio_app.py on another terminal, resulting in three different running terminals
  8. Text to Your Designated Baby Face AI!

🔮 Future Implementations

Our vision extends to integrating long-term video monitoring devices like cameras or specialized baby monitoring devices. We aim to refine our AI model, providing more tailored solutions and fostering more engaging conversations to better serve parents and their babies.

babyfaceai's People

Contributors

phuc-tran-hub avatar kulkoen avatar lukehartzell1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.