Skip to content

Instantly share code, notes, and snippets.

@seieric
Created January 18, 2025 07:18
Show Gist options
  • Select an option

  • Save seieric/51a0f735d63f8f2b5e681ad14c1673d3 to your computer and use it in GitHub Desktop.

Select an option

Save seieric/51a0f735d63f8f2b5e681ad14c1673d3 to your computer and use it in GitHub Desktop.
cv2_imshow patch for normal jupyter notebooks
from PIL import Image
from IPython.display import display
def cv2_imshow(img):
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
pil_img = Image.fromarray(img)
display(pil_img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment