def write(self, labelsPath, windowsPath): """Write the combined labels and windows to destination directories.""" if not os.path.isdir(labelsPath): createPath(labelsPath) if not os.path.isdir(windowsPath): createPath(windowsPath) writeJSON(labelsPath, self.labelTimestamps) writeJSON(windowsPath, self.combinedWindows)
def createThresholds(detectorName, thresholdFile): """"Create an entry in the threshold file for the new detector.""" oldThresholds = getOldDict(thresholdFile) if detectorName not in oldThresholds: oldThresholds[detectorName] = {} writeJSON(thresholdFile, oldThresholds)
def write(self, labelsPath, windowsPath): """Write the combined labels and windows to a destination directories.""" if not os.path.isdir(labelsPath): createPath(labelsPath) if not os.path.isdir(windowsPath): createPath(windowsPath) writeJSON(labelsPath, self.labelTimestamps) writeJSON(windowsPath, self.combinedWindows)
def setUp(self): oldThresholds = { "lucky_detector": { "standard": { "score": 13.0, "threshold": 0.7 } }, "deep_thought": { "standard": { "score": 42.0, "threshold": 0.9 } } } root = os.path.dirname(os.path.realpath(__file__)) self.thresholdsPath = os.path.join(root, "thresholds.json") writeJSON(self.thresholdsPath, oldThresholds)