AK51
June 9, 2023, 6:12am
1
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
<img src="https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/deep-vision-header.jpg" width="100%">
<p align="right"><sup><a href="../README.md#appendix">Back</a> | <a href="aux-image.md">Next</a> | </sup><a href="../README.md#hello-ai-world"><sup>Contents</sup></a>
<br/>
<sup>Appendix</sup></p>
# Camera Streaming and Multimedia
This project supports capturing and streaming video feeds & static images via a variety of interfaces and protocols, including:
* [MIPI CSI cameras](#mipi-csi-cameras)
* [V4L2 cameras](#v4l2-cameras)
* [WebRTC](#webrtc)
* [RTP](#rtp) / [RTSP](#rtsp)
* [Videos](#video-files) & [Images](#image-files)
* [Image sequences](#image-files)
* [OpenGL windows](#output-streams)
Streams are identified via a resource URI and are acquired through the [`videoSource`](#source-code) and [`videoOutput`](#source-code) APIs. These settings can be configured via command-line arguments or in your application's [source code](#source-code). The tables below show the supported input/output protocols and URI formats:
### Input Streams
This file has been truncated. show original
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:
*/
#ifndef __IMAGE_IO_H_
#define __IMAGE_IO_H_
#include "cudaUtility.h"
#include "imageFormat.h"
/**
* Load a color image from disk into CUDA memory, in uchar3/uchar4/float3/float4 formats with pixel values 0-255.
*
* Supported image file formats by loadImage() include:
*
* - JPG
* - PNG
* - TGA
* - BMP
* - GIF
* - PSD
AK51
June 15, 2023, 1:58am
4
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
system
Closed
July 12, 2023, 1:23am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.