Skip to content

Commit

Permalink
Also crop original
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo committed Feb 14, 2025
1 parent 3bbdc55 commit 7de8785
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/osm_ai_helper/run_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ def run_inference(
with open(f"{output_path}/{n}.json", "w") as f:
json.dump(lon_lat_polygon, f)

painted_image_crop = crop_polygon(polygon, painted_img, margin=100)
painted_image_crop.save(f"{output_path}/{n}_painted.png")
crop_polygon(polygon, painted_img, margin=100).save(
f"{output_path}/{n}_painted.png"
)

crop_polygon(polygon, stacked_image_pil, margin=100).save(
f"{output_path}/{n}.png"
)

return painted_img, existing, new, missed
return existing, new, missed


if __name__ == "__main__":
Expand Down

0 comments on commit 7de8785

Please sign in to comment.