当前位置: 首页>>代码示例>>Python>>正文


Python Client.run方法代码示例

本文整理汇总了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()
开发者ID:animeshsahay,项目名称:icl_video_segmentation,代码行数:67,代码来源:DesktopClient.py


注:本文中的Client.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。