tflibs.image

Image utils

tflibs.image.decode(string)[source]

Decodes jpeg string into numpy.ndarray

Parameters:string (str) – jpeg encoded string
Returns:numpy.ndarray of a decoded image
Return type:numpy.ndarray
tflibs.image.encode(arr)[source]

Encodes numpy.ndarray into jpeg string

Parameters:arr (numpy.ndarray) – numpy.ndarray of an image
Returns:jpeg encoded string
Return type:str
tflibs.image.resize(img, dsize)[source]

Resizes numpy.ndarray image to target size

Parameters:
  • img (numpy.ndarray) – numpy.ndarray of an image
  • dsize (tuple) – Target size (height, width)
Returns:

Resized image

Return type:

numpy.ndarray