Skip to content

Commit

Permalink
Added check in RGB branch for Alpha-channel. Remove Alpha-Channel if …
Browse files Browse the repository at this point in the history
…present
  • Loading branch information
[email protected] authored and [email protected] committed Mar 28, 2021
1 parent d9aa3ff commit b82d697
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 b82d697

Please sign in to comment.