How to make the same file name output in "dusty nv inference"?

Hi,

I would like to output all images files with the same input file name in another folder, is it possible? If not, which c file shall I modify? Thx

Thanks,
Andy

$ video-viewer input_dir/ output_dir/   # load all images from input_dir and save them to output_dir
$ video-viewer "*.jpg" output_%i.jpg    # load all jpg images and save them to output_0.jpg, output_1.jpg, ect

Reference

Hi @AK51, it’s not possible using the normal videoSource interface, as each particular image filename isn’t stored. Instead, you could manually use the loadImage() and saveImage() functions to retain the filenames:

Hi,

Thx for the information.
I have made a bash script as the Plan B and it works. :> Thx

./batch_inference.sh {input_folder} {output_folder} {onnx file}

Cheers,
Andy

#!/bin/bash
input_folder="$1"
output_folder="$2"
model="$3"
for file in "$input_folder"/*; do
    filename=$(basename -- "$file")
    input_path_file="$input_folder/$filename"
    output_path_file="$output_folder/$filename"
    echo "$input_path_file"
    echo "$output_path_file"
    python3 segnet.py "$input_path_file" "$output_path_file" --model="$model" --labels=classes.txt --input_blob="input_0" --output_blob="output_0" --colors=colors.txt
done

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.