-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add support for embedding images in .pkg.slp #91
Merged
Merged
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
18c06e3
Add serialization to dict at the video object level
talmo 6bc26c4
Store and retrieve video backend metadata
talmo 84f9542
Try to restore source video when available
talmo a15f44b
Rename symbol
talmo 2dbaea0
Use backend metadata when available when serializing
talmo d933cc0
Fix backend metadata factory
talmo 247f92e
Re-embed videos when saving labels with embedded videos
talmo d35f07e
Fix serialization and logic for checking for embedded images
talmo 31341da
Fix multi-frame decoding
talmo 4402cb4
Fix docstring order
talmo 696ae60
Add method to embed a list of frames and update the objects
talmo fd9bae9
Fix order of operations
talmo b41aa38
Add embed_videos
talmo c8c5ebb
Fix mid-level embedding function
talmo 5f70e1c
Hash videos by ID
talmo 8fe51c0
Add property to return embedded frame indices
talmo c329bad
Hash LabeledFrame by ID and add convenience checks for instance types
talmo 527de4e
Labels.user_labeled_frames
talmo 77f7ef4
Fix JABS
talmo b71646f
Tests
talmo 4e5734b
Add live coverage support
talmo 0614541
Expose high level embedding
talmo 3894837
Separate replace video and support restoring source
talmo a1864a6
Merge branch 'main' into talmo/embed-pkg-slp
talmo a76680a
Lint
talmo 64f88e5
Add Video(filename) syntactic sugar
talmo 8932247
Coverage
talmo eff9676
Windows test fix
talmo 5eee083
Windows test fix again
talmo d2a1415
Fix test
talmo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ coverage.xml | |
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
lcov.info | ||
|
||
# Translations | ||
*.mo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,7 @@ name = "sleap-io" | |
authors = [ | ||
{name = "Liezl Maree", email = "[email protected]"}, | ||
{name = "David Samy", email = "[email protected]"}, | ||
{name = "Talmo Pereira", email = "[email protected]"} | ||
] | ||
{name = "Talmo Pereira", email = "[email protected]"}] | ||
description="Standalone utilities for working with pose data from SLEAP and other tools." | ||
requires-python = ">=3.7" | ||
keywords = ["sleap", "pose tracking", "pose estimation", "behavior"] | ||
|
@@ -19,8 +18,7 @@ classifiers = [ | |
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12" | ||
] | ||
"Programming Language :: Python :: 3.12"] | ||
dependencies = [ | ||
"numpy", | ||
"attrs", | ||
|
@@ -31,8 +29,7 @@ dependencies = [ | |
"simplejson", | ||
"imageio", | ||
"imageio-ffmpeg", | ||
"av" | ||
] | ||
"av"] | ||
dynamic = ["version", "readme"] | ||
|
||
[tool.setuptools.dynamic] | ||
|
@@ -43,6 +40,7 @@ readme = {file = ["README.md"], content-type="text/markdown"} | |
dev = [ | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-watch", | ||
"black", | ||
"pydocstyle", | ||
"toml", | ||
|
@@ -52,16 +50,24 @@ dev = [ | |
"mkdocs-jupyter", | ||
"mkdocstrings[python]>=0.18", | ||
"mkdocs-gen-files", | ||
"mkdocs-literate-nav" | ||
] | ||
"mkdocs-literate-nav"] | ||
|
||
[project.urls] | ||
Homepage = "https://sleap.ai" | ||
Homepage = "https://io.sleap.ai" | ||
Repository = "https://github.com/talmolab/sleap-io" | ||
|
||
[tool.setuptools.packages.find] | ||
exclude = ["site"] | ||
|
||
[tool.black] | ||
line-length = 88 | ||
|
||
[pydocstyle] | ||
convention = "google" | ||
match-dir = "sleap_io" | ||
|
||
[tool.coverage.run] | ||
source = ["livecov"] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--cov sleap_io --cov-report=lcov:lcov.info --cov-report=term" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Several instances of
read_labels
are still passing filenames instead ofVideo
objects. These need to be updated to align with the new implementation.tests/io/test_slp.py
labels = read_labels(slp_typical)
labels = read_labels(slp_simple_skel)
labels = read_labels(slp_minimal)
labels = read_labels(slp_predictions_with_provenance)
labels = read_labels(slp_real_data)
labels = read_labels(centered_pair)
labels = read_labels(fn)
labels = read_labels(tmp_path / "test.slp")
labels = read_labels(slp_imgvideo)
labels = read_labels(tmpdir / "test.slp")
labels = read_labels(slp_minimal_pkg)
labels = read_labels(str(tmpdir / "roundtrip.pkg.slp"))
labels = read_labels(labels_path)
tests/io/test_labelstudio.py
labels = slp_read_labels(slp_typical)
labels = slp_read_labels(slp_simple_skel)
labels = slp_read_labels(slp_minimal)
ls_labels = read_labels(file_path, skeleton)
tests/io/test_jabs.py
slp_labels = read_labels(jabs_real_data_v5)
labels = read_labels(jabs_real_data_v5)
sleap_io/io/main.py
return slp.read_labels(filename)
return labelstudio.read_labels(filename, skeleton=skeleton)
return jabs.read_labels(filename, skeleton=skeleton)
Please update these instances to pass
Video
objects instead of filenames.Analysis chain
Use of existing
Video
object inread_labels
enhances efficiency and code reuse.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 61
Script:
Length of output: 2566
Script:
Length of output: 11597