In this simple web app, both Google Vision API and OpenAI's GPT-3.5 Turbo model are utilized. The initial step involves analyzing the content of uploaded images using Google Vision API to extract labels, which subsequently serve as prompts for story generation using the GPT-3.5 Turbo model.
demo.mp4
-
Obtain a Google Vision API Key:
- Visit the Google Cloud Console.
- Create a new project or select an existing one.
- Enable the "Cloud Vision API" for your project.
- Create API credentials and copy the API key.
- Add the API key to the
.env
file underGOOGLE_VISION_API_KEY
.
-
Obtain an OpenAI API Key:
- Visit the OpenAI API to get access to the GPT-3.5 Turbo model.
- Copy the API key.
- Add the API key to the
.env
file underOPENAI_API_KEY
.
-
Start the Server:
node server.js
-
Start the React App: Open a new terminal and run:
npm start
-
Access the App:
- Open your browser and navigate to
http://localhost:3000
. - You should see the Image-to-Story Generator UI.
- Open your browser and navigate to
-
Upload an Image:
- Click the "upload image to generate story" button.
- Select an image from your local machine.
-
View the Generated Story:
- Once the image is uploaded, the app will display the uploaded image.
- A typewriter effect will reveal the generated story based on the image content.
- The application uses Node.js for the server and React for the front end.
- The server runs on
http://localhost:3001
, and the React app runs onhttp://localhost:3000
.