Skip to content

Commit

Permalink
housekeeping before ownership txfer
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-woodward committed Jul 9, 2024
1 parent 26cd2c9 commit 7a54267
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
7 changes: 0 additions & 7 deletions fao_models/beam_pipelines/test_pyshp.py

This file was deleted.

4 changes: 2 additions & 2 deletions fao_models/beam_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import numpy as np
from models import get_model, freeze

def parse_shp_to_latlon(file):
def parse_shp_to_latlon(file,id_field:str='PLOTID'):
gdf = gpd.read_file(file)
gdf.loc[:,'centroid'] = gdf.geometry.centroid
gdf.loc[:,'lonlat'] = gdf.centroid.apply(lambda x: [x.x, x.y])
return gdf[['global_id', 'lonlat']].values.tolist()
return gdf[[id_field, 'lonlat']].values.tolist()

def get_ee_img(coords):
"""retrieve s2 image composite from ee at given coordinates. coords is a tuple of (lon, lat) in degrees."""
Expand Down
6 changes: 3 additions & 3 deletions fao_models/model_predict.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import datetime
import logging
from .models import get_model
from models import get_model
import os
import tensorflow as tf
import rasterio as rio
Expand Down Expand Up @@ -63,11 +63,11 @@ def main(config: str | dict):
loss_function = config["loss_function"]

model = load_predict_model(model_name, optimizer, loss_function, weights)

print(model.summary())
# load image
# local file as placeholder
# img = "data/patch_pt9097_nonforest.tif"
img = "data_qa_old_caf\patch_pt0_nonforest.tif"
img = "data\\data_qa_old_caf\\patch_pt0_nonforest.tif"
with rio.open(img) as dst:
data = dst.read() / 10_000
profile = dst.profile
Expand Down

0 comments on commit 7a54267

Please sign in to comment.