diff options
author | MalumaDev <piano.lu92@gmail.com> | 2022-10-18 06:55:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 06:55:08 +0000 |
commit | 1997ccff13fc75af223f571e8c927c3d77273dd9 (patch) | |
tree | d3d8e4e64c1fb595bef205e531b03418328331f7 /modules/interrogate.py | |
parent | 589215df22d24d560101ba2b1fd7aaf3233f466e (diff) | |
parent | 7432b6f4d2c3001895fc75411a34afae1810c1a2 (diff) | |
download | stable-diffusion-webui-gfx803-1997ccff13fc75af223f571e8c927c3d77273dd9.tar.gz stable-diffusion-webui-gfx803-1997ccff13fc75af223f571e8c927c3d77273dd9.tar.bz2 stable-diffusion-webui-gfx803-1997ccff13fc75af223f571e8c927c3d77273dd9.zip |
Merge branch 'master' into test_resolve_conflicts
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)
|