picobyte / stable-diffusion-webui-wd14-tagger

Labeling extension for Automatic1111's Web UI
580 stars 70 forks source link

Unable to use recursive search in directory #53

Closed Darkenlord1 closed 1 year ago

Darkenlord1 commented 1 year ago

With enabled checkmark in settings - "Glob recursively with input directory pattern".

I have a folder with few folders inside it, and in them i have my images, however, tagger unable to find them.

Example of output in console: C:\Users\darkenlord1\Desktop\datasets\images\FFAuRa\a2\1_black: not an image extension: "" C:\Users\darkenlord1\Desktop\datasets\images\FFAuRa\a2\1_greyscale: not an image extension: "" C:\Users\darkenlord1\Desktop\datasets\images\FFAuRa\a2\1_red: not an image extension: "" C:\Users\darkenlord1\Desktop\datasets\images\FFAuRa\a2\2_beige: not an image extension: "" C:\Users\darkenlord1\Desktop\datasets\images\FFAuRa\a2\3_white: not an image extension: "" C:\Users\darkenlord1\Desktop\datasets\images\FFAuRa\a2\8_gold: not an image extension: "" found 0 image(s) Tags: 0it [00:00, ?it/s]

If i insert path to the folder where images located (not the main with all subfolders), then everything is fine.

Am i missing anything?

picobyte commented 1 year ago

The printing of messages for directories is redundant but not a cause of failure, however, that the glob doesn't actually find and list the files in the subdirectories was a bit surprising to me as well. I didn't change these patterns, so Toriato's branch works similar.

The way you have to recurse was using a glob like /path/to/*/*, /path/to/** or /path/to/**/*.

I was considering changing this, but then e.g. querying a /home dir would give altered behaviour, could cause issues, so would at least require a default False, but then the checkbox would be more appropriate on the front page again. I don't like all these changes so I decided just to make the existing behaviour more clear in the label in the ui.