Skip to content

Instantly share code, notes, and snippets.

View prateekchandrayan's full-sized avatar

prateekchandrayan

View GitHub Profile
@prateekchandrayan
prateekchandrayan / Dog_vs_Cat_Inception.py
Last active November 25, 2017 08:56
InceptionV3 model: finetune the last layer for Dogs vs Cats in Keras. Simple code
from keras.applications.inception_v3 import InceptionV3
from keras.preprocessing import image
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D
from keras import backend as K
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Input
import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
@prateekchandrayan
prateekchandrayan / Dog_Vs_Cat.py
Created November 23, 2017 07:02
Kaggle Dog_vs_Cat in Keras test
import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
from random import shuffle # mixing up or currently ordered data that might lead our network astray in training.
from tqdm import tqdm # a nice pretty percentage bar for tasks. Thanks to viewer Daniel BA1/4hler for this suggestion
import tensorflow as tf #Import Tensorflow
import glob #This will extract all files from the folder
import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
@prateekchandrayan
prateekchandrayan / MNISTwithKeras.py
Last active June 17, 2021 07:10
MNIST prediction using Keras and building CNN from scratch in Keras
#Step 1
import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
from random import shuffle # mixing up or currently ordered data that might lead our network astray in training.
from tqdm import tqdm # a nice pretty percentage bar for tasks. Thanks to viewer Daniel BA1/4hler for this suggestion
import tensorflow as tf #Import Tensorflow
import glob #This will extract all files from the folder
import keras
from keras.preprocessing.image import ImageDataGenerator