diff --git a/docs_src/use-cases/capi-yolov8-ensemble/capi-yolov8-ensemble.md b/docs_src/use-cases/capi-yolov8-ensemble/capi-yolov8-ensemble.md new file mode 100644 index 0000000..06f59cc --- /dev/null +++ b/docs_src/use-cases/capi-yolov8-ensemble/capi-yolov8-ensemble.md @@ -0,0 +1,17 @@ +# IntelĀ® C-API YOLOV8 Ensemble Object Detection Reference Package + +## Overview + +YOLOv8 is one of the popular YOLO object detection models. To show case the object detection of using YOLOv8, the efficientnet classification model will also be used to help validate the performance and accuracy of the C-API architecture. + +The YOLOv8 + efficientnet design will follow a similar custom pipeline as the previously implemented YOLOv5 + efficientnet profile. The same gstreamer decoding will be used for the input stream. C-API will send the frames to the OpenVINO Model Server(OVMS) processing through the custom pipeline defined in the config.json. OVMS will output the object bounding boxes along with the object classification. The profile will also output the processing latency in Frames Per Second (FPS). + +![yolov8 + efficientnet profile](./images/yolov8-efficientnet-profile.jpg) + +## Applicable Repos + +[retail-use-cases-gst-capi-yolov8](https://github.com/intel-retail/retail-use-cases/tree/main/use-cases/gst_capi) + +## Next Steps + +To begin using the C-API YOLOv8 ensemble Helm/Kubernetes solution you can follow the [Getting Started Guide](./getting_started.md). diff --git a/docs_src/use-cases/capi-yolov8-ensemble/getting_started.md b/docs_src/use-cases/capi-yolov8-ensemble/getting_started.md new file mode 100644 index 0000000..307355c --- /dev/null +++ b/docs_src/use-cases/capi-yolov8-ensemble/getting_started.md @@ -0,0 +1,115 @@ +# Getting Started for K8s C-API YOLOV8 + +## Instructions for Running K8s C-API YOLOv8 using minikube: + +### Presiquistes: + +- Ubuntu 22.04 + +- [minikube](https://minikube.sigs.k8s.io/docs/start/) +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/) +- [kompose](https://github.com/kubernetes/kompose?tab=readme-ov-file#binary-installation) + +### Build C-API YOLOv8 Container Image + +change directory to `use-cases/gst_capi/helm` while you are at [the retail-use-cases project base directory](https://github.com/intel-retail/retail-use-cases/): + + ```bash + cd ./use-cases/gst_capi/helm + ``` + +and then build the container image for minikube to run: + + ```bash + make minikube_build_capi_yolov8_ensemble + ``` +and you should see all of the dependencies built successfully. + +### Run C-API YOLOv8 in minikube + +Run the following command while you are still on the directory `use-cases/gst_capi/helm`: + + ```bash + make run_capi_yolov8_ensemble + ``` +and you should see all K8s pods running up. + +### Verify Pods Running + + ```bash + kubectl get pod + ``` + Result: + ```console + NAME READY STATUS RESTARTS AGE + camera-simulator-8cffdc4ff-nbcd2 1/1 Running 0 84s + camera-simulator0-65779f499-fkk7h 1/1 Running 2 (72s ago) 84s + camera-simulator1-8684b659cc-8b4lg 1/1 Running 2 (72s ago) 84s + capiyolov8ensemble-57b9ff7d6f-w5hj4 1/1 Running 0 83s + intel-gpu-plugin-kzxlh 1/1 Running 44 (66m ago) 2d19h + mqtt-broker-9b597cd94-vxprd 1/1 Running 0 83s + ``` + +### Verify Results + + After starting C-API YOLOv8 ensemble k8s deployment, you will begin to see the FPS results being published into MQTT-broker serice as it can be seen in the log file via running the command: + + ```bash + make minikube_pod_log + ``` + + ```console + ... + cid: 20241018174229464559017 + PIPELINE_PROFILE: capi_yolov8_ensemble DEVICE: CPU + DC: 0 INPUTSRC: rtsp://camera-simulator:8554/camera_1 USE_VPL: 0 RENDER_MODE: 0 RENDER_PORTRAIT_MODE: 0 + CODEC_TYPE: 1 WINDOW_WIDTH: 1280 WINDOW_HEIGHT: 720 DETECTION_THRESHOLD: 0.5 + RESULT_USE_MQTT=1 MQTT_BROKER=mqtt-broker MQTT_PORT=1883 + publish pipeline results using MQTT: mqtt-broker + _videoStreamPipeline: rtsp://camera-simulator:8554/camera_1 + _use_onevpl: 0 + _render: 0 + _renderPortrait: 0 + videoType: 1 + _window_width: 1280 + _window_height: 720 + use mqtt: 1 + mqttBroker: mqtt-broker + mqtt port = 1883 + ... + libva info: VA-API version 1.22.0 + libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so + libva info: Found init function __vaDriverInit_1_14 + libva info: va_openDriver() returns 0 + -------------------------------------------------------------- + Opening Media Pipeline: rtspsrc location=rtsp://camera-simulator:8554/camera_1 ! rtph264depay ! h264parse ! vah264dec ! video/x-raw(memory:VAMemory),format=NV12 ! vapostproc ! video/x-raw, width=416, height=416 ! videoconvert ! video/x-raw,format=RGB ! queue ! appsink drop=1 sync=0 + -------------------------------------------------------------- + ovmsCofigJsonFilePath: /app/gst-ovms/pipelines/yolov8_ensemble/config-yolov8.json + ... + Starting thread: 131360809276992 + 2 object(s) detected at 2024-10-18.17:42:53 + Avg. Pipeline Throughput FPS: 30.000000 + Avg. Pipeline Latency (ms): 58 + Max. Pipeline Latency (ms): 72 + Min. Pipeline Latency (ms): 36 + Connected to MQTT broker: tcp://mqtt-broker:1883 + publishing messages to MQTT broker: tcp://mqtt-broker:1883 + topic: capiyolov8ensemble/FPS messages: 30.000000 + waiting for up to 10 seconds for publishing... + delivered token: 1 status code = 0 + 2 object(s) detected at 2024-10-18.17:42:55 + Avg. Pipeline Throughput FPS: 20.000000 + Avg. Pipeline Latency (ms): 44 + Max. Pipeline Latency (ms): 55 + Min. Pipeline Latency (ms): 39 + publishing messages to MQTT broker: tcp://mqtt-broker:1883 + topic: capiyolov8ensemble/FPS messages: 20.000000 + waiting for up to 10 seconds for publishing... + delivered token: 2 status code = 0 + ... + ``` + +### Shutdown Running Containers + + ```bash + make down_capi_yolov8_ensemble + ``` diff --git a/docs_src/use-cases/capi-yolov8-ensemble/images/yolov8-efficientnet-profile.jpg b/docs_src/use-cases/capi-yolov8-ensemble/images/yolov8-efficientnet-profile.jpg new file mode 100644 index 0000000..15a5927 Binary files /dev/null and b/docs_src/use-cases/capi-yolov8-ensemble/images/yolov8-efficientnet-profile.jpg differ diff --git a/docs_src/use-cases/use-cases.md b/docs_src/use-cases/use-cases.md index 115b8c7..6e207c1 100644 --- a/docs_src/use-cases/use-cases.md +++ b/docs_src/use-cases/use-cases.md @@ -1,4 +1,5 @@ # Intel Retail Use Cases -[Automated Self Checkout](./automated-self-checkout/automated-self-checkout.md) -[AI Connect for Scientific Data (AiCSD)](./AiCSD/aicsd.md) \ No newline at end of file +- [Automated Self Checkout](./automated-self-checkout/automated-self-checkout.md) +- [AI Connect for Scientific Data (AiCSD)](./AiCSD/aicsd.md) +- [Retail Use Cases: C-API for YOLOV8 ensemble](./capi-yolov8-ensemble/capi-yolov8-ensemble.md)