This project utilizes Express.js and Google's Generative AI to create an image analysis agent. The agent is capable of recognizing differences between two images and describing them. If a person is detected in the images, it provides a description; otherwise, it returns "no intruder."
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd eternal-security
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add your Google Generative AI API key:API_KEY=your-api-key
-
Start the server:
npm start
-
Access the application through a web browser or send POST requests to the
/api/submit-images
endpoint with two images to analyze.
-
POST /api/submit-images: Uploads two images and analyzes the differences between them.
-
Request Parameters:
- image1: The first image file.
- image2: The second image file.
-
Response:
- Status: 200 OK
- Body: JSON object with a message describing the differences between the images.
-
- MODEL_NAME: The name of the generative model to use for text generation.
- API_KEY: Your Google Generative AI API key. Make sure to set this as an environment variable.
- uploads/: Stores uploaded images.
- public/: Contains static files served by Express.js.
- README.md: Documentation for the project.
- app.js: Main application file.
- package.json: Contains project metadata and dependencies.
- express: Fast, unopinionated, minimalist web framework for Node.js.
- multer: Middleware for handling multipart/form-data, used for file uploads.
- @google/generative-ai: Google's Generative AI package for text generation and conversation modeling.