Skip to content

Commit

Permalink
Do not monkey-patch cv2 methods for unaware caller (#11210)
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorzk committed Mar 30, 2023
1 parent 0c8de3f commit a82132c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ def imshow(path, im):
imshow_(path.encode('unicode_escape').decode(), im)


cv2.imread, cv2.imwrite, cv2.imshow = imread, imwrite, imshow # redefine
if Path(inspect.stack()[0].filename).parent.parent.as_posix() in inspect.stack()[-1].filename:
cv2.imread, cv2.imwrite, cv2.imshow = imread, imwrite, imshow # redefine

# Variables ------------------------------------------------------------------------------------------------------------

0 comments on commit a82132c

Please sign in to comment.