The implementation of MAE is adopted from here, thanks very much!
-
Crop the whole histology image to spot patches according to the spatial coordinates, and stack them in
npy
file. Please note that the size of cropped patches should be 224*224. -
run MAE to extract features
# Set the path to save images
OUTPUT_DIR='output/'
# path to image for visualization
PATCHES_PATH='/path/to/cropped/patches.npy'
# path to pretrain model
MODEL_PATH='/path/to/pretrain/checkpoint.pth'
python run_mae_extract_feature.py ${PATCHES_PATH} ${OUTPUT_DIR} ${MODEL_PATH}
The pretrained weights can be found using the link from the original repository here