How to use an AI Model and Video File of your own#
For docker compose based deployment#
You can bring your own model and run this sample application the same way as how we bring in the pallet defect detection model. You can also bring your own video file source. Please see below for details:
The pallet defect detection model is placed as below in the repository under
models
. You can also find the input video file source for inference undervideos
.
resources/
models/
geti/
pallet_defect_detection/
deployment/
Detection/
model/
model.bin
model.xml
videos/
warehouse.avi
Note
You can organize the directory structure for models for different use cases.
The
resources
folder containing both the model and video file is volume mounted into EVAM indocker-compose.yml
(present in the repository) file as follows:volumes: - ./resources/:/home/pipeline-server/resources/
Since this is a detection model, ensure to use gvadetect in the pipeline. For example: See the
pallet_defect_detection
pipeline inevam_config.json
(present in the repository) where gvadetect is used.The
evam_config.json
is volume mounted into EVAM indocker-compose.yml
as follows:volumes: - ./configs/evam_config.json:/home/pipeline-server/config.json
Provide the model path and video file path in the REST/curl command for starting an inferencing workload. Example:
curl http://<HOST_IP>:8080/pipelines/user_defined_pipelines/pallet_defect_detection -X POST -H 'Content-Type: application/json' -d '{ "source": { "uri": "file:///home/pipeline-server/resources/videos/warehouse.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "samplestream" } }, "parameters": { "detection-properties": { "model": "/home/pipeline-server/resources/models/geti/pallet_defect_detection/deployment/Detection/model/model.xml", "device": "CPU" } } }'
For helm chart based deployment#
You can bring your own model and run this sample application the same way as how we bring in the pallet defect detection model as follows:
The pallet defect detection model is placed as below in the repository under
models
. You can also find the input video file source for inference undervideos
.
resources/
models/
geti/
pallet_defect_detection/
deployment/
Detection/
model/
model.bin
model.xml
videos/
warehouse.avi
Note
You can organize the directory structure for models for different use cases.
Build EVAM by including your new AI model (pallet defect detection model used here as an example) and video file. Example steps below:
Create the below
Dockerfile
at the root of the repositoryFROM intel/edge-video-analytics-microservice:2.4.0 # Copy the application files COPY ./resources/models/geti /home/pipeline-server/resources/models/geti COPY ./resources/videos/warehouse.avi /home/pipeline-server/resources/videos/warehouse.avi # Define the command to run the application ENTRYPOINT ["./run.sh"]
Build a new EVAM image with the below command from the root of the repository
docker build -t intel/edge-video-analytics-microservice:2.4.0 .
Please update
imagePullPolicy
asimagePullPolicy: IfNotPresent
invalues.yaml
in order to use the above built image.
Since this is a detection model, ensure to use gvadetect in the pipeline. For example: See the
pallet_defect_detection
pipeline inevam_config.json
(present in the repository) where gvadetect is used.The
evam_config.json
is volume mounted into EVAM inprovision-configmap.yaml
as follows:apiVersion: v1 kind: ConfigMap metadata: namespace: {{ .Values.namespace }} name: evam-config-input data: config.json: |- {{ .Files.Get "evam_config.json" | indent 4 }}
Provide the model path and video file path in the REST/curl command for starting an inferencing workload. Example:
curl http://<HOST_IP>:30107/pipelines/user_defined_pipelines/pallet_defect_detection -X POST -H 'Content-Type: application/json' -d '{ "source": { "uri": "file:///home/pipeline-server/resources/videos/warehouse.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "samplestream" } }, "parameters": { "detection-properties": { "model": "/home/pipeline-server/resources/models/geti/pallet_defect_detection/deployment/Detection/model/model.xml", "device": "CPU" } } }'