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 pandas as pd | |
| import numpy as np | |
| import os | |
| import tensorflow as tf | |
| import cv2 | |
| from tensorflow import keras | |
| from tensorflow.keras import layers, Input , losses | |
| from keras.layers.core import Dense , Flatten | |
| from tensorflow.keras.layers import InputLayer | |
| from tensorflow.keras.models import Sequential, Model | 
  
    
      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
    
  
  
    
  | iteration = tf_model.fit(x=np.array(img_data, np.float32), y=np.array(list(map(int,target_val)), np.float32), epochs=5) | 
  
    
      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
    
  
  
    
  | tf_model=tf.keras.Sequential( | |
| [ | |
| tf.keras.layers.InputLayer(input_shape=(IMG_HEIGHT,IMG_WIDTH, 3)), | |
| tf.keras.layers.Conv2D(filters=32, kernel_size=3, strides=(2, 2), activation='relu'), | |
| tf.keras.layers.Conv2D(filters=64, kernel_size=3, strides=(2, 2), activation='relu'), | |
| tf.keras.layers.Flatten(), | |
| tf.keras.layers.Dense(6) | |
| ]) | |
| tf_model.compile(optimizer='rmsprop', loss='sparse_categorical_crossentropy', metrics=['accuracy']) | 
  
    
      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
    
  
  
    
  | dict_map={k: v for v, k in enumerate(np.unique(class_name))} | 
  
    
      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_WIDTH=100 | |
| IMG_HEIGHT=100 | |
| img_folder_path=r'TRAIN_SET_FOLDER' | |
| def create_dataset(img_folder_path): | |
| img_name= [] | |
| class_name= [] | |
| for dir1 in os.listdir(img_folder_path): | 
  
    
      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
    
  
  
    
  | plt.figure(figsize=(20,20)) | |
| image_print_folder=r'PATH_FOR_THE_TRAIN_SET_EOSINOPHIL' | |
| for i in range(5): | |
| file_name = random.choice(os.listdir(image_print_folder)) | |
| image_print_path= os.path.join(image_print_folder, file_name) | |
| image=mpimg.imread(image_print_path) | |
| axis=plt.subplot(1,5,i+1) | |
| axis.title.set_text(file_name) | 
  
    
      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 pandas as pd | |
| import numpy as np | |
| import os | |
| import tensorflow as tf | |
| import cv2 | |
| from tensorflow import keras | |
| from tensorflow.keras import layers, Input , losses | |
| from keras.layers.core import Dense , Flatten | |
| from tensorflow.keras.layers import InputLayer | |
| from tensorflow.keras.models import Sequential, Model | 
  
    
      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 ftplib | |
| import getpass | |
| print("FTP File Send-Receive Software") | |
| user = "" | |
| address = "" | |
| p = "" | |
| while not (user or address or p): | 
  
    
      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
    
  
  
    
  | # If upload | |
| if sorr == "S": | |
| while True: | |
| ifile = input("Enter file name: ") # Get the file name | |
| try: | |
| fcheck = open(ifile, 'r').readlines() | 
  
    
      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
    
  
  
    
  | while not (user or address or p): | |
| while True: | |
| # Get FTP credentials | |
| try: | |
| user = input("Username: ") | |
| print("Password:") | |
| p = getpass.getpass() | |
| address = input("Server Address: ") | 
NewerOlder