8000 Implement offset regression by talmo · Pull Request #447 · talmolab/sleap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement offset regression #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 10, 2021
Merged

Implement offset regression #447

merged 6 commits into from
Jan 10, 2021

Conversation

talmo
Copy link
Collaborator
@talmo talmo commented Jan 5, 2021

This feature enables peak location refinement for more accurate learnable subpixel localization.

  • Data transformers to generate training data
  • Add optional refinement heads to config and training for all models
  • Add peak refinement to inference

talmo added 3 commits January 5, 2021 18:45
* Fix topdown colorspace preprocessing
- Switch to using static shape when cropping. Note that this means the
  shape of the inputs must be statically known.

* Clean up and document nn.inference module
- Add most of the missing docstrings and type hints
- Remove unused code
- Standardized `Predictor` methods
- API change: `TopDownModel` -> `TopDownInferenceModel`
- API change: `Predictor.predict()` no longer has `make_instances` kwarg
@talmo talmo marked this pull request as ready for review January 9, 2021 01:36
talmo added 3 commits January 9, 2021 16:11
* Base offset map computation

* Add support for missing points

* Add offset maps masking

* Add offset maps to confidence map transformers

* Docstring formatting

* [offset_regression] Add optional refinement heads to config and training for all models (#451)

* Add channel flattening to refinement map generators
- Fix output keys

* Add offset refinement config options
- Disable OHKM by default (unrelated)

* Create offset refinement head

* Implement model creation with refinement head

* Add offset refinement to training pipeline builders
- Nit: Re-order classes

* Add offset refinement support to trainer
- Add minimal tests for trainer (finally)
- Rename nn/data/test_training.py -> test_data_training.py

* [offset_regression] Add offset refinement to inference (#452)

* Add stride arg to offset generation
- Needed to scale the raw offsets to sampling grid units

* Add global peak finding with learned offsets

* Move Hungarian matching utilities to nn.utils

* Add local peak finding with learned offsets

* Fix offset refinement head from centroid config
- Nit: Reorder classes in nn.heads

* Fix Model instantiation with offset refinement head from centroid config

* Add tests for training centroid models

* Add offset refinement to inference module
- Nit: Reorder classes
- Add attributes to specify index of output tensors for each model
- Add detection of head-specific output tensors

* Fix typo in bottom-up peak finding

* Add minimal trained models as fixtures for tests

* Add tests for model loading and inference
@codecov-io
Copy link

Codecov Report

Merging #447 (1638761) into develop (87231ce) will increase coverage by 3.62%.
The diff coverage is 71.02%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #447      +/-   ##
===========================================
+ Coverage    60.52%   64.14%   +3.62%     
===========================================
  Files          120      121       +1     
  Lines        18008    18250     +242     
===========================================
+ Hits         10899    11707     +808     
+ Misses        7109     6543     -566     
Impacted Files Coverage Δ
sleap/nn/inference.py 60.51% <ø> (+20.58%) ⬆️
sleap/nn/data/confidence_maps.py 66.03% <50.00%> (+0.08%) ⬆️
sleap/nn/training.py 59.06% <63.82%> (+35.28%) ⬆️
sleap/nn/utils.py 37.50% <66.66%> (+13.69%) ⬆️
sleap/nn/model.py 85.14% <73.33%> (+60.14%) ⬆️
sleap/nn/data/pipelines.py 79.55% <81.25%> (+33.13%) ⬆️
sleap/nn/heads.py 95.23% <88.46%> (+22.10%) ⬆️
sleap/nn/peak_finding.py 93.00% <93.33%> (+0.08%) ⬆️
sleap/nn/config/model.py 100.00% <100.00%> (ø)
sleap/nn/config/optimization.py 100.00% <100.00%> (ø)
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87231ce...1638761. Read the comment docs.

@talmo talmo merged commit 1f3f1a8 into develop Jan 10, 2021
@talmo talmo deleted the talmo/offset_regression branch January 10, 2021 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0