Skip to content

Commit

Permalink
Update config file format, from json to yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong1120 committed Jun 9, 2024
1 parent 486e8fa commit b2f0abd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 36 deletions.
35 changes: 16 additions & 19 deletions README-zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@

## 配置

在運行應用程序之前,您需要通過在 JSON 配置文件中指定視頻流和其他參數的詳細信息來配置系統。一個示例配置文件 `configuration.json` 應該如下所示:

```json
[
{
"video_url": "rtsp://example1.com/stream",
"api_url": "http://localhost:5000/detect",
"model_key": "yolov8l",
"line_token": "token1"
},
{
"video_url": "rtsp://example2.com/stream",
"api_url": "http://localhost:5000/detect",
"model_key": "yolov8l",
"line_token": "token2"
}
]
在運行應用程序之前,您需要通過在 YAML 配置文件中指定視頻流和其他參數的詳細信息來配置系統。一個示例配置文件 `configuration.yaml` 應該如下所示:

```yaml
# This is a list of video configurations
- video_url: "rtsp://example1.com/stream" # URL of the video
image_name: "cam1" # Name of the image
label: "label1" # Label of the video
model_key: "yolov8x" # Model key for the video
line_token: "token1" # Line token for notification
- video_url: "rtsp://example2.com/stream"
image_name: "cam2"
label: "label2"
model_key: "yolov8x"
line_token: "token2"
```
數組中的每個對象代表一個視頻流配置,包含以下字段:
Expand Down Expand Up @@ -57,10 +54,10 @@ docker-compose up --build
4. 要使用特定配置文件運行主應用程序,請使用以下命令:

```bash
docker-compose run main-application python main.py --config /path/in/container/configuration.json
docker-compose run main-application python main.py --config /path/in/container/configuration.yaml
```

`/path/in/container/configuration.json` 替換為容器內配置文件的實際路徑。
`/path/in/container/configuration.yaml` 替換為容器內配置文件的實際路徑。

5. 要停止服務,請使用以下命令:

Expand Down
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@

## Configuration

Before running the application, you need to configure the system by specifying the details of the video streams and other parameters in a JSON configuration file. An example configuration file `configuration.json` should look like this:

```json
[
{
"video_url": "rtsp://example1.com/stream",
"model_key": "yolov8l",
"line_token": "token1"
},
{
"video_url": "rtsp://example2.com/stream",
"model_key": "yolov8l",
"line_token": "token2"
}
]
Before running the application, you need to configure the system by specifying the details of the video streams and other parameters in a YAML configuration file. An example configuration file `configuration.yaml` should look like this:

```yaml
# This is a list of video configurations
- video_url: "rtsp://example1.com/stream" # URL of the video
image_name: "cam1" # Name of the image
label: "label1" # Label of the video
model_key: "yolov8x" # Model key for the video
line_token: "token1" # Line token for notification
- video_url: "rtsp://example2.com/stream"
image_name: "cam2"
label: "label2"
model_key: "yolov8x"
line_token: "token2"
```
Each object in the array represents a video stream configuration with the following fields:
Expand Down Expand Up @@ -60,10 +59,10 @@ docker-compose up --build
4. To run the main application with a specific configuration file, use the following command:

```bash
docker-compose run main-application python main.py --config /path/in/container/configuration.json
docker-compose run main-application python main.py --config /path/in/container/configuration.yaml
```

Replace `/path/in/container/configuration.json` with the actual path to your configuration file inside the container.
Replace `/path/in/container/configuration.yaml` with the actual path to your configuration file inside the container.

5. To stop the services, use the following command:

Expand Down

0 comments on commit b2f0abd

Please sign in to comment.