1 Star 0 Fork 0

qinix/breast_cancer_classifier

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run_single.sh 2.32 KB
一键复制 编辑 原始数据 按行查看 历史
Jason Phang 提交于 2019-07-29 14:46 . TensorFlow Implementation
#!/bin/bash
DEVICE_TYPE='gpu'
NUM_EPOCHS=10
HEATMAP_BATCH_SIZE=100
GPU_NUMBER=0
PATCH_MODEL_PATH='models/sample_patch_model.p'
IMAGE_MODEL_PATH='models/ImageOnly__ModeImage_weights.p'
IMAGEHEATMAPS_MODEL_PATH='models/ImageHeatmaps__ModeImage_weights.p'
SAMPLE_SINGLE_OUTPUT_PATH='sample_single_output'
export PYTHONPATH=$(pwd):$PYTHONPATH
echo 'Stage 1: Crop Mammograms'
python3 src/cropping/crop_single.py \
--mammogram-path $1 \
--view $2 \
--cropped-mammogram-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped.png \
--metadata-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped_metadata.pkl
echo 'Stage 2: Extract Centers'
python3 src/optimal_centers/get_optimal_center_single.py \
--cropped-mammogram-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped.png \
--metadata-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped_metadata.pkl
echo 'Stage 3: Generate Heatmaps'
python3 src/heatmaps/run_producer_single.py \
--model-path ${PATCH_MODEL_PATH} \
--cropped-mammogram-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped.png \
--metadata-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped_metadata.pkl \
--batch-size ${HEATMAP_BATCH_SIZE} \
--heatmap-path-malignant ${SAMPLE_SINGLE_OUTPUT_PATH}/malignant_heatmap.hdf5 \
--heatmap-path-benign ${SAMPLE_SINGLE_OUTPUT_PATH}/benign_heatmap.hdf5\
--device-type ${DEVICE_TYPE} \
--gpu-number ${GPU_NUMBER}
echo 'Stage 4a: Run Classifier (Image)'
python3 src/modeling/run_model_single.py \
--view $2 \
--model-path ${IMAGE_MODEL_PATH} \
--cropped-mammogram-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped.png \
--metadata-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped_metadata.pkl \
--use-augmentation \
--num-epochs ${NUM_EPOCHS} \
--device-type ${DEVICE_TYPE} \
--gpu-number ${GPU_NUMBER}
echo 'Stage 4b: Run Classifier (Image+Heatmaps)'
python3 src/modeling/run_model_single.py \
--view $2 \
--model-path ${IMAGEHEATMAPS_MODEL_PATH} \
--cropped-mammogram-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped.png \
--metadata-path ${SAMPLE_SINGLE_OUTPUT_PATH}/cropped_metadata.pkl \
--use-heatmaps \
--heatmap-path-malignant ${SAMPLE_SINGLE_OUTPUT_PATH}/malignant_heatmap.hdf5 \
--heatmap-path-benign ${SAMPLE_SINGLE_OUTPUT_PATH}/benign_heatmap.hdf5\
--use-augmentation \
--num-epochs ${NUM_EPOCHS} \
--device-type ${DEVICE_TYPE} \
--gpu-number ${GPU_NUMBER}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qinix2/breast_cancer_classifier.git
git@gitee.com:qinix2/breast_cancer_classifier.git
qinix2
breast_cancer_classifier
breast_cancer_classifier
master

搜索帮助