Skip to content

Instantly share code, notes, and snippets.

View Ahanmr's full-sized avatar
🎯
Focusing

Ahan M R Ahanmr

🎯
Focusing
  • Bangalore, India
View GitHub Profile
pip3 install --upgrade tensorflow
pip3 install numpy
pip3 install scipy
pip3 install pillow
pip3 install h5py
pip3 install opencv-python
pip3 install matplotlib
pip3 install keras
'''
Editor: Ahan M R
Date: 18-06-2018
Python 3.6.0
'''
#PS1 CROWD DETECTION IN THE CAFETERIA
'''
From imageAI API, we import Object detection and use it to detect the object classes in the image
'''
'''
Editor: Ahan M R
Date: 18-06-2018
Python 3.6.0
'''
#PS1 CROWD DETECTION IN THE SITUATION
'''
From imageAI API, we import Object detection and use it to detect the object classes in the image
'''
Kaiming H. et al, Deep Residual Learning for Image Recognition
https://arxiv.org/abs/1512.03385
Szegedy. et al, Rethinking the Inception Architecture for Computer Vision
https://arxiv.org/abs/1512.00567
Gao. et al, Densely Connected Convolutional Networks
https://arxiv.org/abs/1608.06993
pip install https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.1/imageai-2.0.1-py3-none-any.whl
https://github.com/OlafenwaMoses/ImageAI/releases/download/1.0/resnet50_coco_best_v2.0.1.h5
car : 52.74809002876282
car : 54.43572402000427
car : 61.86940670013428
car : 64.99541997909546
car : 54.53670620918274
car : 54.111236333847046
car : 55.92341423034668
person : 54.37796711921692
person : 61.132240295410156
car : 70.4900324344635
#Import libraries:
import pandas as pd
import numpy as np
import xgboost as xgb
from xgboost.sklearn import XGBClassifier
from sklearn import cross_validation, metrics #Additional scklearn functions
from sklearn.grid_search import GridSearchCV #Perforing grid search
import matplotlib.pylab as plt
%matplotlib inline
def modelfit(alg, dtrain, predictors,useTrainCV=True, cv_folds=5, early_stopping_rounds=50):
if useTrainCV:
xgb_param = alg.get_xgb_params()
xgtrain = xgb.DMatrix(dtrain[predictors].values, label=dtrain[target].values)
cvresult = xgb.cv(xgb_param, xgtrain, num_boost_round=alg.get_params()['n_estimators'], nfold=cv_folds,
metrics='auc', early_stopping_rounds=early_stopping_rounds, show_progress=False)
alg.set_params(n_estimators=cvresult.shape[0])
#Fit the algorithm on the data
def find_tables(self, table_settings={}):
return TableFinder(self, table_settings).tables
def extract_tables(self, table_settings={}):
tables = self.find_tables(table_settings)
return [ table.extract() for table in tables ]
def extract_table(self, table_settings={}):
tables = self.find_tables(table_settings)
# Return the largest table, as measured by number of cells.