Skip to content

Commit

Permalink
Update darknet_images.py (#8559)
Browse files Browse the repository at this point in the history
Safer and better type check.
  • Loading branch information
juraev authored Aug 25, 2023
1 parent 38a5b48 commit 2bb27c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion darknet_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def image_detection(image_or_path, network, class_names, class_colors, thresh):
height = darknet.network_height(network)
darknet_image = darknet.make_image(width, height, 3)

if type(image_or_path) == "str":
if isinstance(image_or_path, str):
image = cv2.imread(image_or_path)
else:
image = image_or_path
Expand Down

0 comments on commit 2bb27c1

Please sign in to comment.