Fix image size conversion (#1593)

* Fix image size conversion

* update changelog

Co-authored-by: Nikita Manovich <40690625+nmanovic@users.noreply.github.com>
main
zhiltsov-max 6 years ago committed by GitHub
parent 727fcd50b3
commit 1b413c65a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-
### Fixed
- Fixed dataset filter item representation for imageless dataset items (https://github.com/opencv/cvat/pull/1593)
- Fixed interpreter crash when trying to import `tensorflow` with no AVX instructions available (https://github.com/opencv/cvat/pull/1567)
### Security

@ -32,7 +32,12 @@ class DatasetItemEncoder:
def encode_image(cls, image):
image_elem = ET.Element('image')
h, w = image.size
size = image.size
if size is not None:
h, w = size
else:
h = 'unknown'
w = h
ET.SubElement(image_elem, 'width').text = str(w)
ET.SubElement(image_elem, 'height').text = str(h)

@ -137,7 +137,8 @@ class YoloExtractor(SourceExtractor):
annotations = []
if lines:
image_height, image_width = image.size # use image info late
# use image info as late as possible
image_height, image_width = image.size
for line in lines:
label_id, xc, yc, w, h = line.split()
label_id = int(label_id)

Loading…
Cancel
Save