def writeFiles(self, outDir, writeLabels = True): dir_tools.mkdir_ask(outDir) if writeLabels: ann.MultiLabeler.writeFiles(self,outDir) with open(os.path.join(outDir,"classifier.pkl"),"w") as fh: cPickle.dump(self.cls, fh) np.savetxt(os.path.join(outDir,"coeffs.txt"),self.cls.classifier.coef_) np.savetxt(os.path.join(outDir,"intercepts.txt"),self.cls.classifier.intercept_)
def writeFiles(self, outDir): dir_tools.mkdir_ask(outDir) for (i,image) in enumerate(self.images): outFile = "%s.label.png"%os.path.basename(self.imageFiles[i]) cv2.imwrite(os.path.join(outDir,outFile),self.labels[i]) with open(os.path.join(outDir,"label_info.json"),"w") as fh: json.dump( dict([(i, "LABEL_DESCRIPTION") for i in xrange(self.labelWindow.maxLabel)]), fh) print "wrote files to",outDir
def resetDataDir(): dir_tools.mkdir_ask(DATA_ROOT, make_path=True) os.mkdir(join(DATA_ROOT, "once"))
def __init__(self, topic, extension): self.topic = topic self.extension = extension dir_tools.mkdir_ask(topicPath(topic), make_path=True)
def __init__(self, topic, extension): Publisher.__init__(self, topic) self.names = Names(topic, extension) dir_tools.mkdir_ask(topicPath(topic), make_path=True)
def resetDataDir(): dir_tools.mkdir_ask(DATA_ROOT,make_path=True) os.mkdir(join(DATA_ROOT,"once"))
def __init__(self,topic,extension): self.topic = topic self.extension = extension dir_tools.mkdir_ask(topicPath(topic),make_path=True)
def __init__(self,topic,extension): Publisher.__init__(self,topic) self.names = Names(topic,extension) dir_tools.mkdir_ask(topicPath(topic),make_path=True)