DeepDanbooru icon indicating copy to clipboard operation
DeepDanbooru copied to clipboard

How to output the result to txt?

Open Cdanzhi opened this issue 1 year ago • 3 comments

I deployed the project locally, but after I used ‘deepdanbooru evaluate.......’, I found that the result was just printed in cmd. How to save the results separately as the corresponding txt file for each picture?

Thank you very much!

Cdanzhi avatar Mar 29 '23 03:03 Cdanzhi

If you have GIT you can open a git bash instead of a cmd window and run the command deepdanbooru evaluate [image_file_path or folder] --project-path [your_project_folder] --allow-folder | tee -a output_$(date +'%Y-%m-%d_%H-%M-%S').txt and it will output in the bash window and a time stamped text file but it saves every output into a single text file though it does sort within that one text file, it isn't hard to write a code that can take that one text file and split it into many but as far as I know outside of editing DeepDanbooru code there isn't a way to do it directly

Jena8765 avatar Apr 03 '23 06:04 Jena8765

If you have GIT you can open a git bash instead of a cmd window and run the command deepdanbooru evaluate [image_file_path or folder] --project-path [your_project_folder] --allow-folder | tee -a output_$(date +'%Y-%m-%d_%H-%M-%S').txt and it will output in the bash window and a time stamped text file but it saves every output into a single text file though it does sort within that one text file, it isn't hard to write a code that can take that one text file and split it into many but as far as I know outside of editing DeepDanbooru code there isn't a way to do it directly

Why??? you can just pass --save_txt to evaluate and it generates a .txt to each file!

kamuridesu avatar May 22 '23 18:05 kamuridesu

You can indeed add --save-txt (note the dash, not an underscore) to your command, which will create a file with the same name as your image (but with .txt obviously) containing its tags. For the moment only the tags are saved; the confidence of each tag is lost during the process.

soleilvermeil avatar Sep 30 '23 09:09 soleilvermeil