Skip to content

Commit

Permalink
Modify inference and centroid model to allow Bonsai ingestion (#850)
Browse files Browse the repository at this point in the history
* Add WIP frozen graph saving to inference model

* Add option for optimal grouping in multiclass peaks

* Add centroid only model

* Add model save tests

* Update save tests

* Lint peak finding

* Call unwrapped find_global_peaks in tests to raise codecov

* Call unwrapped find_local_peaks in tests to raise codecov

* Call unwrapped CentroidCrop.call in tests to raise codecov

* Decorate offset peak finding, add topdown save tests

* Add return_crops flag to centroid crop layer

* Update bonsai model export, add high level export, cli func

* Add predictor export tests

* Expose high level exporter

* Add entry point for cli export

* Add tracing for resizing pad_to_stride

* Call unwrapped pad_to_stride in tests to raise codecov

* Lint resizing test

Co-authored-by: roomrys <[email protected]>
  • Loading branch information
sheridana and roomrys authored Aug 29, 2022
1 parent c4409dd commit eec8a00
Show file tree
Hide file tree
Showing 8 changed files with 666 additions and 54 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def get_requirements(require_name=None):
"sleap-track=sleap.nn.inference:main",
"sleap-inspect=sleap.info.labels:main",
"sleap-diagnostic=sleap.diagnostic:main",
"sleap-export=sleap.nn.inference:export_cli",
],
},
python_requires=">=3.6",
Expand Down
2 changes: 1 addition & 1 deletion sleap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import sleap.nn
from sleap.nn.data import pipelines
from sleap.nn import inference
from sleap.nn.inference import load_model
from sleap.nn.inference import load_model, export_model
from sleap.nn.system import use_cpu_only, disable_preallocation
from sleap.nn.system import summary as system_summary
from sleap.nn.config import TrainingJobConfig, load_config
Expand Down
1 change: 1 addition & 0 deletions sleap/nn/data/resizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def find_padding_for_stride(
return pad_bottom, pad_right


@tf.function
def pad_to_stride(image: tf.Tensor, max_stride: int) -> tf.Tensor:
"""Pad an image to meet a max stride constraint.
Expand Down
Loading

0 comments on commit eec8a00

Please sign in to comment.