def main(): args = parseArgs() function = args.function input_file = args.input output_file = args.output true_file = args.trueout result_file = args.result method = args.method if function == ("Pred" or "Predict"): if input_file == "": print("Error - Read inputs") elif output_file == "": print("Error - Write output") else: prediction(input_file, output_file, method) elif function == ("Eval" or "Evaluate"): if input_file == "" or true_file == "": print("Error - Read inputs") elif output_file == "": print("Error - Write output") else: evaluate(input_file, output_file, true_file, result_file) else: print("Please choose 'Pred' function or 'Eval' function")
else: saver.restore(sess, config.weightsFile(epoch)) evalRes = runEvaluation(sess, model, data["main"], epoch, evalTest=True, raw=config.raw_image) extraEvalRes = runEvaluation(sess, model, data["extra"], epoch, evalTrain=not config.extraVal, evalTest=True, raw=config.raw_image) print("took {:.2f} seconds".format(time.time() - start)) printDatasetResults(None, evalRes, extraEvalRes) print("Writing predictions...") writePreds(preprocessor, evalRes, extraEvalRes) print(bcolored("Done!", "white")) if __name__ == '__main__': parseArgs() loadDatasetConfig[config.dataset]() main()