Coder Social home page Coder Social logo

ar-shopping's Introduction

Affirm Vision

AR Shopping App

Video demo: https://youtu.be/EvpvVzsdshU

This application uses OpenAI's GPT-4 Vision model to identify products in an image and then searches for these products on the internet. Setup

To run the UI:

  1. cd into the client directory
  2. run npm install
  3. run npm start
  4. open localhost:3000 in your browser

To run the server:

  1. Create a Python virtual environment

You can create a Python virtual environment using the venv module:

python3 -m venv vision

This will create a new virtual environment named env.

  1. Activate the virtual environment

Before you can start installing or using packages in your virtual environment you’ll need to activate it. Activation associates your shell session with the virtual environment.

  • On macOS and Linux:
    source vision/bin/activate
  • On Windows:
    .\vision\Scripts\activate
  1. Install the required packages

Install all the necessary packages using the requirements.txt file:

    pip install -r requirements.txt
  1. Set up your environment variables

Create a .env file in the root directory of your project and add your environment variables to it:

   OPENAI_API_KEY=your_openai_key
   SEARCH_ENGINE_API_KEY=your_google_api_key
   SEARCH_ENGINE_ID=your_google_cx

Replace your_openai_key, your_google_api_key, and your_google_cx with your actual keys.

  1. cd into the server directory, and run the server using uvicorn
    uvicorn main:app --reload
  1. (Optionally) Run the streamlit version from the root directory

You can run the application using Streamlit:

    python -m streamlit run main.py

This will start the Streamlit server and open the application in your web browser.

Remember to never commit your .env file to version control. It contains sensitive data. Add it to your .gitignore file.

  1. Creating and running a docker container

You can containerize this application by running the following command:

docker build -t ar-shopping:latest .

After the container is created, you can run image accordingly:

docker run -p 8000:80 -e OPENAI_API_KEY=OPENAI_API_KEY -e SEARCH_ENGINE_ID=SEARCH_ENGINE_ID -e SEARCH_ENGINE_API_KEY=SEARCH_ENGINE_API_KEY ar-shopping:latest

Make sure to replace the placeholder env variabels with correct ones.

If you're having issues with stopping the container you can run the following command:

docker kill $(docker ps -q -f publish=8000)

ar-shopping's People

Contributors

parsatajik avatar gaggarwal21 avatar olsenbudanur avatar

Stargazers

 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.