Skip to content

Commit

Permalink
Merge pull request #102 from ddc67cd/ddc67cd-patch-1
Browse files Browse the repository at this point in the history
Update image.py
  • Loading branch information
matemax authored Jan 22, 2021
2 parents 9391525 + 2234abf commit 8de915d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions lunavl/sdk/image_utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ def __init__(
raise LunaSDKException(LunaVLError.fromSDKError(error))
elif isinstance(body, PilImage):
array = np.array(body)
colorFormat = ColorFormat.load(body.mode)
inputColorFormat = ColorFormat.load(body.mode)
self.coreImage = self._coreImageFromNumpyArray(
ndarray=array, inputColorFormat=colorFormat, colorFormat=colorFormat
ndarray=array,
inputColorFormat=inputColorFormat,
colorFormat=colorFormat or ColorFormat.R8G8B8
)
else:
raise TypeError(f"Bad image type: {type(body)}")
Expand Down Expand Up @@ -267,8 +269,12 @@ def fromNumpyArray(
if isinstance(inputColorFormat, str):
inputColorFormat = ColorFormat.load(inputColorFormat)

coreImage = cls._coreImageFromNumpyArray(ndarray=arr, inputColorFormat=inputColorFormat)
return cls(coreImage, filename=filename, colorFormat=colorFormat)
coreImage = cls._coreImageFromNumpyArray(
ndarray=arr,
inputColorFormat=inputColorFormat,
colorFormat=colorFormat
)
return cls(coreImage, filename=filename)

@property
def format(self) -> ColorFormat:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.masonry.api"
[tool]
[tool.poetry]
name = "lunavl"
version = "0.0.14"
version = "0.0.15"
description = "Python interface for VisionLabs Luna platform"
authors = ["VisionLabs <[email protected]>"]
repository = "https://github.com/matemax/lunasdk"
Expand Down

0 comments on commit 8de915d

Please sign in to comment.