-
Notifications
You must be signed in to change notification settings - Fork 10
Demorun 1 Running prediction with pre trained model
These steps skip the training and go straight to prediction by using a 30,000 iteration pretrained mitochrondria model that has been preloaded.
Step 1) Connect via ssh to instance created by these instructions
ssh ubuntu@PublicDNS_VALUEFROM_WEBPAGE_ABOVE
Here are the commands to run once logged into the instance. Below in Steps 2+ are more detailed instructions on what is happening. The commands below will take 15 minutes to run on p2.xlarge and even less on p3.2xlarge instance.
cd ~
runprediction.sh ~/sbem/mitochrondria/xy5.9nm40nmz/30000iterations_train_out ~/cdeep3m/mito_testsample/testset/ ~/predictout30k
EnsemblePredictions.m ~/predictout30k/1fm ~/predictout30k/3fm ~/predictout30k/5fm ~/predictout30k/ensembled
# results are in ~/predictout30k/ensembled
ls ~/predictout30k/ensembled
This step runs caffe prediction writing results to ~/predictout30k directory and takes about 3-5 minutes.
runprediction.sh ~/train_out/ ~/cdeep3m/mito_testsample/testset/ ~/predictout30k
Output:
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
Verifying input training data is valid ... skipping check, TODO need to fix this.
Verifying image data and getting Pkg folders ... skipping check, TODO need to fix this.
Creating output directories and creating run scripts ... success
A new directory has been created: /home/ubuntu/predictout30k
In this directory are 3 directories 1fm,3fm,5fm which
will contain the results from running prediction with caffe
There are also two scripts:
caffe_predict.sh -- Runs caffe prediction single model
run_all_predict.sh -- Runs caffe_predict.sh serially for all 3 models
Running Prediction
Trained Model Dir: /home/ubuntu/sbem/mitochrondria/xy5.9nm40nmz/30000iterations_train_out
Image Dir: /home/ubuntu/mito_testaugimages/
Running 1fm predict 1 package(s) to process
Processing Pkg001_Z01 1 of 1 ................
Running StartPostprocessing.m /home/ubuntu/predictout30k/1fm/Pkg001_Z01
Running Merge_LargeData.m /home/ubuntu/predictout30k/1fm
real 140.78
user 52.74
sys 26.08
Running 3fm predict 1 package(s) to process
Processing Pkg001_Z01 1 of 1 ................
Running StartPostprocessing.m /home/ubuntu/predictout30k/3fm/Pkg001_Z01
Running Merge_LargeData.m /home/ubuntu/predictout30k/3fm
real 95.75
user 66.90
sys 27.04
Running 5fm predict 1 package(s) to process
Processing Pkg001_Z01 1 of 1 ................
Running StartPostprocessing.m /home/ubuntu/predictout30k/5fm/Pkg001_Z01
Running Merge_LargeData.m /home/ubuntu/predictout30k/5fm
real 97.15
user 67.03
sys 26.78
Prediction has completed. Have a nice day!
Prediction has completed. Results are stored in /home/ubuntu/predictout30k
Have a nice day!
Merges segmentations from 1fm, 3fm, and 5fm models. Final segmentations will be put in directory specified by last argument to EnsemblePredictions.m in case below its ~/predictout30k/ensembled which will contain a set of 8-bit grayscale png files where pixel intensity denotes likelihood of feature that model was trained to detect. This step only takes a few seconds to run.
EnsemblePredictions.m ~/predictout30k/1fm ~/predictout30k/3fm ~/predictout30k/5fm ~/predictout30k/ensembled
Output:
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
warning: your version of GraphicsMagick limits images to 16 bits per pixel
warning: called from
imformats>default_formats at line 256 column 11
imformats at line 79 column 3
imageIO at line 106 column 11
imread at line 106 column 30
/home/ubuntu/cdeep3m/EnsemblePredictions.m at line 50 column 31
Saving Image # 1 of 5: /home/ubuntu/predictout30k/ensembled/Segmented_0001.png
Saving Image # 2 of 5: /home/ubuntu/predictout30k/ensembled/Segmented_0002.png
Saving Image # 3 of 5: /home/ubuntu/predictout30k/ensembled/Segmented_0003.png
Saving Image # 4 of 5: /home/ubuntu/predictout30k/ensembled/Segmented_0004.png
Saving Image # 5 of 5: /home/ubuntu/predictout30k/ensembled/Segmented_0005.png
Elapsed time for merging predictions is 000002 seconds.
The final results can be seen when running ls
ls ~/predictout30k/ensembled
Output:
Segmented_0001.png Segmented_0003.png Segmented_0005.png
Segmented_0002.png Segmented_0004.png