<jupyter_start><jupyter_text>Sealnet -- deployment---This jupyter allows you to make predictions on your own images with the seal detection pipeline. *WARNING* : CNNs used here were trained on panchromatic WorldView-3 imagery so results may not be satisfactory on different imagery / color bands.   Load packages<jupyter_code>import os<jupyter_output><empty_output><jupyter_text>Call detection pipeline Though you are free to try different combinations, the current setup of CNNs provides the best results on our test images.<jupyter_code># select training set, model and hyperparameters
t_dir = 'training_set_vanilla'
mod_arch = 'UnetCntWRNOccDense'
hyp_set = 'E'

# setup input folder ** change here **
inp_fldr = '/home/bento/testing_scenes'

# setup output folder ** change here **
out_fldr = './sealnet_predictions_test'

# loop through images
inp_imgs = [img for img in os.listdir('{}'.format(inp_fldr)) if img[-4:] == '.tif']
for img in inp_imgs:
    img_path = '{}/{}'.format(inp_fldr, img)
    # call pipeline 
    !python predict_raster.py --input_image=$img_path \
                              --model_architecture=$mod_arch \
                              --hyperparameter_set=$hyp_set \
                              --training_dir=$t_dir --dest_folder=$out_fldr<jupyter_output>31838 tiles created in 0 minutes and 37.18 seconds

Predicting with sealnet_predictions_test:
Testing complete in 0.0h 5m 5s
    Total predicted in WV03_20170203044432_1040010028C45900_17FEB03044432-P1BS-501172834040_01_P001_u08rf3031.tif:  333

43335 tiles created in 0 minutes and 52.58 seconds

Predicting with sealnet_predictions_test:
Testing complete in 0.0h 6m 40s
    Total predicted in WV03_20170202190457_1040010028965400_17FEB02190457-P1BS-501172778010_01_P004_u08rf3031.tif:  0

31991 tiles created in 0 minutes and 44.20 seconds

Predicting with sealnet_predictions_test:
Testing complete in 0.0h 5m 4s
    Total predicted in WV03_20170204000736_104001002678E600_17FEB04000736-P1BS-501513717060_01_P001_u08rf3031.tif:  98

19586 tiles created in 0 minutes and 24.68 seconds

Predicting with sealnet_predictions_test:
Testing complete in 0.0h 3m 6s
    Total predicted in WV03_20170202221638_104001002983B700_17FEB02221638-P1BS-501174626090_01_P002_u08rf3031.tif:  30

34577 tiles create[...]<jupyter_text>Testing predictions<jupyter_code># setup output folder ** change here **
inp_fldr = 'sealnet_predictions_test'
mod_arch = 'UnetCntWRN'
out_fldr = '{}/merged_shapefiles_{}/'.format(inp_fldr, mod_arch)

# merge shapefiles
!python merge_shapefiles.py --input_dir=$inp_fldr --output_dir=$out_fldr

# test predictions
shp_prediction = '{}/merged_locations.dbf'.format(out_fldr)
shp_ground_truth = './shape_files/seal-points-test.dbf'
output_file = '{}/{}_prec_recall.csv'.format(inp_fldr, mod_arch)

!python test_sealnet.py --shp_prediction=$shp_prediction \
                        --shp_ground_truth=$shp_ground_truth \
                        --tolerance=3 \
                        --output_file=$output_file<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08303249097472924, 'fraction_numerical': 0.10961601575319987, 'mean_word_length': 4.237113402061856, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '544716', 'license': 'MIT', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1055, 'n_words': 246, 'path': 'validation_suite/deploy_sealnet.ipynb', 'repo_name': 'iceberg-project/Seals', 'size': '3047'}