Skip to content

Commit

Permalink
on hold
Browse files Browse the repository at this point in the history
  • Loading branch information
subodh101 committed Jul 28, 2018
1 parent 7f17bce commit e37e1f6
Show file tree
Hide file tree
Showing 497 changed files with 3,875 additions and 2,845 deletions.
531 changes: 0 additions & 531 deletions .ipynb_checkpoints/CNN-checkpoint.ipynb

This file was deleted.

735 changes: 735 additions & 0 deletions .ipynb_checkpoints/CNN_nor-checkpoint.ipynb

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions Augmentation.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/subodh_pushkar/anaconda3/lib/python3.5/site-packages/keras_preprocessing/image.py:770: UserWarning: This ImageDataGenerator specifies `featurewise_std_normalization`, which overrides setting of `featurewise_center`.\n",
" warnings.warn('This ImageDataGenerator specifies '\n",
"/home/subodh_pushkar/anaconda3/lib/python3.5/site-packages/keras_preprocessing/image.py:959: UserWarning: This ImageDataGenerator specifies `featurewise_center`, but it hasn't been fit on any training data. Fit it first by calling `.fit(numpy_data)`.\n",
" warnings.warn('This ImageDataGenerator specifies '\n",
"/home/subodh_pushkar/anaconda3/lib/python3.5/site-packages/keras_preprocessing/image.py:967: UserWarning: This ImageDataGenerator specifies `featurewise_std_normalization`, but it hasn't been fit on any training data. Fit it first by calling `.fit(numpy_data)`.\n",
" warnings.warn('This ImageDataGenerator specifies '\n"
]
}
],
"source": [
"from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img\n",
"\n",
"\n",
"\n",
"datagen = ImageDataGenerator(featurewise_std_normalization=True)\n",
"\n",
"import glob\n",
"cv_img = []\n",
"for fname in glob.glob(\"CROPAUG2/glu/*.jpg\"):\n",
" # n= cv2.imread(img)\n",
" # cv_img.append(n)\n",
"\n",
" img = load_img(fname) # this is a PIL image\n",
" x = img_to_array(img) # this is a Numpy array with shape (3, 150, 150)\n",
" x = x.reshape((1,) + x.shape) # this is a Numpy array with shape (1, 3, 150, 150)\n",
"\n",
" # the .flow() command below generates batches of randomly transformed images\n",
" # and saves the results to the `preview/` directory\n",
" i = 0\n",
" for batch in datagen.flow(x, batch_size=1,\n",
" save_to_dir='normalized/glu', save_prefix='nor_', save_format='jpg'):\n",
" i += 1\n",
" if i > 0:\n",
" break # otherwise the generator would loop indefinitely"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down
Loading

0 comments on commit e37e1f6

Please sign in to comment.