Commit b99d3cf6 authored by AUTOMATIC's avatar AUTOMATIC

make CLIP interrogate ranks output sane values

parent 5c94aaf2
...@@ -123,7 +123,7 @@ class InterrogateModels: ...@@ -123,7 +123,7 @@ class InterrogateModels:
return caption[0] return caption[0]
def interrogate(self, pil_image, include_ranks=False): def interrogate(self, pil_image):
res = None res = None
try: try:
...@@ -156,8 +156,8 @@ class InterrogateModels: ...@@ -156,8 +156,8 @@ class InterrogateModels:
for name, topn, items in self.categories: for name, topn, items in self.categories:
matches = self.rank(image_features, items, top_count=topn) matches = self.rank(image_features, items, top_count=topn)
for match, score in matches: for match, score in matches:
if include_ranks: if shared.opts.interrogate_return_ranks:
res += f", ({match}:{score})" res += f", ({match}:{score/100:.3f})"
else: else:
res += ", " + match res += ", " + match
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment