Skip to content
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

PNG compression for arbitrary number of channels #1252

Merged
merged 1 commit into from
Oct 12, 2021
Merged

Conversation

farizrahman4u
Copy link
Contributor

🚀 🚀 Pull Request

Checklist:

  • My code follows the style guidelines of this project and the Contributing document
  • I have commented my code, particularly in hard-to-understand areas
  • I have kept the coverage-rate up
  • I have performed a self-review of my own code and resolved any problems
  • I have checked to ensure there aren't any other open Pull Requests for the same change
  • I have described and made corresponding changes to the relevant documentation
  • New and existing unit tests pass locally with my changes

Changes

https://activeloop.atlassian.net/browse/AL-1272

Uses apng to compress image arrays with arbitrary number of channels. Does not support reading APNG images from file.

API:

Stacked binary masks are expected to have shape (height, width, nframes)

import hub
ds = hub.dataset("mem://test")
ds.create_tensor("binary_masks", sample_compression="apng")
with ds:
    for _ in range(10):
        ds.binary_masks.append(np.random.randint(0, 2, (100, 100,  713), dtype="uint8"))

RGB/RGBA frames should have shape (nframes, height, width, nchannels)

@CLAassistant
Copy link

CLAassistant commented Oct 11, 2021

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #1252 (d6cac3b) into main (c9ef99b) will increase coverage by 0.01%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1252      +/-   ##
==========================================
+ Coverage   91.64%   91.66%   +0.01%     
==========================================
  Files         135      135              
  Lines        9074     9118      +44     
==========================================
+ Hits         8316     8358      +42     
- Misses        758      760       +2     
Impacted Files Coverage Δ
hub/api/tests/test_api.py 99.37% <ø> (ø)
hub/core/compression.py 89.92% <93.93%> (+0.33%) ⬆️
hub/compression.py 96.87% <100.00%> (+0.10%) ⬆️
hub/core/tests/test_compression.py 100.00% <100.00%> (ø)

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 c9ef99b...d6cac3b. Read the comment docs.

Copy link
Contributor

@verbose-void verbose-void left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concise

@farizrahman4u farizrahman4u merged commit 5e3e20c into main Oct 12, 2021
@farizrahman4u farizrahman4u deleted the fr_apng branch October 12, 2021 11:04
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.

4 participants