def setup_method(self, method): v = _volume() self.op = OpDetectMissing(graph=Graph()) self.op.InputVolume.setValue(v) self.op.PatchSize.setValue(64) self.op.HaloSize.setValue(0) self.op.DetectionMethod.setValue("svm") self.op.train(force=True)
def testDetectorOmnipresence(self): assert self.op.has(self.op.NHistogramBins.value, method="svm"), "Detector is untrained after call to train()" assert not self.op.has(self.op.NHistogramBins.value + 2, method="svm"), "Wrong bin size trained." op2 = OpDetectMissing(graph=Graph()) assert op2.has(self.op.NHistogramBins.value, method="svm"), "Trained detectors are not global" self.op.reset() assert not self.op.has(self.op.NHistogramBins.value, method="svm"), "Detector not reset." assert not op2.has(self.op.NHistogramBins.value, method="svm"), "Detector not reset globally."