Commit 2ba65090 authored by lochanar99's avatar lochanar99

initial commit

parents
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "labeled-leone",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"df = pd.read_csv('vgsales.csv')\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "abroad-medline",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "italic-negative",
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"\n",
"import keras\n",
"from keras.models import Sequential\n",
"from keras.layers import Dense, Convo2D, MaxPool2D, Flatten, Dropout\n",
"from keras.preprocessing.image import ImageDataGenerator\n",
"from keras.optimizers import Adam\n",
"\n",
"from sklearn.metrics import classification_report, confusion_matrix\n",
"\n",
"import tensorflow as tf\n",
"\n",
"import cv2\n",
"import os\n",
"\n",
"import numpy as np\n",
"\n",
"labels = ['diseased', 'healthy']\n",
"img_size = 224\n",
"def get_data(data_dir):\n",
" data = []\n",
" for label in labels:\n",
" path = os.path.join(data_dir,label)\n",
" class_num = labels.index(label)\n",
" for img in os.listdir(path):\n",
" \n",
" try:\n",
" img_arr = cv2.imread(os.path.join(path, img))[...,::-1] #to convert BGR to RGB format\n",
" resized_arr = cv2.resize(img_arr, (img_size, img_size)) #Reshaping images to preferred size\n",
" \n",
" data.append([resized_arr, class_num])\n",
" except Exception as e:\n",
" print(e)\n",
" \n",
" return np.array(data)\n",
"\n",
"train = get_data('')\n",
"\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
This source diff could not be displayed because it is too large. You can view the blob instead.
dataset cannot be pushed to sliit github as it exceeds the allowed data
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment