Skip to content

Commit

Permalink
Merge pull request #70 from WorldCereal/pr-fix-67
Browse files Browse the repository at this point in the history
PR 67 fixes
  • Loading branch information
kvantricht authored Jun 21, 2024
2 parents af569d3 + fac6cb2 commit afe6678
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions scripts/inference/cropland_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

from worldcereal.job import generate_map

ONNX_DEPS_URL = "https://artifactory.vgt.vito.be/artifactory/auxdata-public/openeo/onnx_dependencies_1.16.3.zip"

if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="WC - Cropland Inference",
Expand Down
7 changes: 5 additions & 2 deletions src/worldcereal/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from openeo_gfmap import BackendContext, BoundingBoxExtent, TemporalContext
from openeo_gfmap.features.feature_extractor import apply_feature_extractor
from openeo_gfmap.inference.model_inference import apply_model_inference
from openeo_gfmap.preprocessing.scaling import compress_uint8
from openeo_gfmap.preprocessing.scaling import compress_uint8, compress_uint16

from worldcereal.openeo.feature_extractor import PrestoFeatureExtractor
from worldcereal.openeo.inference import CroplandClassifier
Expand Down Expand Up @@ -95,7 +95,10 @@ def generate_map(
)

# Cast to uint8
classes = compress_uint8(classes)
if product == "cropland":
classes = compress_uint8(classes)
else:
classes = compress_uint16(classes)

classes.execute_batch(
outputfile=output_path,
Expand Down

0 comments on commit afe6678

Please sign in to comment.