def Kfold(): databaseinfo = GetDataDictionary(settings.options.dbfile) for iii in range(settings.options.kfolds): OneKfold(i=iii, datadict=databaseinfo)
import settings from settings import process_options, perform_setup (options, args) = process_options() IMG_DTYPE, SEG_DTYPE, _globalnpfile, _globalexpectedpixel, _nx, _ny = perform_setup( options) print('database file: %s ' % settings._globalnpfile) from setupmodel import GetDataDictionary, BuildDB from trainmodel import TrainModel from predictmodel import PredictModel from kfolds import OneKfold, Kfold if options.builddb: BuildDB() if options.kfolds > 1: if options.idfold > -1: databaseinfo = GetDataDictionary(options.dbfile) OneKfold(i=options.idfold, datadict=databaseinfo) else: Kfold() if options.trainmodel and options.kfolds == 1: # no kfolds, i.e. k=1 TrainModel() if options.predictmodel: PredictModel() if ((not options.builddb) and (not options.trainmodel) and (not options.predictmodel) and (options.kfolds == 1)): print("parser error")