Views
No views yet
sha256==8452cddf280b952281b6e102411c50e981cb29081onnx == 1.14.0
2tf2onnx == 1.14.0
3tensorflow == 2.12.0
41# modified from "SmilingWolf/wd-v1-4-moat-tagger-v2"
2# 8452cddf280b952281b6e102411c50e981cb2908
3
4# 输入 ['input_1']
5# 输出 ['predictions_sigmoid', 'predictions_dense', 'predictions_norm', 'predictions_globalavgpooling'] # 最左边是最外层
6
7[[input]]
8name = "input_1" # 原始模型就有
9shape = [ "None", 448, 448, 3,]
10dtype = "float32"
11
12[[output]]
13name = "predictions_sigmoid" # 原始模型就有
14shape = [ "None", 9083,]
15dtype = "float32"
16
17[[output]]
18name = "predictions_dense"
19shape = [ "None", 9083,]
20dtype = "float32"
21
22[[output]]
23name = "predictions_norm"
24shape = [ "None", 1024,]
25dtype = "float32"
26
27[[output]]
28name = "predictions_globalavgpooling"
29shape = [ "None", 1024,]
30dtype = "float32"
31wd14_tags.tomlwd-v1-4-moat-tagger-v2/selected_tags.csv[rating] means category == 9 in selected_tags.csv[general] means category == 0 in selected_tags.csv[character] means category == 4 in selected_tags.csvcandidate_labels_scores_*.npz1import numpy as np
2import pandas as pd
3import toml
4
5with open("wd14_tags.toml", "r") as f:
6 general_tags = toml.load(f)["tags"][1]["tags"] # 0 -> rating, 1 -> general, 2 -> characters
7
8with np.load("candidate_labels_scores_safetensors.npz") as data:
9 candidate_labels = data["candidate_labels"] # Similar to `[candidate_labels]` in `wd14_tags.toml`
10 scores = data["scores"]
11
12df = pd.DataFrame(
13 scores,
14 index=candidate_labels,
15 columns=general_tags,
16)
17sha256 == 6a7865dd24917225ec499fad77e91b97baedf7da