From e35106426e42774a828db91a6f8c4baf2154ce4d Mon Sep 17 00:00:00 2001 From: sosokker Date: Mon, 13 May 2024 20:41:04 +0700 Subject: [PATCH] Update README and add example env --- README.md | 71 +++++++++++++++++++++++++++++++++++- StreamServer/src/example.env | 16 ++++++++ train/data/data.csv | 10 +++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 StreamServer/src/example.env create mode 100644 train/data/data.csv diff --git a/README.md b/README.md index b2f1b34..2163d04 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Simple Healthcare System +# HomieCare ## Table of Contents @@ -8,8 +8,77 @@ ## Installation +First of all clone this repository then install requirement file in `requirements\base.txt` + +Recommend to create virtual environment + +### Podman Container + +First of all, you need podman (it's like a docker but daemonless) + +[Podman installation](https://podman.io/docs/installation) + +#### Install MinIO + +You can follow detailed step [here](https://min.io/download) + +**Window** + +```bash +podman run -p 9000:9000 -p 9001:9001 minio/minio server /data --console-address ":9001" +``` + +#### Install PhpmyAdmin and MySQL + +```bash +# Pull mysql and phpmyadmin then create network +podman pull docker.io/library/mysql docker.io/library/phpmyadmin +podman network create net-pma + +# Run both Images +podman run --name service-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --network net-pma -d docker.io/library/mysql + +podman run --name service-pma -p 8080:80 -e PMA_HOST=service-mysql --network net-pma -d docker.io/library/phpmyadmin +``` + +### Download Model files then put in project + +[Download here](https://drive.google.com/drive/folders/1GGcKz8bqPll6PWNh4bPjFIH0fmOdof4p?usp=sharing) + +Then put into following path (Not fix to be this path but it would be great) + +- sppe, TSSTG, yolo-tiny-onecls folder -> `StreamServer\src\analytic\action\Models` + +- xgboost_model.pkl -> `StreamServer\src\analytic\health` + +### Create .env file + +Take a look at description in example.env and fill out those parameter + ## Usage +### Start Server + +Start server with main.py in `StreamServer\src` + +```bash +py main.py +``` + +### Run React + +Start server with this command in `frontend` + +```bash +pnpm dev +``` + +Then access webpage at [http://localhost:5173/](http://localhost:5173/) + +Visit API documentation at [http://127.0.0.1:8000/api/v1/docs/swagger/](http://127.0.0.1:8000/api/v1/docs/swagger/) or +[http://127.0.0.1:8000/api/v1/docs/](http://127.0.0.1:8000/api/v1/docs/) + ## Reference - [Human-Falling-Detect-Tracks by GajuuzZ](https://github.com/GajuuzZ/Human-Falling-Detect-Tracks) +- [TailAdmin](https://tailadmin.com/) diff --git a/StreamServer/src/example.env b/StreamServer/src/example.env new file mode 100644 index 0000000..5ea2e46 --- /dev/null +++ b/StreamServer/src/example.env @@ -0,0 +1,16 @@ +DB_HOST= +DB_USER= +DB_PASSWD= +DB_NAME= +MINIO_ENDPOINT= +MINIO_ACCESS_KEY= +MINIO_SECRET_KEY= +VIDEO_BUCKET= +CONFIG_FILE = +YOLO_WEIGHT_FILE = +SPPE_WEIGHT_FILE = +TSSTG_WEIGHT_FILE = +LINE_NOTIFY_TOKEN = +WEATHER_API_KEY = +LAT = +LON = \ No newline at end of file diff --git a/train/data/data.csv b/train/data/data.csv new file mode 100644 index 0000000..afdf994 --- /dev/null +++ b/train/data/data.csv @@ -0,0 +1,10 @@ +"3","2024-04-19 02:55:01","29.24","32.13","1005","64","Clouds","few clouds","65","34","28","42" +"4","2024-04-19 03:00:02","29.24","32.13","1005","64","Clouds","few clouds","65","34","27.75","42" +"5","2024-04-19 03:05:02","29.24","32.13","1005","64","Clouds","few clouds","65","34","27.5","42" +"6","2024-04-19 03:10:02","30.09","36.28","1005","74","Clouds","few clouds","65","34","27.75","42" +"8","2024-04-19 03:20:02","30.11","37.11","1005","79","Clouds","few clouds","65","34","28","40" +"9","2024-04-19 03:25:02","29.45","33.12","1005","67","Clouds","few clouds","65","34","27.75","38" +"10","2024-04-19 03:32:06","29.45","33.12","1005","67","Clouds","few clouds","65","34","28.5","39" +"11","2024-04-19 03:37:06","29.45","33.12","1005","67","Clouds","few clouds","65","34","28.5","39" +"12","2024-04-19 03:42:06","30.2","37.2","1005","79","Clouds","few clouds","65","34","28.5","18" +"13","2024-04-19 03:47:06","30.2","37.2","1005","79","Clouds","few clouds","69","36","28.5","18"