# scikit-image==0.18.1
# opencv-python==4.1.2.30
# imageai==2.1.6
# sklearn
# pickle



# Keras==2.4.3
# opencv-python==4.1.2.30
# imageai==2.1.6
# matplotlib==3.3.2

# tensorflow==2.4.1

# requests==2.24.0

# scikit-image
# import streamlit as st
# # import matplotlib.pyplot as plt
# import numpy as np
# import os
# import pprint
# pp = pprint.PrettyPrinter(indent=4)
import joblib
# from skimage.io import imread
# from skimage.transform import resize
# import matplotlib as mpl
# import pandas as pd
# import skimage

# # import cv2
# import pandas as pd
# import os
# # import wget
# # from imageai.Detection import ObjectDetection

# from sklearn.base import BaseEstimator, TransformerMixin
# from skimage.feature import hog
# # from skimage.io import imread
# from skimage.transform import rescale

# # import pickle

# # from PIL import Image
# # from numpy import asarray
# # from skimage import transform
# # from skimage import exposure
# # from skimage import io
# # import requests

# class RGB2GrayTransformer(BaseEstimator, TransformerMixin):
#     """
#     Convert an array of RGB images to grayscale
#     """
 
#     def __init__(self):
#         pass
 
#     def fit(self, X, y=None):
#         """returns itself"""
#         return self
 
#     def transform(self, X, y=None):
#         """perform the transformation and return an array"""
#         return np.array([skimage.color.rgb2gray(img) for img in X])
     

# class HogTransformer(BaseEstimator, TransformerMixin):
#     """
#     Expects an array of 2d arrays (1 channel images)
#     Calculates hog features for each img
#     """
 
#     def __init__(self, y=None, orientations=9,
#                  pixels_per_cell=(8, 8),
#                  cells_per_block=(3, 3), block_norm='L2-Hys'):
#         self.y = y
#         self.orientations = orientations
#         self.pixels_per_cell = pixels_per_cell
#         self.cells_per_block = cells_per_block
#         self.block_norm = block_norm
 
#     def fit(self, X, y=None):
#         return self
 
#     def transform(self, X, y=None):
#         def local_hog(X):
#             return hog(X,orientations=self.orientations,pixels_per_cell=self.pixels_per_cell,cells_per_block=self.cells_per_block,
#                        block_norm=self.block_norm)
 
#         try: # parallel
#             return np.array([local_hog(img) for img in X])
#         except:
#             return np.array([local_hog(img) for img in X])
# grid_res_svc_merged_data = joblib.load('sgd_clf_full_data.pkl') 
