MCPcopy Create free account
hub / github.com/TaoRuijie/TalkNet-ASD / scene_detect

Function scene_detect

demoTalkNet.py:76–93  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

74 args.savePath = os.path.join(args.videoFolder, args.videoName)
75
76def scene_detect(args):
77 # CPU: Scene detection, output is the list of each shot's time duration
78 videoManager = VideoManager([args.videoFilePath])
79 statsManager = StatsManager()
80 sceneManager = SceneManager(statsManager)
81 sceneManager.add_detector(ContentDetector())
82 baseTimecode = videoManager.get_base_timecode()
83 videoManager.set_downscale_factor()
84 videoManager.start()
85 sceneManager.detect_scenes(frame_source = videoManager)
86 sceneList = sceneManager.get_scene_list(baseTimecode)
87 savePath = os.path.join(args.pyworkPath, 'scene.pckl')
88 if sceneList == []:
89 sceneList = [(videoManager.get_base_timecode(),videoManager.get_current_timecode())]
90 with open(savePath, 'wb') as fil:
91 pickle.dump(sceneList, fil)
92 sys.stderr.write('%s - scenes detected %d\n'%(args.videoFilePath, len(sceneList)))
93 return sceneList
94
95def inference_video(args):
96 # GPU: Face detection, output is the list contains the face location and score in this frame

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected