nartc / angular-webxr-art-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular WebXR Art Sample

Angular WebXR Art Sample is a WebXR Gallery that creates Generative AI images using Vertex AI Image Generation and creates captioning using Gemini Multimodel API.

This project was generated with Angular CLI version 17.1.0-rc.1.

Angular WebXR Art Sample

Pre-requisites

  1. Node.js and npm
  1. Gemini API key

Setup

To get started with the Angular app without setting up the Gemini API, you can install the dependencies and run start script.

You need have install Node version 18 and up installed in your development environment.

npm install
npm run start

Setting up Gemini API

Imagen on Vertex AI | AI Image Generator image generation feature currently requires allow list. Fill out the the request form to get access to the API.

Enable Gemini Vertex AI in a Google Cloud Project.

Run Gemini API locally

cd server
gcloud init
gcloud config set project <PROJECT_ID>
gcloud auth application-default login
python3 -m venv .
. bin/activate
pip install -r requirements.txt
python main.py
  • Once the Python server is running, start the Angular server in your root folder
npm i

Call the Gemini API in a cloud Function(Optional)

If you would like to run the API on a Google Cloud Function, follow these steps:

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.

About

License:Apache License 2.0


Languages

Language:TypeScript 75.5%Language:Python 9.4%Language:HTML 7.3%Language:SCSS 5.8%Language:JavaScript 1.3%Language:Shell 0.7%