@@ -60,7 +60,8 @@ int main(int argc, char** argv)
6060 }
6161 else
6262 {
63- loggingDir = dataDir + " /logs" ;
63+ loggingDir = cbica::createTemporaryDirectory () + " /logs" ;
64+ std::cout << " Using the following directory as logging directory: " << loggingDir << " \n " ;
6465 cbica::createDir (loggingDir);
6566 }
6667
@@ -398,30 +399,38 @@ int main(int argc, char** argv)
398399 } // end of trainingRequested check
399400 else // for training
400401 {
401- std::string specialArgs, args, hardcodedModelName;
402- if (trainingRequested)
403- {
404- specialArgs = " -col " + colName;
405- }
406-
402+ std::string args = " -d " + dataDir + " -ld " + loggingDir + " -col " + colName + device_arg,
403+ hardcodedModelName;
404+
407405 if (!cbica::isFile (hardcodedPythonPath))
408406 {
409407 std::cerr << " The python virtual environment was not found, please refer to documentation to initialize it.\n " ;
410408 return EXIT_FAILURE;
411409 }
410+
411+ {
412+ std::cout << " Starting model validation of 3DResUNet trained on BraTS20 training data...\n " ;
413+
414+ // brats20 model validation
415+ std::string fullCommandToRun = hardcodedPythonPath + " " + fetsApplicationPath;
416+ fullCommandToRun += " /OpenFederatedLearning/bin/run_fets_validation.py" ;
417+
418+ auto temp_args = args + " -p fets_phase1_validate_full_brats_trained_model_1.yaml" ;
419+
420+ if (std::system ((fullCommandToRun + " " + temp_args).c_str ()) != 0 )
421+ {
422+ std::cerr << " Couldn't complete the BraTS20 model validation task, please email admin@fets.ai\n " ;
423+ }
424+ }
412425
413426 std::string fullCommandToRun = hardcodedPythonPath + " " + fetsApplicationPath;
414427 fullCommandToRun += " /OpenFederatedLearning/bin/run_collaborator_from_flplan.py" ;
415428
416- args += " -p " + hardcodedPlanName + " .yaml"
417- + " -d " + dataDir
418- + " -ld " + loggingDir;
419-
420- args += device_arg;
429+ auto temp_args = args + " -p " + hardcodedPlanName + " .yaml" ;
421430
422431 std::cout << " Starting training...\n " ;
423432
424- if (runCollaboratorTraining (fullCommandToRun + " " + args + " " + specialArgs ) != 0 )
433+ if (runCollaboratorTraining (fullCommandToRun + " " + temp_args ) != 0 )
425434 {
426435 std::cerr << " Couldn't complete the training task, please email admin@fets.ai\n " ;
427436 return EXIT_FAILURE;
0 commit comments