![]() |
iVS3D v2.0.0
|
Example for performing segmentation inference using a neural network model. More...
#include <algorithm>#include <iostream>#include <memory>#include <string>#include <vector>#include <chrono>#include <opencv2/core.hpp>#include <opencv2/imgcodecs.hpp>#include <opencv2/imgproc.hpp>#include "NeuralNetFactory.h"#include "NeuralUtil.h"#include "cxxopts.hpp"#include "helpers.hpp"Functions | |
| int | main (int argc, char **argv) |
| Main function for segmentation inference example. | |
Example for performing segmentation inference using a neural network model.
This example demonstrates how to load a segmentation model, perform inference on an input image, and save the segmentation result. It supports GPU inference if available.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Main function for segmentation inference example.
This example demonstrates how to load a segmentation model, perform inference on an input image, and save the segmentation result. It also supports GPU inference if available.
Usage: ./inference_segmentation –model <model_path> –input <image_path> –output <output_dir> [–gpu <gpu_id>]
The model needs to be a segmentation model in onnx format with an argmax layer at the end. The input image should be a valid image file (e.g., jpg, png).