diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-19 06:43:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 06:43:49 +0000 |
commit | 05315d8a236e252221bbbdd9e8f459b8a31c3524 (patch) | |
tree | 0bce187060568747888571fafedca4974fe17af3 /modules/interrogate.py | |
parent | 9a33292ce41b01252cdb8ab6214a11d274e32fa0 (diff) | |
parent | 1d4aa376e6111e90888a30ae24d2bcd7f978ec51 (diff) | |
download | stable-diffusion-webui-gfx803-05315d8a236e252221bbbdd9e8f459b8a31c3524.tar.gz stable-diffusion-webui-gfx803-05315d8a236e252221bbbdd9e8f459b8a31c3524.tar.bz2 stable-diffusion-webui-gfx803-05315d8a236e252221bbbdd9e8f459b8a31c3524.zip |
Merge branch 'master' into hot-reload-javascript
Diffstat (limited to 'modules/interrogate.py')
-rw-r--r-- | modules/interrogate.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/interrogate.py b/modules/interrogate.py index 9263d65a..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,10 +156,10 @@ 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 += ", " + match
+ if shared.opts.interrogate_return_ranks:
+ res += f", ({match}:{score/100:.3f})"
else:
- res += f", ({match}:{score})"
+ res += ", " + match
except Exception:
print(f"Error interrogating", file=sys.stderr)
|