Skip to content

Tile Based Classification

Goal

Run the tile-based-classification.1.0.0.cwl released application package using cwltool.

Lab

This step has a dedicated lab available at /workspace/inference-eoap/practice-labs/Execution-scenario.ipynb

Step 1 - Configure the workspace

The results produced will be available in the local folder /workspace/inference-eoap/runs

terminal
1
2
3
4
export WORKSPACE=/workspace/inference-eoap
export RUNTIME=${WORKSPACE}/runs
mkdir -p ${RUNTIME}
cd ${RUNTIME}

Step 2 - Download the released Application package

scripts/download-app-inference.sh
1
2
3
4
5
6
7
version="1.0.0"

export WORKSPACE=/workspace/inference-eoap

wget \
    -O ${WORKSPACE}/runs/tile-based-classification.${version}.cwl \
    https://github.com/eoap/inference-eoap/releases/download/1.0.0/tile-based-classification.${version}.cwl

Step 3 - Execute the Application Package

scripts/exec-app-inference.sh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
version="1.0.0"

export WORKSPACE=/workspace/inference-eoap

# check if the results.json file exists
if [ ! -f ${WORKSPACE}/runs/results.json ]; then
    echo "results.json file not found, run the stage-and-cog.cwl workflow first."
    exit 1
fi

cwltool \
    --podman \
    --outdir ${WORKSPACE}/runs \
    ${WORKSPACE}/runs/tile-based-classification.${version}.cwl \
    --input-item $( cat ${WORKSPACE}/runs/results.json | jq -r .stac_catalog.path )

Expected outcome

The folder /workspace/inference-eoap/runs contains:

(base) jovyan@jupyter-fbrito--training:~/inference-eoap$ tree runs
runs
TODO
2 directories, 5 files