forte
forte copied to clipboard
Image getter setter
This PR fixes https://github.com/asyml/forte/issues/873.
Description of changes
-
DataPack.set_image()that takes image data and set the cache data of image payload at the specified index. -
DataPack.imagethat getting image data fromImagePayload
Possible influences of this PR.
- it's more convenient for users to get and set image data in data pack.
Test Conducted
- test setting index beyond datapack payloads length
- test get image from datapack
Codecov Report
Merging #891 (c24dcdd) into master (c22fecb) will increase coverage by
0.03%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #891 +/- ##
==========================================
+ Coverage 80.88% 80.91% +0.03%
==========================================
Files 254 254
Lines 19525 19551 +26
==========================================
+ Hits 15792 15819 +27
+ Misses 3733 3732 -1
| Impacted Files | Coverage Δ | |
|---|---|---|
| forte/data/ontology/top.py | 78.17% <ø> (+0.07%) |
:arrow_up: |
| forte/data/data_pack.py | 85.88% <100.00%> (+0.39%) |
:arrow_up: |
| tests/forte/image_annotation_test.py | 100.00% <100.00%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more