bug修复,提示优化

This commit is contained in:
AbyssYuan0
2024-01-16 15:26:59 +08:00
parent 4d9a2b9fed
commit 299dd76065
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -480,7 +480,7 @@ class VideoCutFromDir:
"required": {
"frame_dir": ("STRING", {"default": None}),
"threshold": ("FLOAT", {
"default": 0.5,
"default": 0.7,
"min": 0.01,
"max": 1.0,
"step": 0.01,
+5 -3
View File
@@ -57,19 +57,21 @@ def getCutList(imagePath, threshold, min_frame, max_frame):
i += 1
i = min_frame - 1
threshold = (sum(resList) / len(resList)) * threshold
avg = sum(resList) / len(resList)
threshold = avg * threshold
while i < len(pngList) - 1:
if num >= max_frame:
num = 0
cutList.append(pngList[i])
i += min_frame
elif similarity < threshold:
elif resList[i] < threshold:
num = 0
cutList.append(pngList[i])
i += min_frame
else:
i += 1
print(resList)
print("平均计算阈值:"+str(avg)+" 处理阈值:"+str(threshold))
print(cutList)
return cutList