Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering issue of example doc in readthedocs #153

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions examples/incremental_learning/helmet_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -83,7 +84,7 @@ spec:
EOF
```

Create Deploy Model
Create Deploy Model

```
kubectl create -f - <<EOF
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions examples/storage/s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -173,4 +176,4 @@ spec:
type: Directory
outputDir: "/incremental_learning/output"
EOF
```
```