Prerequisites:
- NodeJS with "yarn" package manager, installable via Node version manager (https://github.com/coreybutler/nvm-windows)
- AnaConda environment and conda CLI tool
- Roboflow free account with two projects for image segmentation and classification
- ImageKit free account
- Firebase Firestore credentials
- CUDA toolkit 12.1
Setup:
-
Git clone the project from https://github.com/Kyewn/Labret.git
-
Create a .env file within the /client directory using .env.example as format and fill up environment variable values for Firestore and ImageKit credentials. Firestore credentials are given upon setting up a Firebase account, ImageKit credentials can be found in the developer console of an ImageKit account. Keep the env variable names consistent with /client's .env.example.
-
Create a .env file within the /server directory using .env.example as format and fill up environment variable values for Roboflow and ImageKit credentials. ImageKit credentials are same as in /client and Roboflow credentials are found in the Roboflow project keys. Set the face project ID to the ID of the classification project on your Roboflow account, and set the item project ID to the ID of the segmentation project on your Roboflow account. Keep the CIPHER_KEY value same as in .env.example.
-
Insert the Firebase service account key json file that was generated from creating a Firebase project online in the /server directory as "serviceAccountKey.json". The JSON file contains a structure like this: { "type": "service_account", "project_id": "private_key_id": "private_key": "client_email": "client_id": "auth_uri": "token_uri": "auth_provider_x509_cert_url": "client_x509_cert_url": "universe_domain": }
-
Create a .env file within the /emailServer directory using .env.example as format and fill up environment variable values for Gmail credentials. DEV_NAME requires a valid Gmail email address. DEV_PASSWORD requires an app password created for the entered email. To create an app password, follow this Google help page: https://support.google.com/accounts/answer/185833.
-
Using a command prompt in the /client directory, install client dependencies with command "yarn"
-
Using a command prompt in the /server directory, initialize a conda environment and install server dependencies with command "conda env create -n <NAME_OF_ENVIRONMENT> --file condaRequirements.yml"
After installing dependencies, install pytorch with CUDA dependencies separately using the following code: "conda activate <YOUR_CREATED_ENV_NAME> conda install pytorch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 pytorch-cuda=12.1 -c pytorch -c nvidia"
-
Using a command prompt in the /emailServer directory, install emailServer dependencies with command "yarn"
-
Using a command prompt in the /server directory, run the main.py file using Python from the created conda environment with command "python main.py"
-
Using a command prompt in the /server directory, run the camera.py file using Python from the created conda environment with command "python camera.py"
-
Using a command prompt in the /emailServer directory, run the email server main.js file using command "yarn dev"
-
Using a command prompt from the /client directory, start the program using command "yarn dev". Navigate to the published localhost link using a browser.