forte icon indicating copy to clipboard operation
forte copied to clipboard

Image size init in Image payload and access image size from ImageAnnotation

Open hepengfe opened this issue 3 years ago • 1 comments

This PR fixes https://github.com/asyml/forte/issues/880.

Description of changes

  • add parameters image_height and image_width in ImageAnnotation.__init__
  • adjust init functions in ImageAnnotation's child classes accordingly
  • remove hacky method ImageAnnotation.set_image_shape

Possible influences of this PR.

  • ImageAnnotation can access image size that it operates on.
  • all payloads can be initialized with data shape For text data, it is the length of the text.[length, text_embedding_dim] For audio data, it is the length of the audio. [length, audio_embedding_dim] For image data, it is the shape of the image. [height, width, channel]

Test Conducted

Describe what test cases are included for the PR.

hepengfe avatar Jul 27 '22 22:07 hepengfe

Codecov Report

Merging #893 (29c9ce3) into master (588d6bc) will decrease coverage by 0.07%. The diff coverage is 41.02%.

@@            Coverage Diff             @@
##           master     #893      +/-   ##
==========================================
- Coverage   80.95%   80.88%   -0.08%     
==========================================
  Files         254      254              
  Lines       19566    19599      +33     
==========================================
+ Hits        15840    15852      +12     
- Misses       3726     3747      +21     
Impacted Files Coverage Δ
tests/forte/image_annotation_test.py 81.08% <25.00%> (-18.92%) :arrow_down:
forte/data/ontology/top.py 75.68% <52.17%> (-0.76%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Aug 10 '22 17:08 codecov[bot]