V 2.2.10 新增MJ的代理模式
This commit is contained in:
@@ -15,9 +15,10 @@ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
|
||||
if len(sys.argv) < 2:
|
||||
sys.argv = [
|
||||
"C:\\Users\\27698\\Desktop\\LAITool\\resources\\scripts\\Lai.exe",
|
||||
"-c",
|
||||
"C:/Users/27698/Desktop/测试/mjTest/scripts/output_crop_00001.json",
|
||||
"NVIDIA",
|
||||
"-ka",
|
||||
"C:\\Users\\27698\\Desktop\\测试\\123\\测试用 不删.mp4",
|
||||
"C:\\Users\\27698\\Desktop\\测试\\123\\测试用 不删.json",
|
||||
30
|
||||
]
|
||||
|
||||
print(sys.argv)
|
||||
@@ -84,6 +85,10 @@ elif sys.argv[1] == "-k":
|
||||
getgrame.init(sys.argv[2], sys.argv[3], sys.argv[4])
|
||||
pass
|
||||
|
||||
elif sys.argv[1] == "-ka":
|
||||
shotSplit.get_fram(sys.argv[2], sys.argv[3], sys.argv[4])
|
||||
pass
|
||||
|
||||
# 智能分镜。字幕识别
|
||||
elif sys.argv[1] == "-a":
|
||||
print("开始算法分镜:" + sys.argv[2] + " -- 输出文件夹:" + sys.argv[3])
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,6 +6,7 @@ from scenedetect.stats_manager import StatsManager
|
||||
from scenedetect.detectors.content_detector import ContentDetector
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import subprocess
|
||||
from huggingface_hub import hf_hub_download
|
||||
from faster_whisper import WhisperModel
|
||||
@@ -228,6 +229,22 @@ def GetText(out_folder, mp3_list):
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def get_fram(video_path, out_path, sensitivity):
|
||||
try:
|
||||
shijian_list = find_scenes(video_path, sensitivity) # 多组时间列表
|
||||
print("总共有%s个场景" % str(len(shijian_list)))
|
||||
print("开始输出json")
|
||||
print(shijian_list)
|
||||
# 将数组中的消息写道json文件中
|
||||
with open(out_path, "w") as file:
|
||||
# 将数组写入到指定的json文件
|
||||
json.dump(shijian_list, file)
|
||||
print("输出完成")
|
||||
except Exception as e:
|
||||
print("出现错误" + str(e))
|
||||
exit(0)
|
||||
|
||||
|
||||
def init(video_path, video_out_folder, image_out_folder, sensitivity, gpu_type):
|
||||
v_l = ClipVideo(
|
||||
video_path, video_out_folder, image_out_folder, sensitivity, gpu_type
|
||||
|
||||
Reference in New Issue
Block a user