Have image classify run all .jpg in a directory

Currently you have to specify a specific file for an image classify program. Is there a way to have it run all *.jpg in a folder?

Asking because then I could run a crontab at the end of the day, classify images and archive them.

If you are referring to jetson-inference image classification program, I have been working on a Python version which should make it easier to do this inside the program itself.

For the time being, you could use a bash script that loops over the files in the directory and calls the classify program, in a similar fashion as here: https://www.cyberciti.biz/faq/bash-loop-over-file/

Good to know on the jetson inference. For this particular use I’m actually using a coral usb accelerator attached to the nano due to the fact that it already had 1000+ birds learned and ready.

Here’s the string. It uses the image modifier to determine the file.

python3 classify_image.py --model ~/Downloads/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --label ~/Downloads/inat_bird_labels.txt --image ~/darkflow/birds/1.jpg

In that case, you could also use the shell script method I mentioned above, or add the ability to the Python script to loop over files in a directory, like as seen in this example: https://stackoverflow.com/questions/10377998/how-can-i-iterate-over-files-in-a-given-directory