From df5955cb016da230b6c20f5d4b3caa5ab1aa67f7 Mon Sep 17 00:00:00 2001 From: Antonio Jesus Diaz Honrubia Date: Mon, 31 Mar 2025 21:09:58 +0000 Subject: [PATCH] Upload New File --- Process saliency map/readme.md | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Process saliency map/readme.md diff --git a/Process saliency map/readme.md b/Process saliency map/readme.md new file mode 100644 index 0000000..829309d --- /dev/null +++ b/Process saliency map/readme.md @@ -0,0 +1,40 @@ +# ModelToQP Project + +## Overview + +The `ModelToQP` project is designed to process video files and generate Quantization Parameter (QP) grids based on saliency maps. The project leverages deep learning models to predict saliency maps and uses these maps to create QP grids for video encoding optimization. The project supports both RGB and YUV video formats and provides flexibility in model configuration and processing. + +## Project Structure + +- **`loss.py`**: Contains loss functions for saliency map evaluation, including KLDivergence, similarity, CC, NSS, and AUC metrics. +- **`model.py`**: Defines the deep learning models used for saliency prediction, including video saliency models, audio-video fusion models, and YUV-specific models. +- **`model_utils.py`**: Provides utility classes and functions for model components, such as convolutional layers and mixed layers. +- **`utils.py`**: Contains utility functions for loss computation, image processing, and other helper methods. +- **`YUVFileLoader.py`**: Handles loading of YUV video files in both 8-bit and 10-bit formats. +- **`ObtainGrid.py`**: Implements the logic for generating QP grids based on saliency maps and attention points. +- **`generate_result.py`**: The main script for processing video files, generating saliency maps, and creating QP grids. +- **`readme.md`**: This file, providing an overview of the project and instructions for usage. + +## Usage + +### 1. Prepare Input Files + +- Place your YUV video files in a directory. +- Create configuration files (`.cfg`) for each video file. The configuration file should include details such as the file path, width, height, and bit depth. + +### 2. Run the `generate_result.py` Script + +The `generate_result.py` script processes the video files and generates QP grids. Below are the steps to execute the script: + +#### Command-Line Arguments + +- `--file_path`: Path to the directory containing YUV video files. +- `--cfg_path`: Path to a single configuration file. +- `--cfg_folder`: Path to a folder containing multiple configuration files. +- `--output_folder`: Directory where the QP files will be saved. +- `--file_weight`: Path to the pre-trained model weights. +- `--qp_target`: Target QP value for the grid. +- `--save_path`: Directory where intermediate results (e.g., saliency maps) will be saved. +- `--verbose`: Verbosity level (0 for minimal output, 3 for detailed output). +- `--rgb_images`: Save RGB images (1 to enable, 0 to disable). +- `--saliency_map`: Save saliency maps (1 to enable, 0 to disable). \ No newline at end of file -- 2.24.1