-
Notifications
You must be signed in to change notification settings - Fork 72
Vsblty vision captor and data captor app #83
base: master
Are you sure you want to change the base?
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: ai-pipeline | ||
description: A Helm chart for vsblty ai pipeline(data captor application) | ||
type: application | ||
version: 0.1.0 | ||
appVersion: 1.16.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#data-captor is the vision captor helm chart with data-captor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no proper details about pre-requisites and details about OpenNESS or Smart edge Open version used for this application? |
||
#Before deploying the application we require k3s to be installed on the machine where we want to deploy charts. | ||
|
||
#On the host machine we need to create 3 folders as below and need to place data into it(VSBLTY need to provide data for models & gallery while other folders can be kept empty) | ||
|
||
1.mkdir -p /home/vedge/models | ||
2.mkdir -p /home/vedge/gallery | ||
3.mkdir -p /home/vedge/videos | ||
|
||
|
||
#In values.yaml file of data-captor chart we have couple of things to be filled before deployment. | ||
1.device.accessToken : It'll be generated when the camera will be registered to vsblty portal (manually) and that need to copy in values.yaml file.(VSBLTY can give before deployment). | ||
|
||
2. camera.rtsp : It's the camera rtsp stream url. | ||
|
||
|
||
|
||
#Once we have all the above things set up we can deploy by following command. | ||
|
||
helm install data-captor data-captor/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
Expand the name of the chart. | ||
*/}} | ||
{{- define "ai-pipeline.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "ai-pipeline.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "ai-pipeline.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "ai-pipeline.labels" -}} | ||
helm.sh/chart: {{ include "ai-pipeline.chart" . }} | ||
{{ include "ai-pipeline.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "ai-pipeline.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "ai-pipeline.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "ai-pipeline.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "ai-pipeline.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
apiVersion: v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
kind: ConfigMap | ||
metadata: | ||
name: config-json-volume | ||
data: | ||
config.json: |- | ||
{ | ||
"default": { | ||
"logLevel": "INFO", | ||
"pipeline": { | ||
"template": [ | ||
"rtspsrc location={input} ! rtph264depay ! queue ! avdec_h264 ! videoconvert ! video/x-raw,format=BGRx !", | ||
"gvadetect model={personDetection[model]} threshold=0.8 model_proc={personDetection[proc]} device={personDetection[device]} ! queue !", | ||
"gvadetect model={faceDetection[model]} threshold=0.8 reshape=true reshape-width=600 reshape-height=600 model-proc={faceDetection[proc]} device={faceDetection[device]} ! gvatrack ! queue !", | ||
"gvaclassify reclassify-interval=5 model={landmark[model]} model-proc={landmark[proc]} device={landmark[device]} batch-size=1 pre-process-backend=opencv object-class=face ! queue !", | ||
"gvaclassify reclassify-interval=5 model={faceReidentification[model]} model-proc={faceReidentification[proc]} device={faceReidentification[device]} batch-size=1 pre-process-backend=opencv object-class=face ! queue !", | ||
"gvaidentify cosine-distance-threshold={reidThreshold} gallery=/home/vedge/gallery/gallery.json ! queue name=frame-process !", | ||
"videoconvert ! video/x-raw,format=NV12 ! fpsdisplaysink" | ||
], | ||
"params": { | ||
"reidThreshold": 0.6, | ||
"faceDetection": { | ||
"model": "/home/vedge/models/face-detection-adas-0001/FP32/face-detection-adas-0001.xml", | ||
"proc": "/home/vedge/models/face-detection-adas-0001/PROC/face-detection-adas-0001.json", | ||
"device": "CPU" | ||
}, | ||
"personDetection": { | ||
"model": "/home/vedge/models/person-detection-0201/FP32/person-detection-0201.xml", | ||
"proc": "/home/vedge/models/person-detection-0201/PROC/person-detection-0201.json", | ||
"device": "CPU" | ||
}, | ||
"landmark": { | ||
"model": "/home/vedge/models/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml", | ||
"proc": "/home/vedge/models/landmarks-regression-retail-0009/PROC/landmarks-regression-retail-0009.json", | ||
"device": "CPU" | ||
}, | ||
"faceReidentification": { | ||
"model": "/home/vedge/models/face-reidentification-retail-0095/FP32/face-reidentification-retail-0095.xml", | ||
"proc": "/home/vedge/models/face-reidentification-retail-0095/PROC/face-reidentification-retail-0095.json", | ||
"device": "CPU" | ||
} | ||
} | ||
} | ||
}, | ||
"cameras": { | ||
"camerap-1": { | ||
"logLevel": "DEBUG", | ||
"cloudCredential": "{{ .Values.device.accessToken }}", | ||
"cloudEnv": "DEV", | ||
"pipeline": { | ||
"params": { | ||
"input": "{{ .Values.camera.rtsp }}" | ||
} | ||
}, | ||
"services": [ | ||
{ | ||
"type": "face-recognition", | ||
"pipelineElement": "frame-process", | ||
"objectType": "face", | ||
"outputImageSize": [ | ||
240, | ||
180 | ||
], | ||
"trackedFaceDuration": 10 | ||
} | ||
] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
apiVersion: apps/v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
kind: Deployment | ||
metadata: | ||
name: {{ include "ai-pipeline.fullname" . }} | ||
labels: | ||
{{- include "ai-pipeline.labels" . | nindent 4 }} | ||
spec: | ||
{{- if not .Values.autoscaling.enabled }} | ||
replicas: {{ .Values.replicaCount }} | ||
{{- end }} | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
{{- include "ai-pipeline.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "ai-pipeline.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "ai-pipeline.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
volumes: | ||
- name: config-map-volume | ||
configMap: | ||
name: config-json-volume | ||
- name: gallery-map-volume | ||
hostPath: | ||
path: /home/vedge/gallery | ||
type: Directory | ||
- name: media-map-volume | ||
hostPath: | ||
path: /home/vedge/videos | ||
type: Directory | ||
- name: models-volume | ||
hostPath: | ||
path: /home/vedge/models | ||
type: Directory | ||
- name: x11-vol | ||
hostPath: | ||
path: /tmp | ||
type: Directory | ||
- name: var-temp | ||
hostPath: | ||
path: /var/tmp | ||
type: Directory | ||
- name: var-dev | ||
hostPath: | ||
path: /dev | ||
type: Directory | ||
hostNetwork: true | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
command: | ||
- python3 | ||
- /home/vedge/ai-pipeline/main.py | ||
- -c | ||
- /home/vedge/config/config.json | ||
- -id | ||
- camerap-1 | ||
env: | ||
- name: DISPLAY | ||
value: "{{ .Values.display.displayName }}" | ||
- name: PYTHONUNBUFFERED | ||
value: "{{ .Values.display.pythonVar }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
volumeMounts: | ||
- mountPath: /home/vedge/config | ||
name: config-map-volume | ||
- mountPath: /home/vedge/gallery | ||
name: gallery-map-volume | ||
- mountPath: /home/vedge/videos | ||
name: media-map-volume | ||
- mountPath: /home/vedge/models | ||
name: models-volume | ||
- mountPath: /tmp | ||
name: x11-vol | ||
- mountPath: /var/tmp | ||
name: var-temp | ||
- mountPath: /dev | ||
name: var-dev | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.autoscaling.enabled }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
apiVersion: autoscaling/v2beta1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ include "ai-pipeline.fullname" . }} | ||
labels: | ||
{{- include "ai-pipeline.labels" . | nindent 4 }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ include "ai-pipeline.fullname" . }} | ||
minReplicas: {{ .Values.autoscaling.minReplicas }} | ||
maxReplicas: {{ .Values.autoscaling.maxReplicas }} | ||
metrics: | ||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
{{- end }} | ||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: memory | ||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "ai-pipeline.serviceAccountName" . }} | ||
labels: | ||
{{- include "ai-pipeline.labels" . | nindent 4 }} | ||
{{- with .Values.serviceAccount.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
replicaCount: 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
|
||
image: | ||
repository: vsblty.azurecr.io/vedge/ai-pipeline | ||
pullPolicy: IfNotPresent | ||
tag: "1.2.75" | ||
|
||
device: | ||
accessToken: "" | ||
|
||
camera: | ||
rtsp: "" | ||
|
||
imagePullSecrets: [name: regcred] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
display: | ||
displayName: unix:0 | ||
pythonVar: 1 | ||
|
||
serviceAccount: | ||
create: true | ||
annotations: {} | ||
name: "" | ||
|
||
podAnnotations: {} | ||
|
||
podSecurityContext: {} | ||
|
||
securityContext: | ||
privileged: true | ||
|
||
resources: {} | ||
|
||
autoscaling: | ||
enabled: false | ||
minReplicas: 1 | ||
maxReplicas: 100 | ||
targetCPUUtilizationPercentage: 80 | ||
targetMemoryUtilizationPercentage: 80 | ||
|
||
nodeSelector: {} | ||
|
||
tolerations: [] | ||
|
||
affinity: {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. License and Copyright headers are missing. |
||
name: vc-app | ||
description: A Helm chart for Vsblty Vision Captor application | ||
|
||
type: application | ||
|
||
version: 0.1.0 | ||
|
||
appVersion: "1.16.0" | ||
|
||
dependencies: | ||
- name: ai-pipeline | ||
condition: ai-pipeline.enabled | ||
- name: vclite | ||
condition: vclite.enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License and Copyright headers are missing.