Skip to content

Commit

Permalink
docu
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Jul 17, 2024
1 parent 8ceaec4 commit 050a3da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,49 @@

## Problem Statement

This application is a prototype for a tool that helps companies in the resale market to identify and price second
hand clothing items. As correctly identifying and pricing items is a time-consuming process which often includes human
labor, the tool aims to automate this process using image recognition and natural language processing. The tool should
be able to categorize clothing items based on images and provide a price estimate for the item based of available second
hand market data.

## Execution

### Docker Compose
The simplest way to run the application is to use `docker-compose`. This will start the frontend and backend services in separate containers.

**Requirements:**
- Docker
The simplest way to run the application is to use `docker-compose`. This will start the frontend and backend
services in separate containers. For the application to work correctly, you need to set the `OPENAI_API_KEY`
environment variable to your OpenAI API key. It only requires Docker to be installed on your system. Run
the following commands to start the application in the root directory of the project:

```bash
export OPENAI_API_KEY=sk-your-key-here
docker-compose up
```

The frontend will be available at `http://localhost:3001` and the backend will be available at `http://localhost:3002`.

### Manual Setup

If you prefer to run the frontend and backend services manually, you can follow the instructions below.

**Requirements:**

- Node.js
- Yarn
- Python 3.8
- Poetry

#### Frontend

```bash
cd frontend
yarn install
yarn dev
```

#### Backend

```bash
cd backend
poetry install
Expand All @@ -42,7 +54,9 @@ poetry run python -m lens_gpt_backend.main
## Technical Background

### Frontend

Read the [frontend documentation](docs/frontend.md) for more information.

### Backend

Read the [backend documentation](docs/backend.md) for more information.
8 changes: 5 additions & 3 deletions docs/backend.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Backend
## Backend

The backend, which is responsible for the identification based of a picture and streaming that information to the
frontend is build in Python 3.12 using poetry as its dependency manager. The backend is a flask application that
utilizes the Google Lens features by utilizing Selenium to access the Google Lens website and GPT-4o to generate
a description of the picture. The backend is containerized using Docker and can be run using the following command:

## Usage
### Usage

The usage of the backend in production requires Docker to be installed.
The usage of the backend in production requires Docker to be installed on the system. The backend can be run
using the following command, replacing `sk-your-key-here` with the OpenAI API key:

```bash
cd lens-gpt-backend
docker build -t lens-gpt-backend .
docker run \
--rm \
-e DISPLAY=:99 \
-e OPENAI_API_KEY=sk-your-key-here \
-p 3002:5000 \
lens-gpt-backend \
/bin/bash -c "Xvfb :99 -screen 0 1280x1024x24 & poetry run python -m lens_gpt_backend.main"
Expand Down
5 changes: 2 additions & 3 deletions lens-gpt-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
A backend for the categorization of clothing pictures using Google Lens and GPT-3.




## Docker

To build the docker image, run the following command:
Expand All @@ -13,12 +11,13 @@ To build the docker image, run the following command:
docker build -t lens-gpt-backend .
```

To run the docker image, run the following command:
To run the docker image, run the following command, replacing `sk-your-key-here` with your OpenAI API key:

```bash
docker run \
--rm \
-e DISPLAY=:99 \
-e OPENAI_API_KEY=sk-your-key-here \
-p 3002:3002 \
lens-gpt-backend \
/bin/bash -c "Xvfb :99 -screen 0 1280x1024x24 & poetry run python -m lens_gpt_backend.main"
Expand Down

0 comments on commit 050a3da

Please sign in to comment.