예제 #1
0
파일: labeler.py 프로젝트: rvorias/NAB
    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)
예제 #3
0
파일: labeler.py 프로젝트: plexzhang/NAB
  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)
예제 #4
0
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)
예제 #5
0
 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)
 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)