本文整理汇总了Python中Client.run方法的典型用法代码示例。如果您正苦于以下问题:Python Client.run方法的具体用法?Python Client.run怎么用?Python Client.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: segment
# 需要导入模块: import Client [as 别名]
# 或者: from Client import run [as 别名]
def segment(self):
"""
Calls the Client class to perform segmenting. Handles bound checking
errors. Fills in segment register and updates GUI (button activation).
"""
self.setControls(False)
self.currSegment = 0
#Get all the correct options and create a client
cap = None
try:
start = int(self.ui.startFrame.text())
end = int(self.ui.endFrame.text())
splitType = self.getSplitType()
clusterType = self.getClusterType()
comparisonMethod = self.getComparisonMethod()
options = {}
if splitType == SplitType.EVERY_X_SECONDS:
options["xSeconds"] = int(self.ui.xSecs.value())
options["clusterThreshold"] = float(self.ui.clusterThreshold.value())
options["k"] = int(self.ui.kValue.value())
options["cutoff"] = float(self.ui.shiftCutoff.value())
options["maxIterations"] = int(self.ui.maxIters.value())
options["segmentLength"] = int(self.ui.segmentLength.value())
options["audio"] = str(self.ui.filePath.text())
options["clusterAlgorithm"] = clusterType
if clusterType == FaceClustering.standardCluster:
options["comparator"] = comparisonMethod
else:
options["comparator"] = FaceClustering.PCAComparator
cap = Client(str(self.ui.filePath.text()), splitType,
lambda x: self.setProgress(x),
lambda x: self.setState(x),
start, end)
except IOError:
return self.errorBox("Jasper")
except (ValueError, BoundsError):
return self.errorBox("Ben")
# create Segmenter object to segment the video
self.seg = Segmenter()
# call Client.run, which in turn calls Segmenter.run to perform the segmentation
segmentNames = cap.run(self.seg, self.ui.highlightFacesOption.isChecked(), "MP42", "mkv", True, options)
if "clusters" in options:
self.genIndexing(segmentNames, options["clusters"])
else:
self.genIndexing(segmentNames, [])
self.fillFaces()
self.fillList(segmentNames)
#load segments into the GUI, ignoring start and end frames
self.segments = SegmentRegister(segmentNames)
#self.ui.videoBackground.hide()
self.setControls(True)
self.updatePreviousNextButton()
self.load(self.segments.current())
self.showVideoScreen()
self.selectListEntry()