This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| datagen=ImageDataGenerator( | |
| brightness_range=[0,2] | |
| ) | |
| imagegen=datagen.flow_from_directory('images/',batch_size=1) | |
| fig, rows =plt.subplots(nrows=1, ncols=4, figsize=(18,18)) | |
| for row in rows: | |
| row.imshow(imagegen.next()[0][0].astype('uint8')) | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| datagen=ImageDataGenerator( | |
| rescale=1/255 | |
| ) | |
| imagegen=datagen.flow_from_directory('images/',batch_size=1) | |
| fig, rows =plt.subplots(nrows=1, ncols=4, figsize=(18,18)) | |
| for row in rows: | |
| row.imshow(imagegen.next()[0][0].astype('uint8')) | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| datagen=ImageDataGenerator( | |
| rescale=1/255 | |
| ) | |
| imagegen=datagen.flow_from_directory('images/',batch_size=1) | |
| fig, rows =plt.subplots(nrows=1, ncols=4, figsize=(18,18)) | |
| for row in rows: | |
| row.imshow(imagegen.next()[0][0].astype('float32')) | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.applications.mobilenet_v2 import preprocess_input | |
| datagen=ImageDataGenerator( | |
| preprocessing_function=preprocess_input | |
| ) | |
| imagegen=datagen.flow_from_directory('images/',batch_size=1) | |
| fig, rows =plt.subplots(nrows=1, ncols=4, figsize=(18,18)) | |
| for row in rows: | |
| row.imshow(imagegen.next()[0][0].astype('float64')) | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| datagen=ImageDataGenerator( | |
| channel_shift_range=100 | |
| ) | |
| imagegen=datagen.flow_from_directory('images/',batch_size=1) | |
| fig, rows =plt.subplots(nrows=1, ncols=4, figsize=(18,18)) | |
| for row in rows: | |
| row.imshow(imagegen.next()[0][0].astype('float32')) | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import cv2 | |
| from sklearn.cluster import KMeans |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| img=cv2.imread('image color2.jpg') | |
| plt.imshow(img) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| img=cv2.imread('image color2.jpg') | |
| plt.imshow(img) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) | |
| plt.imshow(img) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| img=img.reshape((img.shape[1]*img.shape[0],3)) |