diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-17 05:41:02 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-17 05:41:02 +0000 |
commit | b99d3cf6dd9bc817e51d0d0a6e8eb12c7c0ac6af (patch) | |
tree | d88c3feb90120044e52f42960c1823e8e9e57b76 /modules | |
parent | 5c94aaf290f8ad7bf4499a91c268ad0791b0432f (diff) | |
download | stable-diffusion-webui-gfx803-b99d3cf6dd9bc817e51d0d0a6e8eb12c7c0ac6af.tar.gz stable-diffusion-webui-gfx803-b99d3cf6dd9bc817e51d0d0a6e8eb12c7c0ac6af.tar.bz2 stable-diffusion-webui-gfx803-b99d3cf6dd9bc817e51d0d0a6e8eb12c7c0ac6af.zip |
make CLIP interrogate ranks output sane values
Diffstat (limited to 'modules')
-rw-r--r-- | modules/interrogate.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/interrogate.py b/modules/interrogate.py index d85d7dcc..64b91eb4 100644 --- a/modules/interrogate.py +++ b/modules/interrogate.py @@ -123,7 +123,7 @@ class InterrogateModels: return caption[0]
- def interrogate(self, pil_image, include_ranks=False):
+ def interrogate(self, pil_image):
res = None
try:
@@ -156,8 +156,8 @@ class InterrogateModels: for name, topn, items in self.categories:
matches = self.rank(image_features, items, top_count=topn)
for match, score in matches:
- if include_ranks:
- res += f", ({match}:{score})"
+ if shared.opts.interrogate_return_ranks:
+ res += f", ({match}:{score/100:.3f})"
else:
res += ", " + match
|