<jupyter_start><jupyter_text>Saving image<jupyter_code>golden_gate = cv2.imread('golden gate.jpg',cv2.IMREAD_GRAYSCALE)
cv2.imwrite('golden gate b&w.jpg',golden_gate)<jupyter_output><empty_output><jupyter_text>Resizing Images<jupyter_code>golden_gate_50x50 = cv2.resize(golden_gate,(1920,1080))
plt.imshow(golden_gate_50x50)<jupyter_output><empty_output><jupyter_text>Cropping image<jupyter_code>plt.imshow(golden_gate[:,:2500])<jupyter_output><empty_output><jupyter_text>Image kernel/filter operation<jupyter_code>blurring_kernel = np.ones((5,5))/25
blurring_kernel
filtered_image = cv2.filter2D(golden_gate, -1, blurring_kernel)
plt.imshow(filtered_image,cmap='gray')
help(cv2.filter2D)
list(map(lambda x: 1/(1+np.exp(-x)), [45,1,56,78,78]))
np.vectorize(lambda x: 1/(1+np.exp(-x)))([45,1,56,78,78])
list(filter(lambda x: True if x%2 == 0 else False, [1,2,3,4]))
from functools import reduce
reduce(lambda a,b: a+b, [1,2,3,4,5])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16875, 'fraction_numerical': 0.06875, 'mean_word_length': 12.347222222222221, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '399997', 'license': 'MIT', 'n_tokens_mistral': 451, 'n_tokens_neox': 415, 'n_words': 45, 'path': 'Machine Learning Cookbook/Chapter 8 Handling Image Data.ipynb', 'repo_name': 'sonwanesuresh95/Books-to-notebooks', 'size': '960'}