mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
PEP8
This commit is contained in:
parent
abb875cedb
commit
9a561964e5
@ -350,7 +350,7 @@ class EventTrainsWriter(object):
|
|||||||
image = np.asarray(im)
|
image = np.asarray(im)
|
||||||
output.close()
|
output.close()
|
||||||
if height is not None and width is not None:
|
if height is not None and width is not None:
|
||||||
assert height > 0 and width > 0, 'Image width and height params are not positive'
|
assert height > 0 and width > 0, 'Image width and height should be positive integers'
|
||||||
# noinspection PyArgumentList
|
# noinspection PyArgumentList
|
||||||
val = image.reshape(height, width, -1).astype(np.uint8)
|
val = image.reshape(height, width, -1).astype(np.uint8)
|
||||||
else:
|
else:
|
||||||
@ -369,8 +369,7 @@ class EventTrainsWriter(object):
|
|||||||
val = val[:, :, [0, 1, 2]]
|
val = val[:, :, [0, 1, 2]]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger = LoggerRoot.get_base_logger(TensorflowBinding)
|
logger = LoggerRoot.get_base_logger(TensorflowBinding)
|
||||||
logger.warning('Failed decoding debug image [%s, %s, %s]'
|
logger.warning('Failed decoding debug image [%s, %s, %s]' % (width, height, color_channels))
|
||||||
% (width, height, color_channels))
|
|
||||||
logger.warning('Error: %s' % e)
|
logger.warning('Error: %s' % e)
|
||||||
val = None
|
val = None
|
||||||
return val
|
return val
|
||||||
@ -416,9 +415,9 @@ class EventTrainsWriter(object):
|
|||||||
if step % self.image_report_freq != 0:
|
if step % self.image_report_freq != 0:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
width = img_data.get('width', None)
|
width = img_data.get('width')
|
||||||
height = img_data.get('height', None)
|
height = img_data.get('height')
|
||||||
colorspace = img_data.get('colorspace', None)
|
colorspace = img_data.get('colorspace')
|
||||||
img_str = img_data['encodedImageString']
|
img_str = img_data['encodedImageString']
|
||||||
matrix = self._decode_image(img_str, width=width, height=height, color_channels=colorspace)
|
matrix = self._decode_image(img_str, width=width, height=height, color_channels=colorspace)
|
||||||
if matrix is None:
|
if matrix is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user