Пример #1
0
 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_)
Пример #2
0
 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
Пример #3
0
def resetDataDir():
    dir_tools.mkdir_ask(DATA_ROOT, make_path=True)
    os.mkdir(join(DATA_ROOT, "once"))
Пример #4
0
 def __init__(self, topic, extension):
     self.topic = topic
     self.extension = extension
     dir_tools.mkdir_ask(topicPath(topic), make_path=True)
Пример #5
0
 def __init__(self, topic, extension):
     Publisher.__init__(self, topic)
     self.names = Names(topic, extension)
     dir_tools.mkdir_ask(topicPath(topic), make_path=True)
Пример #6
0
def resetDataDir():
    dir_tools.mkdir_ask(DATA_ROOT,make_path=True)
    os.mkdir(join(DATA_ROOT,"once"))
Пример #7
0
 def __init__(self,topic,extension):
     self.topic = topic
     self.extension = extension
     dir_tools.mkdir_ask(topicPath(topic),make_path=True)
Пример #8
0
 def __init__(self,topic,extension):
     Publisher.__init__(self,topic)
     self.names = Names(topic,extension)
     dir_tools.mkdir_ask(topicPath(topic),make_path=True)