Skip to content

Commit

Permalink
Fixed image quality for tasks created from images (#2963)
Browse files Browse the repository at this point in the history
* fixed image quality for images

* updated changelog
  • Loading branch information
Andrey Zhavoronkov authored Mar 16, 2021
1 parent 983e765 commit 284111d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- An error about track shapes outside of the task frames during export (<https://github.com/openvinotoolkit/cvat/pull/2890>)
- Fixed project search field updating (<https://github.com/openvinotoolkit/cvat/pull/2901>)
- Fixed export error when invalid polygons are present in overlapping frames (<https://github.com/openvinotoolkit/cvat/pull/2852>)
- Fixed image quality option for tasks created from images (<https://github.com/openvinotoolkit/cvat/pull/2963>)

### Security

Expand Down
5 changes: 3 additions & 2 deletions cvat/apps/engine/media_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ def get_image_size(self, i):

class IChunkWriter(ABC):
def __init__(self, quality, dimension=DimensionType.DIM_2D):
# translate inversed range [1:100] to [0:51]
self._image_quality = round(51 * (100 - quality) / 99)
self._image_quality = quality
self._dimension = dimension

@staticmethod
Expand Down Expand Up @@ -375,6 +374,8 @@ def save_as_chunk(self, images, chunk_path):

class Mpeg4ChunkWriter(IChunkWriter):
def __init__(self, quality=67):
# translate inversed range [1:100] to [0:51]
quality = round(51 * (100 - quality) / 99)
super().__init__(quality)
self._output_fps = 25
try:
Expand Down

0 comments on commit 284111d

Please sign in to comment.