Improve code.

This commit is contained in:
corkborg
2023-10-01 19:17:25 +09:00
parent 0b8bec1ac6
commit cf0b86be80
2 changed files with 6 additions and 8 deletions
-6
View File
@@ -10,16 +10,11 @@ from pathlib import Path
from huggingface_hub import hf_hub_download
import re
# from tagger.deepbooru import re_special as tag_escape_pattern
tag_escape_pattern = re.compile(r'([\\()])')
# i'm not sure if it's okay to add this file to the repository
import tagger.dbimutils as dbimutils
# select a device to process
use_cpu = True
if use_cpu:
tf_device_name = '/cpu:0'
else:
@@ -29,7 +24,6 @@ class Interrogator:
@staticmethod
def postprocess_tags(
tags: Dict[str, float],
threshold=0.35,
additional_tags: List[str] = [],
exclude_tags: List[str] = [],