Browse Source

fix il doc

Signed-off-by: JimmyYang20 <yangjin39@huawei.com>
tags/v0.3.1
JimmyYang20 4 years ago
parent
commit
c46697e87d
2 changed files with 32 additions and 26 deletions
  1. +23
    -20
      examples/incremental_learning/helmet_detection/README.md
  2. +9
    -6
      examples/storage/s3/README.md

+ 23
- 20
examples/incremental_learning/helmet_detection/README.md View File

@@ -12,49 +12,50 @@ and updates models based on the data generated at the edge.
Follow the [Sedna installation document](/docs/setup/install.md) to install Sedna.

### Prepare Model
In this example, we need to prepare base model and deploy model in advance.
In this example, we need to prepare base model and deploy model in advance.
download [models](https://kubeedge.obs.cn-north-1.myhuaweicloud.com/examples/helmet-detection/model.tar.gz), including base model and deploy model.



download [models](https://kubeedge.obs.cn-north-1.myhuaweicloud.com/examples/helmet-detection/model.tar.gz), including base model and deploy model.
```
cd /
wget https://kubeedge.obs.cn-north-1.myhuaweicloud.com/examples/helmet-detection/models.tar.gz
tar -zxvf models.tar.gz
```
### Prepare for Inference Worker
in this example, we simulate a inference worker for helmet detection, the worker will upload hard examples to `HE_SAVED_URL`, while
it inferences data from local video. we need to make following preparations:
* make sure following localdirs exist
in this example, we simulate a inference worker for helmet detection, the worker will upload hard examples to `HE_SAVED_URL`, while
it inferences data from local video. we need to make following preparations:

* make sure following localdirs exist
```
mkdir -p /incremental_learning/video/
mkdir -p /incremental_learning/he/
mkdir -p /data/helmet_detection
mkdir /output

```
* download [video](https://kubeedge.obs.cn-north-1.myhuaweicloud.com/examples/helmet-detection/video.tar.gz), unzip video.tar.gz, and put it into `/incremental_learning/video/`

* download [video](https://kubeedge.obs.cn-north-1.myhuaweicloud.com/examples/helmet-detection/video.tar.gz), unzip video.tar.gz, and put it into `/incremental_learning/video/`

```
cd /incremental_learning/video/
wget https://kubeedge.obs.cn-north-1.myhuaweicloud.com/examples/helmet-detection/video.tar.gz
tar -zxvf video.tar.gz
```

### Prepare Image
this example use the image:
```
kubeedge/sedna-example-incremental-learning-helmet-detection:v0.3.0
```
This image is generated by the script [build_images.sh](/examples/build_image.sh), used for creating training, eval and inference worker.

### Create Incremental Job
in this example, `$WORKER_NODE` is a custom node, you can fill it which you actually run.
This image is generated by the script [build_images.sh](/examples/build_image.sh), used for creating training, eval and inference worker.

### Create Incremental Job
in this example, `$WORKER_NODE` is a custom node, you can fill it which you actually run.

```
WORKER_NODE="edge-node"
```
Create Dataset

Create Dataset

```
kubectl create -f - <<EOF
@@ -69,7 +70,7 @@ spec:
EOF
```

Create Initial Model to simulate the initial model in incremental learning scenario.
Create Initial Model to simulate the initial model in incremental learning scenario.

```
kubectl create -f - <<EOF
@@ -83,7 +84,7 @@ spec:
EOF
```

Create Deploy Model
Create Deploy Model

```
kubectl create -f - <<EOF
@@ -97,10 +98,9 @@ spec:
EOF
```

Start The Incremental Learning Job
Start The Incremental Learning Job

```

kubectl create -f - <<EOF
apiVersion: sedna.io/v1alpha1
kind: IncrementalLearningJob
@@ -207,16 +207,19 @@ spec:
outputDir: "/output"
EOF
```

1. The `Dataset` describes data with labels and `HE_SAVED_URL` indicates the address of the deploy container for uploading hard examples. Users will mark label for the hard examples in the address.
2. Ensure that the path of outputDir in the YAML file exists on your node. This path will be directly mounted to the container.


### Check Incremental Learning Job
query the service status
query the service status

```
kubectl get incrementallearningjob helmet-detection-demo
```
In the `IncrementalLearningJob` resource helmet-detection-demo, the following trigger is configured:

In the `IncrementalLearningJob` resource helmet-detection-demo, the following trigger is configured:

```
trigger:
checkPeriodSeconds: 60


+ 9
- 6
examples/storage/s3/README.md View File

@@ -3,6 +3,7 @@
This example based on the example: [Using Incremental Learning Job in Helmet Detection Scenario](/examples/incremental_learning/helmet_detection/README.md)
### Create a secret with your S3 user credential.
```yaml
apiVersion: v1
kind: Secret
@@ -15,15 +16,17 @@ stringData: # use `stringData` for raw credential string or `data` for base64 en
ACCESS_KEY_ID: XXXX
SECRET_ACCESS_KEY: XXXXXXXX
```
### Attach the created secret to the Model/Dataset/Job.
`EDGE_NODE` and `CLOUD_NODE` are custom nodes, you can fill it which you actually run.
`EDGE_NODE` and `CLOUD_NODE` are custom nodes, you can fill it which you actually run.
```
EDGE_NODE="edge-node"
CLOUD_NODE="cloud-node"
```
* Attach the created secret to the Model.
* Attach the created secret to the Model.
```yaml
kubectl create -f - <<EOF
apiVersion: sedna.io/v1alpha1
@@ -50,8 +53,8 @@ spec:
EO
```
* Attach the created secret to the Dataset.
* Attach the created secret to the Dataset.
```yaml
kubectl $action -f - <<EOF
apiVersion: sedna.io/v1alpha1
@@ -173,4 +176,4 @@ spec:
type: Directory
outputDir: "/incremental_learning/output"
EOF
```
```

Loading…
Cancel
Save