# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 2
#     language: python
#     name: python2
# ---

# ## iceberg_seals.predicting -- deployment
#
# ---
#
# This jupyter notebook sets up and performs predictions for the ICEBERG Seals use case but can be used for general apllication of any trained Unet-type CNN model.

# ### Install code

import os
os.system('module load cuda')
os.system('module load python3')
os.system('virtualenv iceberg_seals')
os.system('source iceberg_seals/bin/activate')
os.system('export PYTHONPATH=iceberg_seals/lib/python3.5/site-packages')
os.system('pip install iceberg_seals.search')

# ### Set parameters
#
# ---
#
# These default parameters can be changed if needed. Input image filename must be supplied
#  

tile_size = 299
input_img=<filename>
input_dir = './IN'
output_dir = './test_image'
t_dir = 'training_set_vanilla'
mod_arch = 'UnetCntWRN'
hyp_set = 'A'

# ### Run tiling

iceberg_seals.predicting --input_image=input_img --model_architecture=mod_arch --hyperparameter_set=hyp_set --training_set=t_dir --test_folder=input_dir --model_path=./ --output_folder=output_dir

StarcoderdataJupyterScriptsDedupFiltered