Name: Jasper Wink UvA ID: 14616513
This repository contains the source code for the diminished reality web application for the phone.
The following steps help you deploy the web application.
-
Deploy the back-end files on a device that has access to an NVIDIA GPU. If you don't have access to one, remove the line: "model.to("cuda")" from the file "back-end.py". Now the YOLO model will run on the CPU (Which is slower).
-
Create and run a virtual environment using:
Linux / MacOS:
python3 -m venv venv
source venv/bin/activate
Windows:
python -m venv venv
venv\Scripts\activate
- Download the required packages using:
pip install -r requirements.txt
- The python file can now be ran with the command:
python3 back-end.py
The proxy folder is not required. But in our case it is required to access the back-end.
-
If it is needed, the files should be deployed on a device that has access to the back-end and follow steps 2-3 from the back-end section.
-
The ip address and port number of the back-end should be defined in the backend socket.
-
Finally run the proxy file using the following command:
python3 proxy.py
-
The front-end should be on a device that has access to a SLL certificate. The path to, and names of the certificates should be defined in server.js.
-
If the back-end is accessable directly, the "target_ip" and "port" in server.js should point to the back-end directly. Else, the port number and ip should point to the proxy.
-
Now create and run a virtual environment, see steps 2 and 3 in the back-end section.
-
Download all packages by running the following command in the folder with "package.json".
npm install
- Finally run start the web application using the command:
./run.sh