Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Export, Save Metadata to Directory, and Silent Output #82

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
23 changes: 23 additions & 0 deletions deepdanbooru/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,28 @@ def grad_cam(project_path, target_path, output_path, threshold):
is_flag=True,
help="Enable this option to save tags to a txt file with the same filename.",
)
@click.option(
"--save-json",
default=False,
is_flag=True,
help="Enable this option to save tags to score as a json file with the same filename.",
)
@click.option(
"--save-path",
type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True),
help="Directory path to save result files to.",
)
@click.option(
"--folder-filters",
default="*.[Pp][Nn][Gg],*.[Jj][Pp][Gg],*.[Jj][Pp][Ee][Gg],*.[Gg][Ii][Ff]",
help="Glob pattern for searching image files in folder. You can specify multiple patterns by separating comma. This is used when --allow-folder is enabled. Default:*.[Pp][Nn][Gg],*.[Jj][Pp][Gg],*.[Jj][Pp][Ee][Gg],*.[Gg][Ii][Ff]",
)
@click.option(
"--no-tag-output",
default=False,
is_flag=True,
help="Do not print tags to stdout",
)
@click.option("--verbose", default=False, is_flag=True)
def evaluate(
target_paths, # I guess its this one
Expand All @@ -194,7 +211,10 @@ def evaluate(
compile_model,
allow_folder,
save_txt,
save_json,
save_path,
folder_filters,
no_tag_output,
verbose,
):
if verbose:
Expand All @@ -210,7 +230,10 @@ def evaluate(
compile_model,
allow_folder,
save_txt,
save_json,
save_path,
folder_filters,
no_tag_output,
verbose,
)

Expand Down
Loading