spreka / biomagdsb

This repository contains the codes to run the nuclei segmentation pipeline of the BIOMAG group inspired by Kaggle's Data Science Bowl 2018 competition
52 stars 15 forks source link

runGenerateValidationCustom.sh #15

Open chnlyi opened 2 years ago

chnlyi commented 2 years ago

Should I copy my train into $TRAIN_UNET and $TRAIN_MASKRCNN? What about my validation data? (I experimented a few times, but it seems that I have to runGenerateValidationCustom.sh using my validation data and copy both train and validation data into $TRAIN_UNET and $TRAIN_MASKRCNN.)

Yes, copy the train images there. Validation goes in the $VALIDATION folder which will be in kaggle_workflow/outputs/validation by default. Indeed you need to run runGenerateValidationCustom.sh /path/to/validationfolder, the $IMAGES_DIR variable in this script is only used to list the validation images, sorry for the confusing variable names.

Originally posted by @spreka in https://github.com/spreka/biomagdsb/issues/14#issuecomment-1150762680

chnlyi commented 2 years ago

Sorry, according to the code, these are the variables

WORKFLOW_ROOT="$ROOT_DIR/kaggle_workflow"
VALIDATION="$OUTPUTS_DIR/validation"
MASS_TRAIN_UNET="$OUTPUTS_DIR/train_unet"
TRAIN_MASKRCNN="$WORKFLOW_ROOT/inputs/train_maskrcnn"

and here is the .sh script

CONT_MAT_FILE="$MATLAB_SCRIPTS/generateValidation/validationFileNames.mat"
echo "GENERATE VALIDATION DATA FROM MASS_TRAIN_MASKRCNN:"
matlab -nodisplay -nodesktop -nosplash -nojvm -r "addpath('${MATLAB_SCRIPTS}/generateValidation');moveToValidation('${MASS_TRAIN_MASKRCNN}/','${VALIDATION}/','${CONT_MAT_FILE}');exit;"
if [ $? -ne 0 ]
then
    echo ERROR: "Error during generate validation maskrcnn"
    exit 1
fi
echo "GENERATE VALIDATION DATA FROM MASS_TRAIN_MASKRCNN DONE"

echo "GENERATE VALIDATION DATA FROM MASS_TRAIN_UNET:"
matlab -nodisplay -nodesktop -nosplash -nojvm -r "addpath('${MATLAB_SCRIPTS}/generateValidation');moveToValidation('${MASS_TRAIN_UNET}/','${VALIDATION}/','${CONT_MAT_FILE}');exit;"
if [ $? -ne 0 ]
then
    echo ERROR: "Error during generate validation unet"
    exit 1
fi
echo "GENERATE VALIDATION DATA FROM MASS_TRAIN_UNET DONE"

If I put my validation in the $VALIDATION, what do these 2 steps do?