Prepare patches
Script for creating small size patches given a specific patch size and sliding window size. Patches are saved only if at least a certain portion of pixels within the image are annotated to account for class imbalance. This percentage is also specified in the configuration file.
- Usage:
pip install rhizonet patchify_rhizonet –config_file ./setup_files/setup-prepare.json
- main()
- parse_prepare_variables(argparse_args)
Parse and merge training variables from a JSON configuration file and command-line arguments.
- Parameters
argparse_args (Namespace) – Command-line arguments parsed by argparse.
- Returns
Updated arguments
- Return type
Dict
- prepare_patches(args: Dict)
Create small size patches with the patch size and sliding windiw size given in the
prepare_patchesconfiguration file Patches are saved only if at least a certain portion of pixels within the image are annotated to account for class imbalance. This percentage is also specified in the configuration file.- Parameters
args (Dict) – dictionary of all processing arguments
- Returns
save the image in the specified folder
- Return type
None