Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/qreader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ def detect(
bounding box in absolute coordinates, while 'bbox_xyxyn' is the bounding box in normalized coordinates
(from 0. to 1.).
"""

image = image if isinstance(image, np.ndarray) else np.array(image)

return self.detector.detect(image=image, is_bgr=is_bgr)

def decode(
Expand Down Expand Up @@ -220,6 +223,8 @@ def detect_and_decode(
a tuple of strings with the decoded QR codes (or None if it can not be decoded).

"""
image = image if isinstance(image, np.ndarray) else np.array(image)

detections = self.detect(image=image, is_bgr=is_bgr)
decoded_qrs = tuple(
self.decode(image=image, detection_result=detection)
Expand Down