<jupyter_start><jupyter_text><jupyter_code>!wget https://www.dropbox.com/s/utrkdooh08y9mvm/uno_card.png
!pip install torch_snippets
from torch_snippets import *
import cv2, numpy as np
img = read('uno_card.png', 1)
show(img)
hsv = cv2.cvtColor(img, cv2.COLOR_RGB2HSV)
lower_green = np.array([45,100,100])
upper_green = np.array([80,255,255])
mask = cv2.inRange(hsv, lower_green, upper_green)
res = cv2.bitwise_and(img, img, mask=mask)
subplots([img, mask, res], nc=3, figsize=(10,5), titles=['Original image','Mask on image','Resulting image'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1602787456445993, 'fraction_numerical': 0.05226480836236934, 'mean_word_length': 7.984375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '396834', 'license': 'MIT', 'n_tokens_mistral': 252, 'n_tokens_neox': 233, 'n_words': 42, 'path': 'Chapter18/detecting_objects_based_on_color.ipynb', 'repo_name': 'arifmudi/Modern-Computer-Vision-with-PyTorch', 'size': '574'}