fix cammie tagger's fucked rating vocab
This commit is contained in:
parent
90695c0310
commit
2550320f9d
1 changed files with 15 additions and 2 deletions
17
main.py
17
main.py
|
@ -49,6 +49,7 @@ class Interrogator:
|
|||
model_id: str
|
||||
address: str
|
||||
threshold: float = 0.7
|
||||
_fucked_rating: bool = False
|
||||
|
||||
def _process(self, lst):
|
||||
return lst
|
||||
|
@ -93,6 +94,18 @@ class DDInterrogator(Interrogator):
|
|||
|
||||
|
||||
class SDInterrogator(Interrogator):
|
||||
def _process(self, lst):
|
||||
new_lst = []
|
||||
for tag in lst:
|
||||
if self._fucked_rating and tag.startswith("rating_"):
|
||||
_, rating = tag.split("_")
|
||||
# remap vocabs for fucked vocabs
|
||||
original_danbooru_tag = rating
|
||||
else:
|
||||
original_danbooru_tag = tag
|
||||
new_lst.append(original_danbooru_tag)
|
||||
return new_lst
|
||||
|
||||
async def interrogate(self, ctx, path):
|
||||
async with aiofiles.open(path, "rb") as fd:
|
||||
as_base64 = base64.b64encode(await fd.read()).decode("utf-8")
|
||||
|
@ -155,8 +168,8 @@ class Config:
|
|||
]
|
||||
+ [
|
||||
DDInterrogator(self.dd_model_name, self.dd_address),
|
||||
SDInterrogator("camie-tagger-v1", self.camie_address, 0.325),
|
||||
SDInterrogator("joytag-v1", self.joytag_address, 0.4),
|
||||
SDInterrogator("camie-tagger-v1", self.camie_address, 0.5, True),
|
||||
SDInterrogator("joytag-v1", self.joytag_address, 0.5),
|
||||
]
|
||||
+ [ControlInterrogator("control", None)]
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue