Skip to content

Commit ee31add

Browse files
authored
[FIX] Added missing conversion from BGR to RGB after reading an image using cv2.imread (#171)
1 parent dd691e3 commit ee31add

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

samgeo/hq_sam.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def generate(
199199
)
200200

201201
image = cv2.imread(source)
202+
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
202203
elif isinstance(source, np.ndarray):
203204
image = source
204205
source = None

samgeo/samgeo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def generate(
196196
)
197197

198198
image = cv2.imread(source)
199+
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
199200
elif isinstance(source, np.ndarray):
200201
image = source
201202
source = None

0 commit comments

Comments
 (0)