def compute(self, queue): OpticalFlow.Method.compute(self, queue) temp = Template( '/misc/software-lin/matlabR2013a/bin/matlab -nodesktop -nojvm -r "gbDetect(\'$imagePath\',1); exit"' ) command = temp.safe_substitute(imagePath=self.ent().img1Path()) job = tb.Job() job.setPath(self.path()) job.addCommand(command) queue.postJob(job)
def compute(self, queue): OpticalFlow.Method.compute(self, queue) ent = self.ent() input = self.spec().inputs()[0] inputPath = ent.inFile(input, "lowres.flo") if not os.path.exists(inputPath): raise Exception('input does not exist: %s' % inputPath) params = self.spec().params() paramStr = '' if 'b' in params and params['b'] == '1': paramStr += ' --boundaries=' + ent.boundaryPath() if 'delta' in params: paramStr += ' --delta=' + params['delta'] if 'beta' in params: paramStr += ' --beta=' + params['beta'] if 'sigma' in params: paramStr += ' --sigma=' + params['sigma'] os.system("rm -rf %s" % ent.outFile(str(self.spec()), 'flow.flo')) if ent.flowGTPath != None: temp = Template( 'VarFlowRefine $img1 $img2 $flo $out $params --groundtruth=$groundtruth --make-epe --make-stat' ) command = temp.safe_substitute( img1=ent.img1Path(), img2=ent.img2Path(), flo=inputPath, out=ent.outFile(str(self.spec()), 'flow.flo'), groundtruth='%s:%s:%s' % (ent.flowGTPath(), ent.occGTPath(), ent.mbdistGTPath()), params=paramStr) else: temp = Template('VarFlowRefine $img1 $img2 $flo $out $params') command = temp.safe_substitute(img1=ent.img1Path(), img2=ent.img2Path(), flo=inputPath, out=ent.outFile( str(self.spec()), 'flow.flo'), params=paramStr) job = tb.Job() job.setPath(self.path()) job.addCommand(command) queue.postJob(job)
def update(self): queue = tb.Queue() for m in self._methods: for ds in self._datasets: tb.notice('creating jobs for <%s> on <%s>' % (m, ds)) for ent in ds.uents() if m.direction() == '' else ds.bents(): job = tb.Job() ent.bind(m).makeUpdateJob(job) queue.postJob(job) queue.finishPacket() queue.submit(local=self._args.local, cores=self._args.cores)