diff --git a/docker/fedora41/fedora41.Dockerfile b/docker/fedora41/fedora41.Dockerfile index 9640f8ab..71537579 100644 --- a/docker/fedora41/fedora41.Dockerfile +++ b/docker/fedora41/fedora41.Dockerfile @@ -67,7 +67,7 @@ RUN \ python3-gobject-devel python3-devel tbb gnupg2 unzip gflags-devel openssl-devel openssl-devel-engine \ gobject-introspection-devel x265-devel x264-devel libde265-devel libgudev-devel libusb1 libusb1-devel nasm python3-virtualenv \ cairo-devel cairo-gobject-devel libXt-devel mesa-libGLES-devel wayland-protocols-devel libcurl-devel which \ - libssh2-devel cmake git valgrind numactl libvpx-devel opus-devel libsrtp-devel libXv-devel paho-c-devel \ + libssh2-devel cmake git valgrind numactl libvpx-devel opus-devel libsrtp-devel libXv-devel paho-c-devel ocl-icd-devel \ kernel-headers pmix pmix-devel hwloc hwloc-libs hwloc-devel libxcb-devel libX11-devel libatomic intel-media-driver libsoup3 && \ dnf clean all diff --git a/docs/source/dev_guide/download_public_models.md b/docs/source/dev_guide/download_public_models.md index b0dc6409..7fed2a7c 100644 --- a/docs/source/dev_guide/download_public_models.md +++ b/docs/source/dev_guide/download_public_models.md @@ -20,6 +20,20 @@ export MODELS_PATH=/path/to/models You can refer to the list of [supported models](https://github.com/open-edge-platform/dlstreamer/blob/master/samples/download_public_models.sh#L23). +## Download All Models + +To download all supported models (FP32 and FP16), run the script without any parameters: + +```bash +./samples/download_public_models.sh +``` + +> **NOTE:** This will download all YOLO models, CenterFace, HSEmotion, Deeplabv3, +> and other supported models. This may take a significant amount of time and disk space. + +## Download a Specific Model + +To download a specific model, pass the model name as the first parameter. For example, to download the YOLOv11s model, use: ```bash diff --git a/samples/models/convert_mars_deepsort.py b/samples/models/convert_mars_deepsort.py index 3f5c0138..5c085107 100755 --- a/samples/models/convert_mars_deepsort.py +++ b/samples/models/convert_mars_deepsort.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # ============================================================================== -# Copyright (C) 2021-2025 Intel Corporation +# Copyright (C) 2021-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -39,7 +39,7 @@ def download_model_py(): """Download official model.py from deep_sort_pytorch repository.""" model_py_url = 'https://raw.githubusercontent.com/ZQPei/deep_sort_pytorch/master/deep_sort/deep/model.py' model_py_path = Path(__file__).parent / 'model.py' - + logger.info(f"📥 Downloading model.py from deep_sort_pytorch repository...") try: urllib.request.urlretrieve(model_py_url, model_py_path) @@ -59,11 +59,11 @@ def download_model_py(): class NetOriginal(torch.nn.Module): """ Original Mars-Small128 Model Architecture - + Compatible with original_ckpt.t7 (11MB, 625 classes) Uses 32→64→128 channel progression with dense layers """ - + def __init__(self, num_classes=625, reid=False): super(NetOriginal, self).__init__() # Smaller architecture starting with 32 channels @@ -80,7 +80,7 @@ def __init__(self, num_classes=625, reid=False): self.layer1 = make_layers(32, 32, 2, False) self.layer2 = make_layers(32, 64, 2, True) self.layer3 = make_layers(64, 128, 2, True) - + # Dense layers (using indices 1,2 to match checkpoint) self.dense = torch.nn.Sequential( torch.nn.Dropout(p=0), # dense.0 (placeholder) @@ -93,7 +93,7 @@ def __init__(self, num_classes=625, reid=False): self.classifier = torch.nn.Sequential( torch.nn.Linear(128, num_classes), ) - + def forward(self, x): x = self.conv(x) x = self.layer1(x) @@ -113,89 +113,89 @@ def forward(self, x): class MarsDeepSORTConverter: """Converter for Mars-Small128 DeepSORT models to OpenVINO IR format.""" - + CHECKPOINT_ORG_URL = 'https://drive.google.com/uc?id=1lfCXBm5ltH-6CjJ1a5rqiZoWgGmRsZSY' # original_ckpt.t7 (~11 MB) - Original arch (32→64→128, 625 classes) - + def __init__(self, output_dir: str = "./mars_deepsort_models"): self.output_dir = Path(output_dir) self.output_dir.mkdir(parents=True, exist_ok=True) self.input_shape = (1, 3, 128, 64) # NCHW: batch, channels, height, width - + def download_checkpoint(self) -> Path: """Download pretrained checkpoint from Google Drive.""" checkpoint_filename = 'original_ckpt.t7' checkpoint_url = self.CHECKPOINT_ORG_URL logger.info("📦 Downloading ORIGINAL checkpoint (11 MB, 32→64→128 channels, 625 classes)") - + checkpoint_path = self.output_dir / checkpoint_filename - + logger.info(f"📥 Downloading checkpoint from Google Drive...") try: urllib.request.urlretrieve(checkpoint_url, checkpoint_path) except Exception as e: logger.error(f"❌ Failed to download checkpoint: {e}") sys.exit(1) - + size_mb = checkpoint_path.stat().st_size / (1024 * 1024) logger.info(f"✅ Downloaded checkpoint: {size_mb:.2f} MB") - + return checkpoint_path - + def load_model(self, checkpoint_path: Path) -> torch.nn.Module: """Load model from checkpoint in reid (feature extraction) mode.""" logger.info("🏗️ Loading DeepSORT model in reid mode...") logger.info("📐 Using NetOriginal architecture (32→64→128 channels, 625 classes)") - + model = NetOriginal(reid=True) - + # Load checkpoint checkpoint = torch.load(checkpoint_path, map_location='cpu', weights_only=False) - + if 'net_dict' in checkpoint: model.load_state_dict(checkpoint['net_dict']) logger.info(f"📊 Checkpoint accuracy: {checkpoint.get('acc', 'N/A')}") logger.info(f"🔄 Training epoch: {checkpoint.get('epoch', 'N/A')}") else: model.load_state_dict(checkpoint) - + model.eval() logger.info("✅ Model loaded successfully") - + return model - + def convert_to_fp32(self, model: torch.nn.Module, output_name: str = "mars_small128_fp32") -> Path: """Convert PyTorch model to OpenVINO FP32 format.""" logger.info("🔄 Converting to OpenVINO FP32...") - + example_input = torch.randn(self.input_shape) output_path = self.output_dir / f"{output_name}.xml" - + # Convert to OpenVINO ov_model = ov.convert_model( model, example_input=example_input, input=[("x", self.input_shape)] ) - + # Ensure static shape ov_model.reshape({"x": self.input_shape}) - + # Save model ov.save_model(ov_model, str(output_path)) - + logger.info(f"✅ FP32 model saved: {output_path}") self._verify_model(output_path) - + return output_path - - def convert_to_int8(self, model: torch.nn.Module, output_name: str = "mars_small128_int8", + + def convert_to_int8(self, model: torch.nn.Module, output_name: str = "mars_small128_int8", calibration_size: int = 200) -> Path: """Convert PyTorch model to OpenVINO INT8 format with NNCF quantization.""" logger.info("🔄 Converting to OpenVINO INT8 with NNCF quantization...") - + example_input = torch.randn(self.input_shape) output_path = self.output_dir / f"{output_name}.xml" - + # Convert to OpenVINO FP32 first ov_model = ov.convert_model( model, @@ -203,15 +203,15 @@ def convert_to_int8(self, model: torch.nn.Module, output_name: str = "mars_small input=[("x", self.input_shape)] ) ov_model.reshape({"x": self.input_shape}) - + # Generate calibration data logger.info(f"📊 Generating {calibration_size} calibration samples...") calibration_data = self._generate_calibration_data(calibration_size) - + def calibration_dataset(): for data in calibration_data: yield data - + # Apply INT8 quantization calibration_dataset_nncf = nncf.Dataset(calibration_dataset()) quantized_model = nncf.quantize( @@ -219,45 +219,45 @@ def calibration_dataset(): calibration_dataset_nncf, subset_size=min(calibration_size, 100) ) - + # Save quantized model ov.save_model(quantized_model, str(output_path)) - + logger.info(f"✅ INT8 model saved: {output_path}") self._verify_model(output_path) - + return output_path - + def _generate_calibration_data(self, num_samples: int) -> list: """Generate synthetic person images for INT8 calibration.""" calibration_data = [] - + for i in range(num_samples): # Create synthetic person-like image image = np.random.randn(1, 3, 128, 64).astype(np.float32) * 0.2 + 0.5 image = np.clip(image, 0.0, 1.0) calibration_data.append(image) - + if (i + 1) % 50 == 0: logger.info(f" Generated {i + 1}/{num_samples} calibration samples") - + return calibration_data - + def _verify_model(self, model_path: Path): """Verify OpenVINO model can be loaded and inferred.""" core = ov.Core() model = core.read_model(model_path) compiled = core.compile_model(model, "CPU") - + # Test inference test_input = np.random.randn(*self.input_shape).astype(np.float32) output = compiled([test_input])[0] - + logger.info(f" 📏 Input shape: {test_input.shape}") logger.info(f" 📏 Output shape: {output.shape}") logger.info(f" 📏 Output dimensions: {output.shape[-1]}") logger.info(f" 📏 L2 norm: {np.linalg.norm(output):.6f}") - + if output.shape[-1] != 128: logger.warning(f"⚠️ Expected 128-dim output, got {output.shape[-1]}") @@ -285,32 +285,32 @@ def main(): default=200, help="Number of calibration samples for INT8 (default: 200)" ) - + args = parser.parse_args() - + try: logger.info("=" * 60) logger.info("MARS-SMALL 128DIM DEEPSORT TO OPENVINO CONVERTER") logger.info("=" * 60) logger.info(f"Output directory: {args.output_dir}") logger.info(f"Target precision: {args.precision}") - + # Initialize converter converter = MarsDeepSORTConverter(args.output_dir) - + # Download checkpoint checkpoint_path = converter.download_checkpoint() - + # Load model model = converter.load_model(checkpoint_path) - + # Convert to requested precision(s) if args.precision in ["fp32", "both"]: converter.convert_to_fp32(model) - + if args.precision in ["int8", "both"]: converter.convert_to_int8(model, calibration_size=args.calibration_size) - + logger.info("=" * 60) logger.info("✅ CONVERSION COMPLETED SUCCESSFULLY!") logger.info("=" * 60) @@ -318,13 +318,26 @@ def main(): logger.info(f"📏 Input shape: (1, 3, 128, 64) - NCHW") logger.info(f"📏 Output: 128-dimensional L2-normalized feature vector") logger.info(f"🎯 Optimized for DeepSORT person re-identification") - + + # Clean up downloaded model.py + model_py_path = Path(__file__).parent / 'model.py' + if model_py_path.exists(): + model_py_path.unlink() + logger.info("🧹 Cleaned up temporary model.py file") + except Exception as e: logger.error(f"❌ Conversion failed: {e}") import traceback traceback.print_exc() + + # Clean up on failure too + model_py_path = Path(__file__).parent / 'model.py' + if model_py_path.exists(): + model_py_path.unlink() + logger.info("🧹 Cleaned up temporary model.py file") + return 1 - + return 0 diff --git a/samples/windows/README.md b/samples/windows/README.md new file mode 100644 index 00000000..6408a693 --- /dev/null +++ b/samples/windows/README.md @@ -0,0 +1,22 @@ +# Windows Samples + +This folder contains Windows-specific samples and scripts for Deep Learning Streamer (DL Streamer). + +## Requirements + +- Python 3.12 or Python 3.11 (Python 3.13 is not yet supported by openvino-dev) +- pip install openvino-dev[onnx] + +## Download Models + +Before running samples, download the required models by running: + +```batch +set MODELS_PATH=C:\path\to\models +download_omz_models.bat +``` + +## Notes + +- These samples are specifically designed for Windows systems +- Linux equivalents of these samples can be found in the main `samples/gstreamer` folder diff --git a/samples/download_omz_models.bat b/samples/windows/download_omz_models.bat similarity index 77% rename from samples/download_omz_models.bat rename to samples/windows/download_omz_models.bat index 5a2562f2..24aa1395 100644 --- a/samples/download_omz_models.bat +++ b/samples/windows/download_omz_models.bat @@ -22,5 +22,5 @@ if ERRORLEVEL 1 ( ) mkdir "%MODELS_PATH%" -omz_downloader --list "%~dp0\models_omz_samples.lst" -o "%MODELS_PATH%" -omz_converter --list "%~dp0\models_omz_samples.lst" -o "%MODELS_PATH%" -d "%MODELS_PATH%" +omz_downloader --list "%~dp0..\models_omz_samples.lst" -o "%MODELS_PATH%" +omz_converter --list "%~dp0..\models_omz_samples.lst" -o "%MODELS_PATH%" -d "%MODELS_PATH%" diff --git a/samples/windows/gstreamer/README.md b/samples/windows/gstreamer/README.md new file mode 100644 index 00000000..b9ab5e4b --- /dev/null +++ b/samples/windows/gstreamer/README.md @@ -0,0 +1,43 @@ +# Deep Learning Streamer (DL Streamer) Samples (Windows) + +Samples are simple applications that demonstrate how to use the Intel® DL Streamer on Windows systems. + +## Available Samples + +Samples separated into several categories +1. gst_launch command-line samples (samples construct GStreamer pipeline via [gst-launch-1.0](https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html) command-line utility) + * [Face Detection And Classification Sample](./gst_launch/face_detection_and_classification/README.md) - constructs object detection and classification pipeline example with [gvadetect](https://dlstreamer.github.io/elements/gvadetect.html) and [gvaclassify](https://dlstreamer.github.io/elements/gvaclassify.html) elements to detect faces and estimate age, gender, emotions and landmark points + * [Audio Event Detection Sample](./gst_launch/audio_detect/README.md) - constructs audio event detection pipeline example with [gvaaudiodetect](https://dlstreamer.github.io/elements/gvaaudiodetect.html) element and uses [gvametaconvert](https://dlstreamer.github.io/elements/gvametaconvert.html), [gvametapublish](https://dlstreamer.github.io/elements/gvametapublish.html) elements to convert audio event metadata with inference results into JSON format and to print on standard out + * [Detection with Yolo](./gst_launch/detection_with_yolo/README.md) - demonstrates how to use publicly available YOLO models for object detection with/without hardware acceleration +2. Benchmark + * [Benchmark Sample](./benchmark/README.md) - measures overall performance of single-channel or multi-channel video analytics pipelines + +## How To Build And Run + +Samples provide `.bat` script for constructing and executing gst-launch command line on Windows. + +## DL Models + +DL Streamer samples use pre-trained models from OpenVINO™ Toolkit [Open Model Zoo](https://github.com/openvinotoolkit/open_model_zoo) + +Before running samples, run script `download_omz_models.bat` once to download all models required for samples. The script located in `samples\windows` folder. +> **NOTE**: To install all necessary requirements for `download_omz_models.bat` script run this command: +```batch +python -m pip install --upgrade pip +python -m pip install openvino-dev[onnx] +``` + +## Input video + +First command-line parameter in DL Streamer samples specifies input video and supports +* local video file (`C:\path\to\video.mp4`) +* web camera device (Windows USB camera path format, uses `ksvideosrc` element) +* RTSP camera (URL starting with `rtsp://`) or other streaming source (ex URL starting with `http://`) + +If command-line parameter not specified, most samples by default stream video example from predefined HTTPS link, so require internet connection. + +> **NOTE**: Most samples set property `sync=false` in video sink element to disable real-time synchronization and run pipeline as fast as possible. Change to `sync=true` to run pipeline with real-time speed. + +## See also +* [Windows Samples overview](../README.md) +* [Linux GStreamer Samples](../../gstreamer/README.md) diff --git a/samples/windows/gstreamer/benchmark/README.md b/samples/windows/gstreamer/benchmark/README.md new file mode 100644 index 00000000..bef61881 --- /dev/null +++ b/samples/windows/gstreamer/benchmark/README.md @@ -0,0 +1,60 @@ +# Benchmark Sample (Windows) + +Sample `benchmark.bat` demonstrates [gvafpscounter](../../../../docs/source/elements/gvafpscounter.md) element used to measure overall performance of video analytics pipelines on Windows. + +The sample outputs last and average FPS (Frames Per Second) every second and overall FPS on exit. + +## How It Works +The sample builds GStreamer pipeline containing video decode, inference and other IO elements, or multiple (N) identical pipelines if number of channels parameter is set to N>1. + +The `gvafpscounter` inserted at the end of each stream pipeline and measures FPS across all streams. + +The command-line parameters allow to select inference device (ex, CPU, GPU). + +> **NOTE**: Before running samples (including this one), run script `download_omz_models.bat` once (the script located in `samples\windows` folder) to download all models required for this and other samples. + +## Environment Variables + +This sample requires the following environment variable to be set: +- `MODELS_PATH`: Path to the models directory + +Example: +```batch +set MODELS_PATH=C:\models +``` + +## Input video + +You can download video file example by opening this URL in your browser: +``` +https://raw.githubusercontent.com/intel-iot-devkit/sample-videos/master/head-pose-face-detection-female-and-male.mp4 +``` +or use any other media/video file. + +## Running + +```batch +benchmark.bat VIDEO_FILE [INFERENCE_DEVICE] [CHANNELS_COUNT] +``` + +The sample takes one to three command-line parameters: +1. **VIDEO_FILE** (required) - path to input video file +2. **INFERENCE_DEVICE** (optional) - device for inference, could be any device supported by OpenVINO™ toolkit + * CPU (Default) + * GPU +3. **CHANNELS_COUNT** (optional) - number of simultaneous streams to benchmark (default: 1) + +### Example +```batch +benchmark.bat C:\videos\head-pose-face-detection-female-and-male.mp4 CPU 4 +``` + +## Sample Output + +The sample +* prints gst-launch command line into console +* reports FPS every second and average FPS on exit + +## See also +* [Windows Samples overview](../../README.md) +* [Linux Benchmark Samples](../../../../gstreamer/benchmark/README.md) diff --git a/samples/gstreamer/benchmark/benchmark.bat b/samples/windows/gstreamer/benchmark/benchmark.bat similarity index 100% rename from samples/gstreamer/benchmark/benchmark.bat rename to samples/windows/gstreamer/benchmark/benchmark.bat diff --git a/samples/windows/gstreamer/gst_launch/audio_detect/README.md b/samples/windows/gstreamer/gst_launch/audio_detect/README.md new file mode 100644 index 00000000..8e98616e --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/audio_detect/README.md @@ -0,0 +1,77 @@ +# Audio Detection Sample (Windows) + +This sample demonstrates how to construct an audio event detection pipeline using `gst-launch-1.0` command-line utility on Windows. + +## How It Works +`gst-launch-1.0` is a command-line utility included with the popular GStreamer media framework. It makes the construction and execution of media pipelines easy based on a simple and intuitive string format. Pipelines are represented as strings containing the names of GStreamer elements separated by exclamation marks `!`. Users can specify properties of an element using `property`=`value` pairs after an element name and before the next exclamation mark. + +This sample builds a GStreamer pipeline using the following elements +* `filesrc` or `urisourcebin` +* `decodebin3` for audio decoding +* `audioresample`, `audioconvert` and `audiomixer` for converting and resizing audio input +* [gvaaudiodetect](../../../../../docs/source/elements/gvaaudiodetect.md) for audio event detection using ACLNet +* [gvametaconvert](../../../../../docs/source/elements/gvametaconvert.md) for converting ACLNet detection results into JSON for further processing and display +* [gvametapublish](../../../../../docs/source/elements/gvametapublish.md) for printing detection results to stdout +* `fakesink` for terminating the pipeline + +## Model + +This sample uses the ACLNet model trained for audio event detection and made available through the Open Model Zoo. For more details see [here](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/aclnet/aclnet.md). +* __aclnet_des_53_fp32.onnx__ is end-to-end convolutional neural network architecture for audio classification + +> **NOTE**: Before running this sample you'll need to download and prepare the model. Execute `samples\windows\download_omz_models.bat` once to download and prepare models for all audio samples. + +## Environment Variables + +This sample requires one of the following environment variables to be set: +- `AUDIO_MODELS_PATH`: Path to audio models directory (preferred) +- `MODELS_PATH`: Path to the models directory (fallback if `AUDIO_MODELS_PATH` is not set) + +Example: +```batch +set MODELS_PATH=C:\models +``` + +## Model Proc + +Along with the model network and weights, gvaudiodetect uses an additional `model-proc` json file that describes how to prepare the input for the model and interpret its output. + +`model-proc` is a JSON file that describes the output layer name and label mapping (Cat, Dog, Baby Crying) for the output of the model. For each possible output of the model (specified using a zero based index) you can set a label and output specific threshold. Check [here](model_proc/aclnet.json). + +## Running + +```batch +audio_event_detection.bat [INPUT_PATH] +``` +Where [INPUT_PATH] can be: +* local audio file (`C:\path\to\example.audio.wav`) +* network source (ex URL starting with `http://`) + +By default, if no [INPUT_PATH] is specified, the sample uses a local file `how_are_you_doing.wav` (utilizing `filesrc` element). + +> **NOTE**: The default audio file `how_are_you_doing.wav` is located in the Linux samples folder at: +> `samples/gstreamer/gst_launch/audio_detect/how_are_you_doing.wav` +> +> Copy this file to the same directory as the batch file, or provide your own audio file as input. + +### Example +```batch +REM Copy the sample audio file first (from repo root) +copy samples\gstreamer\gst_launch\audio_detect\how_are_you_doing.wav samples\windows\gstreamer\gst_launch\audio_detect\ + +REM Run with default audio file +audio_event_detection.bat + +REM Or run with custom audio file +audio_event_detection.bat C:\audio\test_audio.wav +``` + +## Sample Output + +The sample +* prints full gst-launch-1.0 command to the console +* starts the command and outputs audio detection results to the console + +## See also +* [Windows Samples overview](../../../README.md) +* [Linux Audio Detection Sample](../../../../gstreamer/gst_launch/audio_detect/README.md) diff --git a/samples/gstreamer/gst_launch/audio_detect/audio_event_detection.bat b/samples/windows/gstreamer/gst_launch/audio_detect/audio_event_detection.bat similarity index 100% rename from samples/gstreamer/gst_launch/audio_detect/audio_event_detection.bat rename to samples/windows/gstreamer/gst_launch/audio_detect/audio_event_detection.bat diff --git a/samples/windows/gstreamer/gst_launch/audio_detect/model_proc/aclnet.json b/samples/windows/gstreamer/gst_launch/audio_detect/model_proc/aclnet.json new file mode 100644 index 00000000..02d86443 --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/audio_detect/model_proc/aclnet.json @@ -0,0 +1,277 @@ +{ + "json_schema_version": "2.2.0", + "input_preproc": [], + "output_postproc": [ + { + "layer_name": "output", + "converter": "audio_labels", + "labels": [ + { + "index": 0, + "label": "Dog", + "threshold": 0.5 + }, + { + "index": 1, + "label": "Rooster", + "threshold": 0.5 + }, + { + "index": 2, + "label": "Pig", + "threshold": 0.5 + }, + { + "index": 3, + "label": "Cow", + "threshold": 0.5 + }, + { + "index": 4, + "label": "Frog", + "threshold": 0.5 + }, + { + "index": 5, + "label": "Cat", + "threshold": 0.5 + }, + { + "index": 6, + "label": "Hen", + "threshold": 0.5 + }, + { + "index": 7, + "label": "Insects (flying)", + "threshold": 0.5 + }, + { + "index": 8, + "label": "Sheep", + "threshold": 0.5 + }, + { + "index": 9, + "label": "Crow", + "threshold": 0.5 + }, + { + "index": 10, + "label": "Rain", + "threshold": 0.5 + }, + { + "index": 11, + "label": "Sea waves", + "threshold": 0.5 + }, + { + "index": 12, + "label": "Crackling fire", + "threshold": 0.5 + }, + { + "index": 13, + "label": "Crickets", + "threshold": 0.5 + }, + { + "index": 14, + "label": "Chirping birds", + "threshold": 0.5 + }, + { + "index": 15, + "label": "Water drops", + "threshold": 0.5 + }, + { + "index": 16, + "label": "Wind", + "threshold": 0.5 + }, + { + "index": 17, + "label": "Pouring water", + "threshold": 0.5 + }, + { + "index": 18, + "label": "Toilet flush", + "threshold": 0.5 + }, + { + "index": 19, + "label": "Thunderstorm", + "threshold": 0.5 + }, + { + "index": 20, + "label": "Crying baby", + "threshold": 0.5 + }, + { + "index": 21, + "label": "Sneezing", + "threshold": 0.5 + }, + { + "index": 22, + "label": "Clapping", + "threshold": 0.5 + }, + { + "index": 23, + "label": "Breathing", + "threshold": 0.5 + }, + { + "index": 24, + "label": "Coughing", + "threshold": 0.5 + }, + { + "index": 25, + "label": "Footsteps", + "threshold": 0.5 + }, + { + "index": 26, + "label": "Laughing", + "threshold": 0.5 + }, + { + "index": 27, + "label": "Brushing teeth", + "threshold": 0.5 + }, + { + "index": 28, + "label": "Snoring", + "threshold": 0.5 + }, + { + "index": 29, + "label": "Drinking, sipping", + "threshold": 0.5 + }, + { + "index": 30, + "label": "Door knock", + "threshold": 0.5 + }, + { + "index": 31, + "label": "Mouse click", + "threshold": 0.5 + }, + { + "index": 32, + "label": "Keyboard typing", + "threshold": 0.5 + }, + { + "index": 33, + "label": "Door, wood creaks", + "threshold": 0.5 + }, + { + "index": 34, + "label": "Can opening", + "threshold": 0.5 + }, + { + "index": 35, + "label": "Washing machine", + "threshold": 0.5 + }, + { + "index": 36, + "label": "Vacuum cleaner", + "threshold": 0.5 + }, + { + "index": 37, + "label": "Clock alarm", + "threshold": 0.5 + }, + { + "index": 38, + "label": "Clock tick", + "threshold": 0.5 + }, + { + "index": 39, + "label": "Glass breaking", + "threshold": 0.5 + }, + { + "index": 40, + "label": "Helicopter", + "threshold": 0.5 + }, + { + "index": 41, + "label": "Chainsaw", + "threshold": 0.5 + }, + { + "index": 42, + "label": "Siren", + "threshold": 0.5 + }, + { + "index": 43, + "label": "Car horn", + "threshold": 0.5 + }, + { + "index": 44, + "label": "Engine", + "threshold": 0.5 + }, + { + "index": 45, + "label": "Train", + "threshold": 0.5 + }, + { + "index": 46, + "label": "Church bells", + "threshold": 0.5 + }, + { + "index": 47, + "label": "Airplane", + "threshold": 0.5 + }, + { + "index": 48, + "label": "Fireworks", + "threshold": 0.5 + }, + { + "index": 49, + "label": "Hand saw", + "threshold": 0.5 + }, + { + "index": 50, + "label": "Gunshot", + "threshold": 0.5 + }, + { + "index": 51, + "label": "Crowd", + "threshold": 0.5 + }, + { + "index": 52, + "label": "Speech", + "threshold": 0.5 + } + ] + } + ] +} diff --git a/samples/windows/gstreamer/gst_launch/detection_with_yolo/README.md b/samples/windows/gstreamer/gst_launch/detection_with_yolo/README.md new file mode 100644 index 00000000..6b8750be --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/detection_with_yolo/README.md @@ -0,0 +1,179 @@ +# Object Detection and Classification with Yolo models (Windows) + +This sample demonstrates how to construct object detection pipelines via `gst-launch-1.0` command-line utility using YOLO models on Windows. + +## How It Works + +This sample utilizes GStreamer command-line tool `gst-launch-1.0` which can build and run GStreamer pipeline described in a string format. +The string contains a list of GStreamer elements separated by exclamation mark `!`, each element may have properties specified in the format `property`=`value`. + +This sample builds GStreamer pipeline of the following elements: +* `filesrc` or `urisourcebin` for input from file/URL +* `decodebin3` for video decoding (automatically selects D3D11 decoder when available) +* [gvadetect](https://dlstreamer.github.io/elements/gvadetect.html) for full-frame object detection +* [gvawatermark](https://dlstreamer.github.io/elements/gvawatermark.html) for bounding boxes visualization +* `d3d11convert` for D3D11-accelerated video conversion +* `autovideosink` for rendering output video to screen + +> **NOTE**: `sync=false` property in `autovideosink` element disables real-time synchronization so pipeline runs as fast as possible + +## Windows-Specific Features + +### D3D11 Pre-processing Backend + +On Windows with GPU or NPU devices, this sample uses **D3D11 (Direct3D 11)** as the pre-processing backend instead of VA-API (Linux). This provides: +- Hardware-accelerated video decode via D3D11 decoders +- Zero-copy or efficient memory transfer between decode and inference +- Better performance on Intel GPUs with Windows drivers + +### Pre-processing Backend Selection + +| Device | Default Backend | Description | +|--------|-----------------|-------------| +| CPU | `ie` | OpenVINO Inference Engine | +| GPU | `d3d11` | Direct3D 11 acceleration | +| NPU | `d3d11` | Direct3D 11 acceleration | + +## Models + +The sample uses YOLO models from different repositories. The model preparation and conversion method depends on the model source. + +For yolov5su, yolov8s (8n-obb, 8n-seg), yolov9c, yolov10s and yolo11s (yolo11s-seg, yolo11s-obb) models it is also necessary to install the ultralytics python package: + +```batch +pip install ultralytics +``` + +### Supported Models + +| Model | Model Preparation | Model pipeline (model-proc) | +|-------|-------------------|----------------------------| +| yolox-tiny | omz_downloader and omz_converter | gvadetect model-proc=yolo-x.json | +| yolox_s | Intel® OpenVINO™ model | gvadetect model-proc=yolo-x.json | +| yolov5s | Pytorch -> OpenVINO™ converter | gvadetect model-proc=yolo-v7.json | +| yolov5su | Ultralytics python exporter | gvadetect model-proc=yolo-v8.json | +| yolov7 | Pytorch -> ONNX -> OpenVINO™ | gvadetect model-proc=yolo-v7.json | +| yolov8s | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolov8n-obb | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolov8n-seg | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolov9c | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolov10s | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolo11s | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolo11s-seg | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolo11s-obb | Ultralytics python exporter | gvadetect (model-proc not needed) | +| yolo11s-pose | Ultralytics python exporter | gvadetect (model-proc not needed) | + +## Environment Variables + +This sample requires the following environment variable to be set: +- `MODELS_PATH`: Path to the models directory + +Example: +```batch +set MODELS_PATH=C:\models +``` + +## Running + +```batch +yolo_detect.bat [MODEL] [DEVICE] [INPUT] [OUTPUT] [PPBKEND] [PRECISION] +``` + +### Parameters + +| Parameter | Default | Description | +|-----------|---------|-------------| +| MODEL | yolox_s | Model name (see supported models above) | +| DEVICE | GPU | Inference device: CPU, GPU, NPU | +| INPUT | Pexels video URL | Input video file or URL | +| OUTPUT | display | Output type: file, display, fps, json, display-and-json | +| PPBKEND | auto | Pre-processing backend: ie, opencv, d3d11 | +| PRECISION | INT8 | Model precision: INT8, FP32, FP16 | + +### Examples + +Run with default settings (yolox_s model, GPU, display output): +```batch +yolo_detect.bat +``` + +Run yolo11s model with GPU inference: +```batch +yolo_detect.bat yolo11s GPU +``` + +Run with local video file: +```batch +yolo_detect.bat yolo11s GPU C:\videos\test.mp4 +``` + +Run with CPU and save to file: +```batch +yolo_detect.bat yolo11s CPU C:\videos\test.mp4 file +``` + +Run with explicit D3D11 backend: +```batch +yolo_detect.bat yolo11s GPU C:\videos\test.mp4 display d3d11 +``` + +Run in FPS-only mode (benchmark): +```batch +yolo_detect.bat yolo11s GPU C:\videos\test.mp4 fps +``` + +Run with FP32 precision: +```batch +yolo_detect.bat yolo11s GPU C:\videos\test.mp4 display d3d11 FP32 +``` + +### Output Types + +| Output | Description | +|--------|-------------| +| `display` | Show video with detections on screen | +| `file` | Save video with detections to MP4 file | +| `fps` | Measure FPS only (no visualization) | +| `json` | Output detection metadata to output.json | +| `display-and-json` | Both display and JSON output | + +## Device Restrictions + +- **yolov10s**: Not supported on NPU +- **yolov10s on GPU**: Requires special configuration (automatically applied) + +## Download Models + +If you have not already downloaded the required models, do so before running the sample. Use the Linux download script. On Windows, you can run this script using WSL (Windows Subsystem for Linux) or Git Bash: + +### Using WSL or Git Bash + +```bash +# Set the models path (use a path accessible from Windows) +export MODELS_PATH=/mnt/c/models # WSL path to C:\models + +# Download a specific model (FP32 and FP16) +cd samples +./download_public_models.sh yolo11s + +# For INT8 quantization (requires a calibration dataset) +./download_public_models.sh yolo11s coco128 +``` + +For detailed instructions on downloading models, including the full list of supported models and quantization options, see the [Download Public Models Guide](../../../../../docs/source/dev_guide/download_public_models.md). + +> **Note**: Make sure to set your `MODELS_PATH` environment variable in Windows to point to the same location where models were downloaded (e.g., `set MODELS_PATH=C:\models`). + +## Sample Output + +The sample: +* Prints the full gst-launch-1.0 command to the console +* Runs the pipeline and either: + - Displays video with bounding boxes around detected objects + - Saves output to MP4 file + - Prints FPS metrics + - Outputs JSON metadata + +## See also +* [Windows Samples overview](../../../README.md) +* [Linux Detection with Yolo Sample](../../../../gstreamer/gst_launch/detection_with_yolo/README.md) diff --git a/samples/windows/gstreamer/gst_launch/detection_with_yolo/yolo_detect.bat b/samples/windows/gstreamer/gst_launch/detection_with_yolo/yolo_detect.bat new file mode 100644 index 00000000..9b5ca500 --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/detection_with_yolo/yolo_detect.bat @@ -0,0 +1,178 @@ +@REM ============================================================================== +@REM Copyright (C) 2021-2026 Intel Corporation +@REM +@REM SPDX-License-Identifier: MIT +@REM ============================================================================== +@REM This sample refers to a video file by Rihard-Clement-Ciprian Diac via Pexels +@REM (https://www.pexels.com) +@REM ============================================================================== + +@echo off +setlocal + +@REM Check MODELS_PATH +if NOT DEFINED MODELS_PATH ( + echo [91mERROR: MODELS_PATH is not set.[0m + EXIT /B 1 +) +echo MODELS_PATH: %MODELS_PATH% + +@REM Parse arguments +set MODEL=%1 +if [%MODEL%]==[] set MODEL=yolox_s + +set DEVICE=%2 +if [%DEVICE%]==[] set DEVICE=GPU + +set INPUT=%3 +if [%INPUT%]==[] set INPUT=https://videos.pexels.com/video-files/1192116/1192116-sd_640_360_30fps.mp4 + +set OUTPUT=%4 +if [%OUTPUT%]==[] set OUTPUT=display + +set PPBKEND=%5 +if [%PPBKEND%]==[] set PPBKEND=d3d11 + +set PRECISION=%6 +if [%PRECISION%]==[] set PRECISION=FP16 + +@REM Show help +if "%MODEL%"=="--help" goto :show_help +if "%MODEL%"=="-h" goto :show_help +goto :skip_help + +:show_help +echo Usage: yolo_detect.bat [MODEL] [DEVICE] [INPUT] [OUTPUT] [PPBKEND] [PRECISION] +echo. +echo Arguments: +echo MODEL - Model name (default: yolox_s) +echo Supported: yolox-tiny, yolox_s, yolov5s, yolov5su, yolov7, yolov8s, yolov8n-obb, yolov8n-seg, yolov9c, yolov10s, yolo11s, yolo11s-obb, yolo11s-seg, yolo11s-pose +echo DEVICE - Device (default: GPU). Supported: CPU, GPU, NPU +echo INPUT - Input source (default: Pexels video URL) +echo OUTPUT - Output type (default: display). Supported: file, display, fps, json, display-and-json +echo PPBKEND - Preprocessing backend (default: auto). Supported: ie, opencv for CPU, d3d11 for GPU/NPU +echo PRECISION - Model precision (default: INT8). Supported: INT8, FP32, FP16 +echo. +EXIT /B 0 + +:skip_help + +@REM Validate model +set VALID_MODEL=0 +for %%m in (yolox-tiny yolox_s yolov5s yolov5su yolov7 yolov8s yolov8n-obb yolov8n-seg yolov9c yolov10s yolo11s yolo11s-seg yolo11s-obb yolo11s-pose) do ( + if "%MODEL%"=="%%m" set VALID_MODEL=1 +) +if %VALID_MODEL%==0 ( + echo [91mERROR: Unsupported model: %MODEL%[0m + EXIT /B 1 +) + +@REM Check for yolov10s NPU restriction +if "%MODEL%"=="yolov10s" if "%DEVICE%"=="NPU" ( + echo [91mERROR: No support of Yolov10s for NPU.[0m + EXIT /B 1 +) + +@REM Validate precision +if NOT "%PRECISION%"=="INT8" if NOT "%PRECISION%"=="FP32" if NOT "%PRECISION%"=="FP16" ( + echo [91mERROR: Unsupported model precision: %PRECISION%[0m + EXIT /B 1 +) + +@REM Set model-proc file based on model +set MODEL_PROC= +if "%MODEL%"=="yolox-tiny" set MODEL_PROC=%~dp0..\..\..\..\gstreamer\model_proc\public\yolo-x.json +if "%MODEL%"=="yolox_s" set MODEL_PROC=%~dp0..\..\..\..\gstreamer\model_proc\public\yolo-x.json +if "%MODEL%"=="yolov5s" set MODEL_PROC=%~dp0..\..\..\..\gstreamer\model_proc\public\yolo-v7.json +if "%MODEL%"=="yolov5su" set MODEL_PROC=%~dp0..\..\..\..\gstreamer\model_proc\public\yolo-v8.json +if "%MODEL%"=="yolov7" set MODEL_PROC=%~dp0..\..\..\..\gstreamer\model_proc\public\yolo-v7.json +@REM Set model path (strip quotes from MODELS_PATH) +set MODEL_PATH=%MODELS_PATH:"=%\public\%MODEL%\%PRECISION%\%MODEL%.xml + +@REM Check if model exists +if NOT EXIST "%MODEL_PATH%" ( + echo [91mERROR: Model not found: %MODEL_PATH%[0m + echo Please run download_public_models.bat to download the models first. + EXIT /B 1 +) + +@REM Set source element based on input type +set SOURCE_ELEMENT= +echo %INPUT% | findstr /C:"://" >nul +if %ERRORLEVEL%==0 ( + set SOURCE_ELEMENT=urisourcebin uri=%INPUT% +) else ( + set INPUT_PATH=%INPUT:\=/% + set SOURCE_ELEMENT=filesrc location=%INPUT_PATH% +) + + +@REM Set pre-process backend based on device +@REM On Windows: use d3d11 for GPU/NPU, ie for CPU +if [%PPBKEND%]==[] ( + if "%DEVICE%"=="CPU" ( + set PREPROC_BACKEND=ie + ) else ( + set PREPROC_BACKEND=d3d11 + ) +) else ( + if "%PPBKEND%"=="ie" set PREPROC_BACKEND=ie + if "%PPBKEND%"=="opencv" set PREPROC_BACKEND=opencv + if "%PPBKEND%"=="d3d11" set PREPROC_BACKEND=d3d11 + if NOT DEFINED PREPROC_BACKEND ( + echo [91mERROR: Invalid PREPROC_BACKEND parameter. Supported values: ie, opencv, d3d11[0m + EXIT /B 1 + ) +) + +@REM Set IE config for yolov10s on GPU +set IE_CONFIG= +if "%MODEL%"=="yolov10s" if "%DEVICE%"=="GPU" ( + set IE_CONFIG=ie-config=GPU_DISABLE_WINOGRAD_CONVOLUTION=YES +) + +@REM Set sink element based on output type +if "%OUTPUT%"=="file" ( + for %%F in ("%INPUT%") do set FILENAME=%%~nF + set OUTPUT_FILE=yolo_%FILENAME%_%MODEL%_%PRECISION%_%DEVICE%.mp4 + if EXIST "%OUTPUT_FILE%" del "%OUTPUT_FILE%" + set SINK_ELEMENT=! queue ! d3d11convert ! gvawatermark ! gvafpscounter ! d3d11h264enc ! h264parse ! mp4mux ! filesink location=%OUTPUT_FILE% +) else if "%OUTPUT%"=="display" ( + set SINK_ELEMENT=! queue ! d3d11convert ! gvawatermark ! videoconvert ! gvafpscounter ! d3d11videosink sync=false +) else if "%OUTPUT%"=="fps" ( + set SINK_ELEMENT=! queue ! gvafpscounter ! fakesink async=false +) else if "%OUTPUT%"=="json" ( + if EXIST "output.json" del "output.json" + set SINK_ELEMENT=! queue ! gvametaconvert add-tensor-data=true ! gvametapublish file-format=json-lines file-path=output.json ! fakesink async=false +) else if "%OUTPUT%"=="display-and-json" ( + if EXIST "output.json" del "output.json" + set SINK_ELEMENT=! queue ! d3d11convert ! gvawatermark ! gvametaconvert add-tensor-data=true ! gvametapublish file-format=json-lines file-path=output.json ! videoconvert ! gvafpscounter ! d3d11videosink sync=false +) else ( + echo [91mERROR: Invalid OUTPUT parameter[0m + echo Valid values: file, display, fps, json, display-and-json + EXIT /B 1 +) + +@REM Convert paths to forward slashes for GStreamer +set MODEL_PATH=%MODEL_PATH:\=/% +if DEFINED MODEL_PROC set MODEL_PROC=%MODEL_PROC:\=/% + +@REM Build pipeline +set MODEL_PROC_PART= +if DEFINED MODEL_PROC set MODEL_PROC_PART= model-proc=%MODEL_PROC% + +set IE_CONFIG_PART= +if DEFINED IE_CONFIG set IE_CONFIG_PART= %IE_CONFIG% + +@REM Build complete pipeline in one line +set PIPELINE=gst-launch-1.0 %SOURCE_ELEMENT% ! decodebin3 ! gvadetect model=%MODEL_PATH% %MODEL_PROC_PART% device=%DEVICE% pre-process-backend=%PREPROC_BACKEND% %IE_CONFIG_PART% %SINK_ELEMENT% + +@REM Run pipeline +echo. +echo Running pipeline: +echo %PIPELINE% +echo. + +%PIPELINE% + +EXIT /B %ERRORLEVEL% diff --git a/samples/windows/gstreamer/gst_launch/face_detection_and_classification/README.md b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/README.md new file mode 100644 index 00000000..92d1c62f --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/README.md @@ -0,0 +1,89 @@ +# Face Detection And Classification Sample (Windows) + +This sample demonstrates face detection and classification pipeline constructed via `gst-launch-1.0` command-line utility on Windows. + +## How It Works +The sample utilizes GStreamer command-line tool `gst-launch-1.0` which can build and run GStreamer pipeline described in a string format. +The string contains a list of GStreamer elements separated by exclamation mark `!`, each element may have properties specified in the format `property`=`value`. + +This sample builds GStreamer pipeline of the following elements +* `filesrc` or `urisourcebin` or `ksvideosrc` for input from file/URL/web-camera (Windows uses `ksvideosrc` for webcam access) +* `decodebin3` for video decoding +* `videoconvert` for converting video frame into different color formats +* [gvadetect](https://dlstreamer.github.io/elements/gvadetect.html) for face detection based on OpenVINO™ Toolkit Inference Engine +* [gvaclassify](https://dlstreamer.github.io/elements/gvaclassify.html) inserted into pipeline three times for face classification on three DL models (age-gender, emotion, landmark points) +* [gvawatermark](https://dlstreamer.github.io/elements/gvawatermark.html) for bounding boxes and labels visualization +* `autovideosink` for rendering output video into screen +> **NOTE**: `sync=false` property in `autovideosink` element disables real-time synchronization so pipeline runs as fast as possible + +## Models + +The sample uses by default the following pre-trained models from OpenVINO™ Toolkit [Open Model Zoo](https://github.com/openvinotoolkit/open_model_zoo) +* __face-detection-adas-0001__ is primary detection network for finding faces +* __age-gender-recognition-retail-0013__ age and gender estimation on detected faces +* __emotions-recognition-retail-0003__ emotion estimation on detected faces +* __landmarks-regression-retail-0009__ generates facial landmark points + +> **NOTE**: Before running samples (including this one), run script `download_omz_models.bat` once (the script located in `samples\windows` folder) to download all models required for this and other samples. + +## Environment Variables + +This sample requires the following environment variable to be set: +- `MODELS_PATH`: Path to the models directory + +Example: +```batch +set MODELS_PATH=C:\models +``` + +The sample contains `model_proc` subfolder with .json files for each model with description of model input/output formats and post-processing rules for classification models. + +## Running + +```batch +face_detection_and_classification.bat [INPUT_VIDEO] [DEVICE] [SINK_ELEMENT] +``` +The sample takes three command-line *optional* parameters: +1. **INPUT_VIDEO** to specify input video file. +The input could be: + * local video file (`C:\path\to\video.mp4`) + * web camera device path (Windows USB camera path format) + * RTSP camera (URL starting with `rtsp://`) or other streaming source (ex URL starting with `http://`) + + If parameter is not specified, the sample by default streams video example from HTTPS link (utilizing `urisourcebin` element) so requires internet connection. + +2. **DEVICE** to specify device for detection and classification. + * CPU (Default) + * GPU + + Please refer to OpenVINO™ toolkit documentation for supported devices: + https://docs.openvinotoolkit.org/latest/openvino_docs_IE_DG_supported_plugins_Supported_Devices.html + +3. **SINK_ELEMENT** to choose between render mode and fps throughput mode: + * display - render (default) + * fps - FPS only + +### Examples +```batch +REM Run with default settings (download video from internet, CPU inference, display output) +face_detection_and_classification.bat + +REM Run with local video file +face_detection_and_classification.bat C:\videos\test.mp4 + +REM Run with GPU inference +face_detection_and_classification.bat C:\videos\test.mp4 GPU + +REM Run in FPS mode (no display) +face_detection_and_classification.bat C:\videos\test.mp4 CPU fps +``` + +## Sample Output + +The sample +* prints gst-launch-1.0 full command line into console +* starts the command and either visualizes video with bounding boxes around detected faces, facial landmarks points and text with classification results (age/gender, emotion) for each detected face or prints out fps if you set SINK_ELEMENT = fps + +## See also +* [Windows Samples overview](../../../README.md) +* [Linux Face Detection and Classification Sample](../../../../gstreamer/gst_launch/face_detection_and_classification/README.md) diff --git a/samples/gstreamer/gst_launch/face_detection_and_classification/face_detection_and_classification.bat b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/face_detection_and_classification.bat similarity index 100% rename from samples/gstreamer/gst_launch/face_detection_and_classification/face_detection_and_classification.bat rename to samples/windows/gstreamer/gst_launch/face_detection_and_classification/face_detection_and_classification.bat diff --git a/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/age-gender-recognition-retail-0013.json b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/age-gender-recognition-retail-0013.json new file mode 100644 index 00000000..8d454fde --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/age-gender-recognition-retail-0013.json @@ -0,0 +1,23 @@ +{ + "json_schema_version": "2.2.0", + "input_preproc": [], + "output_postproc": [ + { + "layer_name": "age_conv3", + "attribute_name": "age", + "converter": "text", + "text_precision": 0, + "text_scale": 100.0 + }, + { + "layer_name": "prob", + "attribute_name": "gender", + "labels": [ + "Female", + "Male" + ], + "converter": "label", + "method": "max" + } + ] +} diff --git a/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/emotions-recognition-retail-0003.json b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/emotions-recognition-retail-0003.json new file mode 100644 index 00000000..cfee6098 --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/emotions-recognition-retail-0003.json @@ -0,0 +1,18 @@ +{ + "json_schema_version": "2.2.0", + "input_preproc": [], + "output_postproc": [ + { + "attribute_name": "emotion", + "labels": [ + "neutral", + "happy", + "sad", + "surprise", + "anger" + ], + "converter": "label", + "method": "max" + } + ] +} diff --git a/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/landmarks-regression-retail-0009.json b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/landmarks-regression-retail-0009.json new file mode 100644 index 00000000..64db6cf9 --- /dev/null +++ b/samples/windows/gstreamer/gst_launch/face_detection_and_classification/model_proc/landmarks-regression-retail-0009.json @@ -0,0 +1,9 @@ +{ + "json_schema_version": "2.2.0", + "input_preproc": [], + "output_postproc": [ + { + "format": "landmark_points" + } + ] +} diff --git a/src/monolithic/gst/elements/CMakeLists.txt b/src/monolithic/gst/elements/CMakeLists.txt index b8c3d606..3f652a4e 100644 --- a/src/monolithic/gst/elements/CMakeLists.txt +++ b/src/monolithic/gst/elements/CMakeLists.txt @@ -6,7 +6,7 @@ set (TARGET_NAME "elements") -find_package(OpenCV REQUIRED core imgproc) +find_package(OpenCV REQUIRED core imgproc calib3d) find_package(PkgConfig REQUIRED) pkg_check_modules(GSTREAMER gstreamer-1.0>=1.16 REQUIRED) pkg_check_modules(GSTVIDEO gstreamer-video-1.0>=1.16 REQUIRED)