Your wrapper turned out amazing, thank you again for posting it.
I have a few suggestions for improvement, however.
- Make it able to complete a batch of images in a directory by itself. I can run a batch using the following script, however it really slows down my computer if I'm doing any more than 20 images per batch because it seems to be trying to run each image simultaneously. My suggestion would be to program it so that if you set the input to a directory, rather than a filename, it will process each file in said directory, and that, similarly, if you enter only a directory in the output it will place the labeled images in the selected directory. In this example,
./unlabeled/
and ./labeled/
are directories contained within the same directory that both lewd_detectory.py and my "lewd_batcher.py" are stored in.
# lewd_batcher.py
import subprocess
from pathlib import Path
for file in Path("./unlabeled").iterdir():
uC = "./unlabeled/"+file.__str__()[11:]
c = "./labeled/"+file.__str__()[11:]
command = ["python3", "lewd_detector.py", "--probability", "0.15", "--mode", "base", uC, "--outfile", c]
subprocess.Popen(command)
- Make it easier to turn off the visualizations for each image. I can't seem to get
--noviz
to work correctly, which is why it isn't in my batching script above. If it was something such as viz=y
or viz=n
, then I believe it would be easier.
- Lastly, If you really want your wrapper to take off, provide arguments that allow people to blacklist certain tags from being displayed/labeled/censored, allow people to choose whether or not the boxes are labeled or censored, or whether the lewdness rating and threshold appear in the labeled images.
Keep up the good job Technic.