Skip to content

Commit

Permalink
Merge pull request #20 from Epoxid2/master
Browse files Browse the repository at this point in the history
Added check in RGB branch for Alpha-channel.
  • Loading branch information
nekitmm authored Mar 31, 2021
2 parents d9aa3ff + b82d697 commit adb22aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions starnet_v1_TF2.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ def transform(self, in_name, out_name):
if self.mode == 'RGB' and len(image.shape) == 2:
raise ValueError('You loaded RGB model, but the image is Greyscale!')

if self.mode == 'RGB' and image.shape[2] == 4:
print("Input image has 4 channels. Removing Alpha-Channel")
image=image[:,:,[0,1,2]]

offset = int((self.window_size - self.stride) / 2)

h, w, _ = image.shape
Expand Down

0 comments on commit adb22aa

Please sign in to comment.