Skip to content

Commit c5e584b

Browse files
Merge pull request #52 from KasunThushara/main
ADD: Flask Hailo web GUI
2 parents 237708c + 47d5cff commit c5e584b

2 files changed

Lines changed: 111 additions & 0 deletions

File tree

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
6+
7+
# Make your Own Web Application with Hailo and Using Flask
8+
9+
![object detection](../../pictures/Chapter3/flask.gif)
10+
11+
This tutorial walks you through setting up a Hailo-based web application using Flask. It covers installing necessary dependencies, setting up the environment, and running the server. Here’s a step-by-step breakdown:
12+
13+
### Step 1: Update the System
14+
15+
Open a terminal on your reComputer AI Box and run the following commands to update your system:
16+
17+
```
18+
sudo apt update
19+
sudo apt full-upgrade
20+
```
21+
### Step 2: Set PCIe to Gen3
22+
23+
Follow the [tutorial](https://seeed-projects.github.io/Tutorial-of-AI-Kit-with-Raspberry-Pi-From-Zero-to-Hero/docs/Chapter_2-Configuring_the_RaspberryPi_Environment/Introduction_to_Hailo_in_Raspberry_Pi_Environment#installing-hailo-software-on-raspberry-pi-5) to set PCIe to Gen3 as required for the Hailo device.
24+
25+
### Step 3: Install Dependencies for NPU
26+
27+
```
28+
sudo apt install hailo-all
29+
```
30+
31+
### Step 4: Set Up the Project Environment
32+
33+
- **Create a New Directory**
34+
35+
```
36+
mkdir Hailo-Web-App
37+
cd Hailo-Web-App
38+
```
39+
- **Create and Activate a Virtual Environment**
40+
41+
```
42+
python -m venv --system-site-packages env
43+
source env/bin/activate
44+
45+
```
46+
- **Clone the Repository**
47+
48+
```
49+
git clone https://github.com/KasunThushara/Hailo-Web.git
50+
cd Hailo-Web
51+
```
52+
53+
- **Install Python Dependencies**
54+
55+
```
56+
pip install -r requirements.txt
57+
```
58+
- **Grant Execution Permission to the Download Script**
59+
60+
```
61+
chmod +x download_resources.sh
62+
```
63+
64+
- **Run the Resource Download Script**
65+
66+
```
67+
./download_resources.sh
68+
```
69+
70+
### Step 5: Start the Server
71+
72+
- **Navigate Back to the Project Directory at New Terminal**
73+
74+
```
75+
cd ../Hailo-Web-App
76+
```
77+
78+
- **Activate the Virtual Environment (if not already activated)**
79+
80+
```
81+
source env/bin/activate
82+
```
83+
84+
- **Navigate to the Hailo-Web Directory**
85+
86+
```
87+
cd Hailo-Web
88+
```
89+
90+
- **Start the Server**
91+
92+
```
93+
python3 server.py
94+
95+
```
96+
97+
### Step 6: Access the Web UI
98+
99+
Once the server is running, open a web browser and visit:
100+
101+
```
102+
http://<pi-ip-address>:5000
103+
```
104+
105+
### What You Will Do on the Web UI:
106+
- Choose the vision task (e.g., object detection, pose estimation).
107+
- Upload the relevant files for the selected task.
108+
- View the results directly on the web interface.
109+
This setup provides a user-friendly interface for interacting with the Hailo device for various vision tasks.
110+
111+

pictures/Chapter3/flask.gif

10.4 MB
Loading

0 commit comments

Comments
 (0)