Skip to content

Commit

Permalink
check TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmhalvor committed Sep 29, 2024
1 parent 08ca054 commit bfc756a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/model_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

import logging

from config import load_pipeline_config
config = load_pipeline_config()



# Load the TensorFlow model
logging.info("Loading model...")
Expand Down Expand Up @@ -33,7 +37,7 @@ def predict():
# Run inference
results = score_fn(
waveform=waveform_exp, # waveform_exp,
context_step_samples=10_000 # TODO load from config
context_step_samples=config.classify.model_sample_rate
)["scores"][0] # NOTE currently only support batch size 1
logging.info(f"results.shape = {results.shape}")
logging.debug("results = ", results)
Expand Down
5 changes: 2 additions & 3 deletions src/stages/sift.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ def _plot_signal_detections(self, pcoll, min_max_detections, all_detections, par
plot_name=key
)

# TODO make dirs cleaner
if not os.path.isdir(os.path.sep.join(plot_path.split(os.path.sep)[:-1])):
os.makedirs(os.path.sep.join(plot_path.split(os.path.sep)[:-1]))
if not beam.io.filesystems.FileSystems.exists(plot_path):
beam.io.filesystems.FileSystems.mkdirs(plot_path)

# normalize and center
signal = signal / np.max(signal) # normalize
Expand Down

0 comments on commit bfc756a

Please sign in to comment.