From 194eb6e3c2be0964c5b0ce328c4bd4e2f06663bb Mon Sep 17 00:00:00 2001 From: Rohitsonvane88 <99544328+Rohitsonvane88@users.noreply.github.com> Date: Sat, 21 Oct 2023 13:34:37 +0530 Subject: [PATCH 1/4] Create flex-panel.html Added Frontend for Flex panel --- Fronted Projects/flex-panel.html | 115 +++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Fronted Projects/flex-panel.html diff --git a/Fronted Projects/flex-panel.html b/Fronted Projects/flex-panel.html new file mode 100644 index 00000000..88a4f1d1 --- /dev/null +++ b/Fronted Projects/flex-panel.html @@ -0,0 +1,115 @@ + + + + + Flex Panels 💪 + + + + + + + +
+
+

Hey

+

Let's

+

Dance

+
+
+

Give

+

Take

+

Receive

+
+
+

Experience

+

It

+

Today

+
+
+

Give

+

All

+

You can

+
+
+

Life

+

In

+

Motion

+
+
+ + + + + + + From 41cf7b151f72f7a175235f9b39a42cbcd791b5ef Mon Sep 17 00:00:00 2001 From: Rohitsonvane88 <99544328+Rohitsonvane88@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:46:56 +0530 Subject: [PATCH 2/4] Create HtmlCanvas.html Made html canvas for drawing colorful art --- Fronted Projects/HtmlCanvas.html | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Fronted Projects/HtmlCanvas.html diff --git a/Fronted Projects/HtmlCanvas.html b/Fronted Projects/HtmlCanvas.html new file mode 100644 index 00000000..7d2c933c --- /dev/null +++ b/Fronted Projects/HtmlCanvas.html @@ -0,0 +1,74 @@ + + + + + HTML5 Canvas + + + + + + + + + + From eb35a3f32f0fb8acecee3762fc569b81f3b68ef6 Mon Sep 17 00:00:00 2001 From: Rohitsonvane88 <99544328+Rohitsonvane88@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:49:54 +0530 Subject: [PATCH 3/4] Add files via upload Hand Gesture Detection With Mediapipe and OpenCV --- ML Project/Driver Code.ipynb | 419 ++++++ ML Project/Gesture Detection.ipynb | 2088 ++++++++++++++++++++++++++++ 2 files changed, 2507 insertions(+) create mode 100644 ML Project/Driver Code.ipynb create mode 100644 ML Project/Gesture Detection.ipynb diff --git a/ML Project/Driver Code.ipynb b/ML Project/Driver Code.ipynb new file mode 100644 index 00000000..60639522 --- /dev/null +++ b/ML Project/Driver Code.ipynb @@ -0,0 +1,419 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "id": "2ddf3fc5", + "metadata": {}, + "outputs": [], + "source": [ + "import cv2\n", + "import numpy as np\n", + "import os\n", + "from matplotlib import pyplot as plt\n", + "import time\n", + "import mediapipe as mp" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "81d02510", + "metadata": {}, + "outputs": [], + "source": [ + "mp_holistic = mp.solutions.holistic # Holistic model\n", + "mp_drawing = mp.solutions.drawing_utils # Drawing utilities" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "05945ae6", + "metadata": {}, + "outputs": [], + "source": [ + "# Path for exported data, numpy arrays\n", + "DATA_PATH = os.path.join('MP_Data') \n", + "\n", + "# Actions that we try to detect\n", + "actions = np.array(['hello', 'thanks', 'iloveyou','yes','no','good','bad','nice','namaste','sorry'])\n", + "\n", + "# Thirty videos worth of data\n", + "no_sequences = 30\n", + "\n", + "# Videos are going to be 30 frames in length\n", + "sequence_length = 30\n", + "\n", + "# Folder start\n", + "start_folder = 30" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "9d60d045", + "metadata": {}, + "outputs": [], + "source": [ + "def mediapipe_detection(image, model):\n", + " image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # COLOR CONVERSION BGR 2 RGB\n", + " image.flags.writeable = False # Image is no longer writeable\n", + " results = model.process(image) # Make prediction\n", + " image.flags.writeable = True # Image is now writeable \n", + " image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) # COLOR COVERSION RGB 2 BGR\n", + " return image, results" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "d7e244a9", + "metadata": {}, + "outputs": [], + "source": [ + "def draw_landmarks(image, results):\n", + " mp_drawing.draw_landmarks(image, results.face_landmarks, mp_holistic.FACEMESH_CONTOURS) # Draw face connections\n", + " mp_drawing.draw_landmarks(image, results.pose_landmarks, mp_holistic.POSE_CONNECTIONS) # Draw pose connections\n", + " mp_drawing.draw_landmarks(image, results.left_hand_landmarks, mp_holistic.HAND_CONNECTIONS) # Draw left hand connections\n", + " mp_drawing.draw_landmarks(image, results.right_hand_landmarks, mp_holistic.HAND_CONNECTIONS) # Draw right hand connections" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "e7190166", + "metadata": {}, + "outputs": [], + "source": [ + "def draw_styled_landmarks(image, results):\n", + " # Draw face connections\n", + " mp_drawing.draw_landmarks(image, results.face_landmarks, mp_holistic.FACEMESH_CONTOURS, \n", + " mp_drawing.DrawingSpec(color=(80,110,10), thickness=1, circle_radius=1), \n", + " mp_drawing.DrawingSpec(color=(80,256,121), thickness=1, circle_radius=1)\n", + " ) \n", + " # Draw pose connections\n", + " mp_drawing.draw_landmarks(image, results.pose_landmarks, mp_holistic.POSE_CONNECTIONS,\n", + " mp_drawing.DrawingSpec(color=(80,22,10), thickness=2, circle_radius=4), \n", + " mp_drawing.DrawingSpec(color=(80,44,121), thickness=2, circle_radius=2)\n", + " ) \n", + " # Draw left hand connections\n", + " mp_drawing.draw_landmarks(image, results.left_hand_landmarks, mp_holistic.HAND_CONNECTIONS, \n", + " mp_drawing.DrawingSpec(color=(121,22,76), thickness=2, circle_radius=4), \n", + " mp_drawing.DrawingSpec(color=(121,44,250), thickness=2, circle_radius=2)\n", + " ) \n", + " # Draw right hand connections \n", + " mp_drawing.draw_landmarks(image, results.right_hand_landmarks, mp_holistic.HAND_CONNECTIONS, \n", + " mp_drawing.DrawingSpec(color=(245,117,66), thickness=2, circle_radius=4), \n", + " mp_drawing.DrawingSpec(color=(245,66,230), thickness=2, circle_radius=2)\n", + " ) " + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "ad334d82", + "metadata": {}, + "outputs": [], + "source": [ + "def extract_keypoints(results):\n", + " pose = np.array([[res.x, res.y, res.z, res.visibility] for res in results.pose_landmarks.landmark]).flatten() if results.pose_landmarks else np.zeros(33*4)\n", + " face = np.array([[res.x, res.y, res.z] for res in results.face_landmarks.landmark]).flatten() if results.face_landmarks else np.zeros(468*3)\n", + " lh = np.array([[res.x, res.y, res.z] for res in results.left_hand_landmarks.landmark]).flatten() if results.left_hand_landmarks else np.zeros(21*3)\n", + " rh = np.array([[res.x, res.y, res.z] for res in results.right_hand_landmarks.landmark]).flatten() if results.right_hand_landmarks else np.zeros(21*3)\n", + " return np.concatenate([pose, face, lh, rh])" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "00dede35", + "metadata": {}, + "outputs": [], + "source": [ + "from tensorflow.keras.models import Sequential\n", + "from tensorflow.keras.layers import LSTM, Dense\n", + "from tensorflow.keras.callbacks import TensorBoard" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "a4086bb5", + "metadata": {}, + "outputs": [], + "source": [ + "model = Sequential()\n", + "model.add(LSTM(64, return_sequences=True, activation='relu', input_shape=(30,1662)))\n", + "model.add(LSTM(128, return_sequences=True, activation='relu'))\n", + "model.add(LSTM(64, return_sequences=False, activation='relu'))\n", + "model.add(Dense(64, activation='relu'))\n", + "model.add(Dense(32, activation='relu'))\n", + "model.add(Dense(actions.shape[0], activation='softmax'))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "beaa725e", + "metadata": {}, + "outputs": [], + "source": [ + "model.compile(optimizer='Adam', loss='categorical_crossentropy', metrics=['categorical_accuracy'])" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "1485211f", + "metadata": {}, + "outputs": [], + "source": [ + "model.load_weights('action.h5')" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "f56539d7", + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.metrics import multilabel_confusion_matrix, confusion_matrix,accuracy_score" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "0c9ae813", + "metadata": {}, + "outputs": [], + "source": [ + "actions = np.array(['hello', 'thanks', 'iloveyou','yes','no','good','bad','nice','namaste','sorry'])\n", + "label_map = {label:num for num, label in enumerate(actions)}" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "fe837bcb", + "metadata": {}, + "outputs": [], + "source": [ + "sequences, labels = [], []\n", + "for action in actions:\n", + " for sequence in range(no_sequences):\n", + " window = []\n", + " for frame_num in range(sequence_length):\n", + " res = np.load(os.path.join(DATA_PATH, action, str(sequence), \"{}.npy\".format(frame_num)))\n", + " window.append(res)\n", + " sequences.append(window)\n", + " labels.append(label_map[action])\n", + " \n", + "X = np.array(sequences)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "b3c0258c", + "metadata": {}, + "outputs": [], + "source": [ + "from tensorflow.keras.utils import to_categorical\n", + "y = to_categorical(labels).astype(int)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "c34f72b6", + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.model_selection import train_test_split\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.05)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "1bfb5036", + "metadata": {}, + "outputs": [], + "source": [ + "yhat = model.predict(X_test)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "e3fae855", + "metadata": {}, + "outputs": [], + "source": [ + "ytrue = np.argmax(y_test, axis=1).tolist()\n", + "yhat = np.argmax(yhat, axis=1).tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "3666320a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[[13, 0],\n", + " [ 0, 2]],\n", + "\n", + " [[12, 0],\n", + " [ 0, 3]],\n", + "\n", + " [[14, 0],\n", + " [ 0, 1]],\n", + "\n", + " [[14, 0],\n", + " [ 0, 1]],\n", + "\n", + " [[12, 0],\n", + " [ 0, 3]],\n", + "\n", + " [[13, 0],\n", + " [ 0, 2]],\n", + "\n", + " [[12, 0],\n", + " [ 0, 3]]], dtype=int64)" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "multilabel_confusion_matrix(ytrue, yhat)" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "c5ded9c2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[2, 0, 0, 0, 0, 0, 0],\n", + " [0, 3, 0, 0, 0, 0, 0],\n", + " [0, 0, 1, 0, 0, 0, 0],\n", + " [0, 0, 0, 1, 0, 0, 0],\n", + " [0, 0, 0, 0, 3, 0, 0],\n", + " [0, 0, 0, 0, 0, 2, 0],\n", + " [0, 0, 0, 0, 0, 0, 3]], dtype=int64)" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "confusion_matrix(ytrue, yhat)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b65cba26", + "metadata": {}, + "outputs": [], + "source": [ + "# 1. New detection variables\n", + "sequence = []\n", + "sentence = []\n", + "threshold = 0.8\n", + "\n", + "cap = cv2.VideoCapture(0)\n", + "# Set mediapipe model \n", + "with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic:\n", + " while cap.isOpened():\n", + "\n", + " # Read feed\n", + " ret, frame = cap.read()\n", + "\n", + " # Make detections\n", + " image, results = mediapipe_detection(frame, holistic)\n", + " print(results)\n", + " \n", + " # Draw landmarks\n", + " draw_styled_landmarks(image, results)\n", + " \n", + " # 2. Prediction logic\n", + " keypoints = extract_keypoints(results)\n", + "# sequence.insert(0,keypoints)\n", + "# sequence = sequence[:30]\n", + " sequence.append(keypoints)\n", + " sequence = sequence[-30:]\n", + " \n", + " if len(sequence) == 30:\n", + " res = model.predict(np.expand_dims(sequence, axis=0))[0]\n", + " print(actions[np.argmax(res)])\n", + " \n", + " #3. Viz logic\n", + " if res[np.argmax(res)] > threshold: \n", + " if len(sentence) > 0: \n", + " if actions[np.argmax(res)] != sentence[-1]:\n", + " sentence.append(actions[np.argmax(res)])\n", + " else:\n", + " sentence.append(actions[np.argmax(res)])\n", + "\n", + " if len(sentence) > 5: \n", + " sentence = sentence[-5:]\n", + " \n", + " cv2.rectangle(image, (0,0), (640, 40), (245, 117, 16), -1)\n", + " cv2.putText(image, ' '.join(sentence), (3,30), \n", + " cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2, cv2.LINE_AA)\n", + " \n", + " # Show to screen\n", + " cv2.imshow('OpenCV Feed', image)\n", + "\n", + " # Break gracefully\n", + " if cv2.waitKey(10) & 0xFF == ord('q'):\n", + " break\n", + " cap.release()\n", + " cv2.destroyAllWindows()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f28806f", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/ML Project/Gesture Detection.ipynb b/ML Project/Gesture Detection.ipynb new file mode 100644 index 00000000..ba43b3b0 --- /dev/null +++ b/ML Project/Gesture Detection.ipynb @@ -0,0 +1,2088 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "id": "d294ebbb", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: tensorflow==2.8.1 in d:\\anaconda\\lib\\site-packages (2.8.1)\n", + "Requirement already satisfied: tensorflow-gpu==2.8.1 in d:\\anaconda\\lib\\site-packages (2.8.1)\n", + "Requirement already satisfied: opencv-python in d:\\anaconda\\lib\\site-packages (4.7.0.72)\n", + "Requirement already satisfied: mediapipe in d:\\anaconda\\lib\\site-packages (0.10.0)\n", + "Requirement already satisfied: scikit-learn in d:\\anaconda\\lib\\site-packages (1.2.1)\n", + "Requirement already satisfied: matplotlib in d:\\anaconda\\lib\\site-packages (3.7.0)\n", + "Requirement already satisfied: wrapt>=1.11.0 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (1.14.1)\n", + "Requirement already satisfied: typing-extensions>=3.6.6 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (4.4.0)\n", + "Requirement already satisfied: protobuf>=3.9.2 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (3.20.3)\n", + "Requirement already satisfied: astunparse>=1.6.0 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (1.6.3)\n", + "Requirement already satisfied: grpcio<2.0,>=1.24.3 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (1.54.2)\n", + "Requirement already satisfied: setuptools in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (65.6.3)\n", + "Requirement already satisfied: keras-preprocessing>=1.1.1 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (1.1.2)\n", + "Requirement already satisfied: six>=1.12.0 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (1.16.0)\n", + "Requirement already satisfied: keras<2.9,>=2.8.0rc0 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (2.8.0)\n", + "Requirement already satisfied: h5py>=2.9.0 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (3.7.0)\n", + "Requirement already satisfied: libclang>=9.0.1 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (16.0.0)\n", + "Requirement already satisfied: google-pasta>=0.1.1 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (0.2.0)\n", + "Requirement already satisfied: tensorboard<2.9,>=2.8 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (2.8.0)\n", + "Requirement already satisfied: termcolor>=1.1.0 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (2.3.0)\n", + "Requirement already satisfied: flatbuffers>=1.12 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (23.5.9)\n", + "Requirement already satisfied: absl-py>=0.4.0 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (1.4.0)\n", + "Requirement already satisfied: tensorflow-estimator<2.9,>=2.8 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (2.8.0)\n", + "Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (0.31.0)\n", + "Requirement already satisfied: gast>=0.2.1 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (0.5.4)\n", + "Requirement already satisfied: opt-einsum>=2.3.2 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (3.3.0)\n", + "Requirement already satisfied: numpy>=1.20 in d:\\anaconda\\lib\\site-packages (from tensorflow==2.8.1) (1.23.5)\n", + "Requirement already satisfied: opencv-contrib-python in d:\\anaconda\\lib\\site-packages (from mediapipe) (4.7.0.72)\n", + "Requirement already satisfied: attrs>=19.1.0 in d:\\anaconda\\lib\\site-packages (from mediapipe) (22.1.0)\n", + "Requirement already satisfied: sounddevice>=0.4.4 in d:\\anaconda\\lib\\site-packages (from mediapipe) (0.4.6)\n", + "Requirement already satisfied: scipy>=1.3.2 in d:\\anaconda\\lib\\site-packages (from scikit-learn) (1.10.0)\n", + "Requirement already satisfied: joblib>=1.1.1 in d:\\anaconda\\lib\\site-packages (from scikit-learn) (1.1.1)\n", + "Requirement already satisfied: threadpoolctl>=2.0.0 in d:\\anaconda\\lib\\site-packages (from scikit-learn) (2.2.0)\n", + "Requirement already satisfied: pillow>=6.2.0 in d:\\anaconda\\lib\\site-packages (from matplotlib) (9.4.0)\n", + "Requirement already satisfied: cycler>=0.10 in d:\\anaconda\\lib\\site-packages (from matplotlib) (0.11.0)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in d:\\anaconda\\lib\\site-packages (from matplotlib) (3.0.9)\n", + "Requirement already satisfied: fonttools>=4.22.0 in d:\\anaconda\\lib\\site-packages (from matplotlib) (4.25.0)\n", + "Requirement already satisfied: contourpy>=1.0.1 in d:\\anaconda\\lib\\site-packages (from matplotlib) (1.0.5)\n", + "Requirement already satisfied: packaging>=20.0 in d:\\anaconda\\lib\\site-packages (from matplotlib) (22.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in d:\\anaconda\\lib\\site-packages (from matplotlib) (1.4.4)\n", + "Requirement already satisfied: python-dateutil>=2.7 in d:\\anaconda\\lib\\site-packages (from matplotlib) (2.8.2)\n", + "Requirement already satisfied: wheel<1.0,>=0.23.0 in d:\\anaconda\\lib\\site-packages (from astunparse>=1.6.0->tensorflow==2.8.1) (0.38.4)\n", + "Requirement already satisfied: CFFI>=1.0 in d:\\anaconda\\lib\\site-packages (from sounddevice>=0.4.4->mediapipe) (1.15.1)\n", + "Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in d:\\anaconda\\lib\\site-packages (from tensorboard<2.9,>=2.8->tensorflow==2.8.1) (0.4.6)\n", + "Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in d:\\anaconda\\lib\\site-packages (from tensorboard<2.9,>=2.8->tensorflow==2.8.1) (0.6.1)\n", + "Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in d:\\anaconda\\lib\\site-packages (from tensorboard<2.9,>=2.8->tensorflow==2.8.1) (1.8.1)\n", + "Requirement already satisfied: werkzeug>=0.11.15 in d:\\anaconda\\lib\\site-packages (from tensorboard<2.9,>=2.8->tensorflow==2.8.1) (2.2.2)\n", + "Requirement already satisfied: requests<3,>=2.21.0 in d:\\anaconda\\lib\\site-packages (from tensorboard<2.9,>=2.8->tensorflow==2.8.1) (2.28.1)\n", + "Requirement already satisfied: markdown>=2.6.8 in d:\\anaconda\\lib\\site-packages (from tensorboard<2.9,>=2.8->tensorflow==2.8.1) (3.4.1)\n", + "Requirement already satisfied: google-auth<3,>=1.6.3 in d:\\anaconda\\lib\\site-packages (from tensorboard<2.9,>=2.8->tensorflow==2.8.1) (2.18.0)\n", + "Requirement already satisfied: pycparser in d:\\anaconda\\lib\\site-packages (from CFFI>=1.0->sounddevice>=0.4.4->mediapipe) (2.21)\n", + "Requirement already satisfied: cachetools<6.0,>=2.0.0 in d:\\anaconda\\lib\\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (5.3.0)\n", + "Requirement already satisfied: urllib3<2.0 in d:\\anaconda\\lib\\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (1.26.14)\n", + "Requirement already satisfied: rsa<5,>=3.1.4 in d:\\anaconda\\lib\\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (4.9)\n", + "Requirement already satisfied: pyasn1-modules>=0.2.1 in d:\\anaconda\\lib\\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (0.2.8)\n", + "Requirement already satisfied: requests-oauthlib>=0.7.0 in d:\\anaconda\\lib\\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (1.3.1)\n", + "Requirement already satisfied: certifi>=2017.4.17 in d:\\anaconda\\lib\\site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (2022.12.7)\n", + "Requirement already satisfied: idna<4,>=2.5 in d:\\anaconda\\lib\\site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (3.4)\n", + "Requirement already satisfied: charset-normalizer<3,>=2 in d:\\anaconda\\lib\\site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (2.0.4)\n", + "Requirement already satisfied: MarkupSafe>=2.1.1 in d:\\anaconda\\lib\\site-packages (from werkzeug>=0.11.15->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (2.1.1)\n", + "Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in d:\\anaconda\\lib\\site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (0.4.8)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in d:\\anaconda\\lib\\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow==2.8.1) (3.2.2)\n" + ] + } + ], + "source": [ + "#install required libraries\n", + "!pip install tensorflow==2.8.1 tensorflow-gpu==2.8.1 opencv-python mediapipe scikit-learn matplotlib" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "57c212fe", + "metadata": {}, + "outputs": [], + "source": [ + "import cv2\n", + "import numpy as np\n", + "import os\n", + "from matplotlib import pyplot as plt\n", + "import time\n", + "import mediapipe as mp" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "318c40d5", + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "The MediaPipe Holistic pipeline integrates separate models for pose, face and hand components, \n", + "each of which are optimized for their particular domain.\n", + "\"\"\"\n", + "mp_holistic = mp.solutions.holistic # Holistic model\n", + "mp_drawing = mp.solutions.drawing_utils # Drawing utilities" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "8dd80968", + "metadata": {}, + "outputs": [], + "source": [ + "# Pipeline input image preprocessing\n", + "\n", + "def mediapipe_detection(image, model):\n", + " image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # COLOR CONVERSION BGR 2 RGB\n", + " image.flags.writeable = False # Image is no longer writeable\n", + " results = model.process(image) # Make prediction\n", + " image.flags.writeable = True # Image is now writeable \n", + " image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) # COLOR COVERSION RGB 2 BGR\n", + " return image, results" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "a15e53d7", + "metadata": {}, + "outputs": [], + "source": [ + "def draw_landmarks(image, results):\n", + " mp_drawing.draw_landmarks(image, results.face_landmarks, mp_holistic.FACEMESH_CONTOURS) # Draw face connections\n", + " mp_drawing.draw_landmarks(image, results.pose_landmarks, mp_holistic.POSE_CONNECTIONS) # Draw pose connections\n", + " mp_drawing.draw_landmarks(image, results.left_hand_landmarks, mp_holistic.HAND_CONNECTIONS) # Draw left hand connections\n", + " mp_drawing.draw_landmarks(image, results.right_hand_landmarks, mp_holistic.HAND_CONNECTIONS) # Draw right hand connections" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "35bbc8e0", + "metadata": {}, + "outputs": [], + "source": [ + "def draw_styled_landmarks(image, results):\n", + " # Draw face connections\n", + " mp_drawing.draw_landmarks(image, results.face_landmarks, mp_holistic.FACEMESH_CONTOURS, \n", + " mp_drawing.DrawingSpec(color=(80,110,10), thickness=1, circle_radius=1), \n", + " mp_drawing.DrawingSpec(color=(80,256,121), thickness=1, circle_radius=1)\n", + " ) \n", + " # Draw pose connections\n", + " mp_drawing.draw_landmarks(image, results.pose_landmarks, mp_holistic.POSE_CONNECTIONS,\n", + " mp_drawing.DrawingSpec(color=(80,22,10), thickness=2, circle_radius=4), \n", + " mp_drawing.DrawingSpec(color=(80,44,121), thickness=2, circle_radius=2)\n", + " ) \n", + " # Draw left hand connections\n", + " mp_drawing.draw_landmarks(image, results.left_hand_landmarks, mp_holistic.HAND_CONNECTIONS, \n", + " mp_drawing.DrawingSpec(color=(121,22,76), thickness=2, circle_radius=4), \n", + " mp_drawing.DrawingSpec(color=(121,44,250), thickness=2, circle_radius=2)\n", + " ) \n", + " # Draw right hand connections \n", + " mp_drawing.draw_landmarks(image, results.right_hand_landmarks, mp_holistic.HAND_CONNECTIONS, \n", + " mp_drawing.DrawingSpec(color=(245,117,66), thickness=2, circle_radius=4), \n", + " mp_drawing.DrawingSpec(color=(245,66,230), thickness=2, circle_radius=2)\n", + " ) " + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ed16558c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + } + ], + "source": [ + "cap = cv2.VideoCapture(0)\n", + "# Set mediapipe model \n", + "with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic:\n", + " while cap.isOpened():\n", + "\n", + " # Read feed\n", + " ret, frame = cap.read()\n", + "\n", + " # Make detections\n", + " image, results = mediapipe_detection(frame, holistic)\n", + " print(results)\n", + " \n", + " # Draw landmarks\n", + " draw_styled_landmarks(image, results)\n", + "\n", + " # Show to screen\n", + " cv2.imshow('OpenCV Feed', image)\n", + "\n", + " # Break gracefully\n", + " if cv2.waitKey(10) & 0xFF == ord('q'):\n", + " break\n", + " cap.release()\n", + " cv2.destroyAllWindows()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "adb8ccda", + "metadata": {}, + "outputs": [], + "source": [ + "pose = []\n", + "for res in results.pose_landmarks.landmark:\n", + " test = np.array([res.x, res.y, res.z, res.visibility])\n", + " pose.append(test)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "598bace4", + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "List comprehension which extracts the X,Y and Z coordinates of pose and flattens the arrays\n", + "if the media pipeline detects any pose. If no pose is present then an empty array os added\n", + "Length = 132\n", + "\"\"\"\n", + "pose = np.array([[res.x, res.y, res.z, res.visibility] for res in results.pose_landmarks.landmark]).flatten() if results.pose_landmarks else np.zeros(132)\n", + "\n", + "\"\"\"\n", + "List comprehension which extracts the X,Y and Z coordinates of face and flattens the arrays\n", + "if the media pipeline detects any pose. If no face is present then an empty array os added\n", + "Length = 1404\n", + "\"\"\"\n", + "face = np.array([[res.x, res.y, res.z] for res in results.face_landmarks.landmark]).flatten() if results.face_landmarks else np.zeros(1404)\n", + "\n", + "\"\"\"\n", + "List comprehension which extracts the X,Y and Z coordinates of left hand and flattens the arrays\n", + "if the media pipeline detects any pose. If no left hand is present then an empty array os added\n", + "Length = 63\n", + "\"\"\"\n", + "lh = np.array([[res.x, res.y, res.z] for res in results.left_hand_landmarks.landmark]).flatten() if results.left_hand_landmarks else np.zeros(21*3)\n", + "\n", + "\"\"\"\n", + "List comprehension which extracts the X,Y and Z coordinates of right hand and flattens the arrays\n", + "if the media pipeline detects any pose. If no right hand is present then an empty array os added\n", + "Length = 63\n", + "\"\"\"\n", + "rh = np.array([[res.x, res.y, res.z] for res in results.right_hand_landmarks.landmark]).flatten() if results.right_hand_landmarks else np.zeros(21*3)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6ff71bea", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "26c1063e", + "metadata": {}, + "outputs": [], + "source": [ + "# Function to extract the keypoints mentioned above\n", + "def extract_keypoints(results):\n", + " pose = np.array([[res.x, res.y, res.z, res.visibility] for res in results.pose_landmarks.landmark]).flatten() if results.pose_landmarks else np.zeros(33*4)\n", + " face = np.array([[res.x, res.y, res.z] for res in results.face_landmarks.landmark]).flatten() if results.face_landmarks else np.zeros(468*3)\n", + " lh = np.array([[res.x, res.y, res.z] for res in results.left_hand_landmarks.landmark]).flatten() if results.left_hand_landmarks else np.zeros(21*3)\n", + " rh = np.array([[res.x, res.y, res.z] for res in results.right_hand_landmarks.landmark]).flatten() if results.right_hand_landmarks else np.zeros(21*3)\n", + " return np.concatenate([pose, face, lh, rh])" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "9b7ba8da", + "metadata": {}, + "outputs": [], + "source": [ + "result_test = extract_keypoints(results)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "6026da20", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 0.57771313, 0.60459292, -1.28908217, ..., 0. ,\n", + " 0. , 0. ])" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result_test" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "fe9b7e32", + "metadata": {}, + "outputs": [], + "source": [ + "# Saves file in numpy format in the same directory as the notebook\n", + "np.save('0', result_test)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "abf15050", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 0.57771313, 0.60459292, -1.28908217, ..., 0. ,\n", + " 0. , 0. ])" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "np.load('0.npy')" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "e338e834", + "metadata": {}, + "outputs": [], + "source": [ + "# Path for exported data, numpy arrays\n", + "DATA_PATH = os.path.join('MP_Data') \n", + "\n", + "# Actions that we try to detect\n", + "actions = np.array(['hello', 'thanks', 'iloveyou','yes','no','good','bad','nice','namaste','sorry'])\n", + "\n", + "# Thirty videos worth of data\n", + "no_sequences = 30\n", + "\n", + "# Videos are going to be 30 frames in length\n", + "sequence_length = 30\n", + "\n", + "# Folder start\n", + "start_folder = 30" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "113f9bad", + "metadata": {}, + "outputs": [], + "source": [ + "for action in actions: \n", + " for sequence in range(no_sequences):\n", + " try: \n", + " os.makedirs(os.path.join(DATA_PATH, action, str(sequence)))\n", + " except:\n", + " pass" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "0651fee2", + "metadata": {}, + "outputs": [], + "source": [ + "cap = cv2.VideoCapture(0)\n", + "# Set mediapipe model \n", + "with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic:\n", + " \n", + " # NEW LOOP\n", + " # Loop through actions\n", + " for action in actions:\n", + " # Loop through sequences aka videos\n", + " for sequence in range(no_sequences):\n", + " # Loop through video length aka sequence length\n", + " for frame_num in range(sequence_length):\n", + "\n", + " # Read feed\n", + " ret, frame = cap.read()\n", + "\n", + " # Make detections\n", + " image, results = mediapipe_detection(frame, holistic)\n", + "# print(results)\n", + "\n", + " # Draw landmarks\n", + " draw_styled_landmarks(image, results)\n", + " \n", + " # NEW Apply wait logic\n", + " if frame_num == 0: \n", + " cv2.putText(image, 'STARTING COLLECTION', (120,200), \n", + " cv2.FONT_HERSHEY_SIMPLEX, 1, (0,255, 0), 4, cv2.LINE_AA)\n", + " cv2.putText(image, 'Collecting frames for {} Video Number {}'.format(action, sequence), (15,12), \n", + " cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 1, cv2.LINE_AA)\n", + " # Show to screen\n", + " cv2.imshow('OpenCV Feed', image)\n", + " cv2.waitKey(2000)\n", + " else: \n", + " cv2.putText(image, 'Collecting frames for {} Video Number {}'.format(action, sequence), (15,12), \n", + " cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 1, cv2.LINE_AA)\n", + " # Show to screen\n", + " cv2.imshow('OpenCV Feed', image)\n", + " \n", + " # NEW Export keypoints\n", + " keypoints = extract_keypoints(results)\n", + " npy_path = os.path.join(DATA_PATH, action, str(sequence), str(frame_num))\n", + " np.save(npy_path, keypoints)\n", + "\n", + " # Break gracefully\n", + " if cv2.waitKey(10) & 0xFF == ord('q'):\n", + " break\n", + " \n", + " cap.release()\n", + " cv2.destroyAllWindows()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "41f400e8", + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.model_selection import train_test_split\n", + "from tensorflow.keras.utils import to_categorical" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "00aa4f5e", + "metadata": {}, + "outputs": [], + "source": [ + "label_map = {label:num for num, label in enumerate(actions)}" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "6015b4b6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'hello': 0,\n", + " 'thanks': 1,\n", + " 'iloveyou': 2,\n", + " 'yes': 3,\n", + " 'no': 4,\n", + " 'good': 5,\n", + " 'bad': 6,\n", + " 'nice': 7,\n", + " 'namaste': 8,\n", + " 'sorry': 9}" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "label_map" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "99c190a2", + "metadata": {}, + "outputs": [], + "source": [ + "sequences, labels = [], []\n", + "for action in actions:\n", + " for sequence in range(no_sequences):\n", + " window = []\n", + " for frame_num in range(sequence_length):\n", + " res = np.load(os.path.join(DATA_PATH, action, str(sequence), \"{}.npy\".format(frame_num)))\n", + " window.append(res)\n", + " sequences.append(window)\n", + " labels.append(label_map[action])" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "8a8cfa81", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(300, 30, 1662)" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "np.array(sequences).shape" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "934683f4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(300,)" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "np.array(labels).shape" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "bb2badc1", + "metadata": {}, + "outputs": [], + "source": [ + "X = np.array(sequences)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "9c7108a0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(300, 30, 1662)" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "X.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "e1b40eeb", + "metadata": {}, + "outputs": [], + "source": [ + "y = to_categorical(labels).astype(int)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "16e74cb1", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1, 0, 0, ..., 0, 0, 0],\n", + " [1, 0, 0, ..., 0, 0, 0],\n", + " [1, 0, 0, ..., 0, 0, 0],\n", + " ...,\n", + " [0, 0, 0, ..., 0, 0, 1],\n", + " [0, 0, 0, ..., 0, 0, 1],\n", + " [0, 0, 0, ..., 0, 0, 1]])" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "44b393be", + "metadata": {}, + "outputs": [], + "source": [ + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.05)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "f62738fc", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(15, 10)" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_test.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "788f432e", + "metadata": {}, + "outputs": [], + "source": [ + "from tensorflow.keras.models import Sequential\n", + "from tensorflow.keras.layers import LSTM, Dense\n", + "from tensorflow.keras.callbacks import TensorBoard\n", + "import os" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "00543103", + "metadata": {}, + "outputs": [], + "source": [ + "log_dir = os.path.join('Logs')\n", + "tb_callback = TensorBoard(log_dir=log_dir)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b467960e", + "metadata": {}, + "outputs": [], + "source": [ + "model = Sequential()\n", + "model.add(LSTM(64, return_sequences=True, activation='relu', input_shape=(30,1662)))\n", + "model.add(LSTM(128, return_sequences=True, activation='relu'))\n", + "model.add(LSTM(64, return_sequences=False, activation='relu'))\n", + "model.add(Dense(64, activation='relu'))\n", + "model.add(Dense(32, activation='relu'))\n", + "model.add(Dense(actions.shape[0], activation='softmax'))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "e7b58e40", + "metadata": {}, + "outputs": [], + "source": [ + "res = [.7, 0.2, 0.1,0,0,0,0,0,0,0]" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "id": "62bf4022", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'hello'" + ] + }, + "execution_count": 89, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "actions[np.argmax(res)]" + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "id": "cc13435a", + "metadata": {}, + "outputs": [], + "source": [ + "model.compile(optimizer='Adam', loss='categorical_crossentropy', metrics=['categorical_accuracy'])" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "id": "741905ac", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/2000\n", + "9/9 [==============================] - 5s 118ms/step - loss: 2.4021 - categorical_accuracy: 0.1228\n", + "Epoch 2/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 4.3529 - categorical_accuracy: 0.1123\n", + "Epoch 3/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 2.4157 - categorical_accuracy: 0.1158\n", + "Epoch 4/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 2.4053 - categorical_accuracy: 0.0526\n", + "Epoch 5/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 2.2986 - categorical_accuracy: 0.1404\n", + "Epoch 6/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 2.1665 - categorical_accuracy: 0.1789\n", + "Epoch 7/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 2.1746 - categorical_accuracy: 0.1333\n", + "Epoch 8/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 2.0624 - categorical_accuracy: 0.2316\n", + "Epoch 9/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 1.8890 - categorical_accuracy: 0.2632\n", + "Epoch 10/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 1.8293 - categorical_accuracy: 0.2842\n", + "Epoch 11/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 1.5725 - categorical_accuracy: 0.3333\n", + "Epoch 12/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 1.5594 - categorical_accuracy: 0.3684\n", + "Epoch 13/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 1.6275 - categorical_accuracy: 0.2947\n", + "Epoch 14/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 1.4383 - categorical_accuracy: 0.3754\n", + "Epoch 15/2000\n", + "9/9 [==============================] - 1s 132ms/step - loss: 1.2044 - categorical_accuracy: 0.4807\n", + "Epoch 16/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 1.1853 - categorical_accuracy: 0.4281\n", + "Epoch 17/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 1.3314 - categorical_accuracy: 0.4316\n", + "Epoch 18/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 1.2754 - categorical_accuracy: 0.4561\n", + "Epoch 19/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.9972 - categorical_accuracy: 0.5298\n", + "Epoch 20/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 1.2750 - categorical_accuracy: 0.4211\n", + "Epoch 21/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 1.3960 - categorical_accuracy: 0.4456\n", + "Epoch 22/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 1.1518 - categorical_accuracy: 0.5333\n", + "Epoch 23/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 1.0402 - categorical_accuracy: 0.5298\n", + "Epoch 24/2000\n", + "9/9 [==============================] - 1s 146ms/step - loss: 0.8259 - categorical_accuracy: 0.7018\n", + "Epoch 25/2000\n", + "9/9 [==============================] - 1s 141ms/step - loss: 0.7935 - categorical_accuracy: 0.6491\n", + "Epoch 26/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.8159 - categorical_accuracy: 0.6737\n", + "Epoch 27/2000\n", + "9/9 [==============================] - 1s 131ms/step - loss: 0.8842 - categorical_accuracy: 0.6175\n", + "Epoch 28/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.8617 - categorical_accuracy: 0.6456\n", + "Epoch 29/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.7818 - categorical_accuracy: 0.6456\n", + "Epoch 30/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.8268 - categorical_accuracy: 0.6842\n", + "Epoch 31/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 1.7307 - categorical_accuracy: 0.3263\n", + "Epoch 32/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 1.9048 - categorical_accuracy: 0.3088\n", + "Epoch 33/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 1.5614 - categorical_accuracy: 0.2737\n", + "Epoch 34/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 1.2752 - categorical_accuracy: 0.4421\n", + "Epoch 35/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.1033 - categorical_accuracy: 0.5368\n", + "Epoch 36/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.9266 - categorical_accuracy: 0.5684\n", + "Epoch 37/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.9386 - categorical_accuracy: 0.5333\n", + "Epoch 38/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.9498 - categorical_accuracy: 0.5684\n", + "Epoch 39/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.9902 - categorical_accuracy: 0.5404\n", + "Epoch 40/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.8886 - categorical_accuracy: 0.6000\n", + "Epoch 41/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.8160 - categorical_accuracy: 0.6175\n", + "Epoch 42/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.7469 - categorical_accuracy: 0.6632\n", + "Epoch 43/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.8852 - categorical_accuracy: 0.6175\n", + "Epoch 44/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.8029 - categorical_accuracy: 0.6386\n", + "Epoch 45/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.7143 - categorical_accuracy: 0.6737\n", + "Epoch 46/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.6022 - categorical_accuracy: 0.7263\n", + "Epoch 47/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.5523 - categorical_accuracy: 0.7404\n", + "Epoch 48/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.6029 - categorical_accuracy: 0.7018\n", + "Epoch 49/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.7420 - categorical_accuracy: 0.6667\n", + "Epoch 50/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.6357 - categorical_accuracy: 0.7263\n", + "Epoch 51/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.5609 - categorical_accuracy: 0.7754\n", + "Epoch 52/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.5377 - categorical_accuracy: 0.7614\n", + "Epoch 53/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.4783 - categorical_accuracy: 0.7789\n", + "Epoch 54/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.5479 - categorical_accuracy: 0.7474\n", + "Epoch 55/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.4885 - categorical_accuracy: 0.7509\n", + "Epoch 56/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.5225 - categorical_accuracy: 0.7825\n", + "Epoch 57/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.5148 - categorical_accuracy: 0.7754\n", + "Epoch 58/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.5663 - categorical_accuracy: 0.7474\n", + "Epoch 59/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4919 - categorical_accuracy: 0.7719\n", + "Epoch 60/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.6808 - categorical_accuracy: 0.7439\n", + "Epoch 61/2000\n", + "9/9 [==============================] - 1s 139ms/step - loss: 0.5757 - categorical_accuracy: 0.7579\n", + "Epoch 62/2000\n", + "9/9 [==============================] - 1s 138ms/step - loss: 0.4914 - categorical_accuracy: 0.7509\n", + "Epoch 63/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.4735 - categorical_accuracy: 0.7930\n", + "Epoch 64/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.4398 - categorical_accuracy: 0.8140\n", + "Epoch 65/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 0.4059 - categorical_accuracy: 0.8316\n", + "Epoch 66/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.8349 - categorical_accuracy: 0.6632\n", + "Epoch 67/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.7754 - categorical_accuracy: 0.6807\n", + "Epoch 68/2000\n", + "9/9 [==============================] - 1s 147ms/step - loss: 0.7388 - categorical_accuracy: 0.7053\n", + "Epoch 69/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.7317 - categorical_accuracy: 0.7123\n", + "Epoch 70/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.6040 - categorical_accuracy: 0.7509\n", + "Epoch 71/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.4508 - categorical_accuracy: 0.8140\n", + "Epoch 72/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.5055 - categorical_accuracy: 0.8070\n", + "Epoch 73/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.6285 - categorical_accuracy: 0.7368\n", + "Epoch 74/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.6332 - categorical_accuracy: 0.7474\n", + "Epoch 75/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.4778 - categorical_accuracy: 0.8035\n", + "Epoch 76/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.5489 - categorical_accuracy: 0.7474\n", + "Epoch 77/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4846 - categorical_accuracy: 0.8000\n", + "Epoch 78/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.4620 - categorical_accuracy: 0.7895\n", + "Epoch 79/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3924 - categorical_accuracy: 0.8421\n", + "Epoch 80/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3627 - categorical_accuracy: 0.8246\n", + "Epoch 81/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3656 - categorical_accuracy: 0.8351\n", + "Epoch 82/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2769 - categorical_accuracy: 0.8982\n", + "Epoch 83/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.2774 - categorical_accuracy: 0.8912\n", + "Epoch 84/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3045 - categorical_accuracy: 0.8667\n", + "Epoch 85/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3478 - categorical_accuracy: 0.8632\n", + "Epoch 86/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4288 - categorical_accuracy: 0.8175\n", + "Epoch 87/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 1.4015 - categorical_accuracy: 0.6386\n", + "Epoch 88/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.7188 - categorical_accuracy: 0.3088\n", + "Epoch 89/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.6454 - categorical_accuracy: 0.3649\n", + "Epoch 90/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.5917 - categorical_accuracy: 0.3789\n", + "Epoch 91/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.2341 - categorical_accuracy: 0.4947\n", + "Epoch 92/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.9977 - categorical_accuracy: 0.5439\n", + "Epoch 93/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.9420 - categorical_accuracy: 0.5895\n", + "Epoch 94/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.8631 - categorical_accuracy: 0.6491\n", + "Epoch 95/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.9501 - categorical_accuracy: 0.5930\n", + "Epoch 96/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.8816 - categorical_accuracy: 0.6175\n", + "Epoch 97/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.6717 - categorical_accuracy: 0.7509\n", + "Epoch 98/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.6838 - categorical_accuracy: 0.6807\n", + "Epoch 99/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.6155 - categorical_accuracy: 0.7228\n", + "Epoch 100/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.5376 - categorical_accuracy: 0.7474\n", + "Epoch 101/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4408 - categorical_accuracy: 0.8070\n", + "Epoch 102/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4503 - categorical_accuracy: 0.8000\n", + "Epoch 103/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3964 - categorical_accuracy: 0.8421\n", + "Epoch 104/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4013 - categorical_accuracy: 0.8632\n", + "Epoch 105/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4114 - categorical_accuracy: 0.8351\n", + "Epoch 106/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3951 - categorical_accuracy: 0.8526\n", + "Epoch 107/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3622 - categorical_accuracy: 0.8386\n", + "Epoch 108/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3310 - categorical_accuracy: 0.8807\n", + "Epoch 109/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3516 - categorical_accuracy: 0.8632\n", + "Epoch 110/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2887 - categorical_accuracy: 0.8807\n", + "Epoch 111/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.2614 - categorical_accuracy: 0.8982\n", + "Epoch 112/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2344 - categorical_accuracy: 0.9123\n", + "Epoch 113/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2546 - categorical_accuracy: 0.8842\n", + "Epoch 114/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2448 - categorical_accuracy: 0.9018\n", + "Epoch 115/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.2077 - categorical_accuracy: 0.9123\n", + "Epoch 116/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2774 - categorical_accuracy: 0.8947\n", + "Epoch 117/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.5040 - categorical_accuracy: 0.8386\n", + "Epoch 118/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 1.4791 - categorical_accuracy: 0.5789\n", + "Epoch 119/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.8223 - categorical_accuracy: 0.6667\n", + "Epoch 120/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.5985 - categorical_accuracy: 0.7368\n", + "Epoch 121/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.4325 - categorical_accuracy: 0.8386\n", + "Epoch 122/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.7149 - categorical_accuracy: 0.7684\n", + "Epoch 123/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 2.1578 - categorical_accuracy: 0.6912\n", + "Epoch 124/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 3.1798 - categorical_accuracy: 0.1263\n", + "Epoch 125/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 2.0795 - categorical_accuracy: 0.2596\n", + "Epoch 126/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.8545 - categorical_accuracy: 0.3509\n", + "Epoch 127/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 2.9202 - categorical_accuracy: 0.2386\n", + "Epoch 128/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 2.2940 - categorical_accuracy: 0.1298\n", + "Epoch 129/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 2.2329 - categorical_accuracy: 0.1789\n", + "Epoch 130/2000\n", + "9/9 [==============================] - 1s 133ms/step - loss: 2.1173 - categorical_accuracy: 0.3228\n", + "Epoch 131/2000\n", + "9/9 [==============================] - 1s 127ms/step - loss: 1.9025 - categorical_accuracy: 0.2351\n", + "Epoch 132/2000\n", + "9/9 [==============================] - 1s 148ms/step - loss: 1.6941 - categorical_accuracy: 0.3193\n", + "Epoch 133/2000\n", + "9/9 [==============================] - 1s 136ms/step - loss: 1.5698 - categorical_accuracy: 0.3228\n", + "Epoch 134/2000\n", + "9/9 [==============================] - 1s 138ms/step - loss: 1.6399 - categorical_accuracy: 0.3474\n", + "Epoch 135/2000\n", + "9/9 [==============================] - 1s 142ms/step - loss: 1.9838 - categorical_accuracy: 0.2140\n", + "Epoch 136/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 1.7958 - categorical_accuracy: 0.3368\n", + "Epoch 137/2000\n", + "9/9 [==============================] - 1s 127ms/step - loss: 1.5072 - categorical_accuracy: 0.4211\n", + "Epoch 138/2000\n", + "9/9 [==============================] - 1s 109ms/step - loss: 1.3103 - categorical_accuracy: 0.5053\n", + "Epoch 139/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 1.3948 - categorical_accuracy: 0.3965\n", + "Epoch 140/2000\n", + "9/9 [==============================] - 1s 110ms/step - loss: 1.9299 - categorical_accuracy: 0.2667\n", + "Epoch 141/2000\n", + "9/9 [==============================] - 1s 109ms/step - loss: 1.5283 - categorical_accuracy: 0.3474\n", + "Epoch 142/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 1.4431 - categorical_accuracy: 0.4561\n", + "Epoch 143/2000\n", + "9/9 [==============================] - 1s 110ms/step - loss: 1.1819 - categorical_accuracy: 0.5228\n", + "Epoch 144/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 1.0633 - categorical_accuracy: 0.5368\n", + "Epoch 145/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.6234 - categorical_accuracy: 0.4281\n", + "Epoch 146/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 2.2608 - categorical_accuracy: 0.2105\n", + "Epoch 147/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.7733 - categorical_accuracy: 0.3123\n", + "Epoch 148/2000\n", + "9/9 [==============================] - 1s 132ms/step - loss: 1.9005 - categorical_accuracy: 0.2667\n", + "Epoch 149/2000\n", + "9/9 [==============================] - 1s 131ms/step - loss: 1.9066 - categorical_accuracy: 0.2667\n", + "Epoch 150/2000\n", + "9/9 [==============================] - 1s 129ms/step - loss: 1.6025 - categorical_accuracy: 0.3789\n", + "Epoch 151/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 1.3761 - categorical_accuracy: 0.4070\n", + "Epoch 152/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.0522 - categorical_accuracy: 0.5860\n", + "Epoch 153/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.9775 - categorical_accuracy: 0.5825\n", + "Epoch 154/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.0953 - categorical_accuracy: 0.5193\n", + "Epoch 155/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.8974 - categorical_accuracy: 0.6070\n", + "Epoch 156/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.0112 - categorical_accuracy: 0.5474\n", + "Epoch 157/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.8234 - categorical_accuracy: 0.6140\n", + "Epoch 158/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.6992 - categorical_accuracy: 0.7018\n", + "Epoch 159/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.6724 - categorical_accuracy: 0.7123\n", + "Epoch 160/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.9119 - categorical_accuracy: 0.5965\n", + "Epoch 161/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.7887 - categorical_accuracy: 0.6842\n", + "Epoch 162/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.7026 - categorical_accuracy: 0.7228\n", + "Epoch 163/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.7752 - categorical_accuracy: 0.6351\n", + "Epoch 164/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.6573 - categorical_accuracy: 0.7088\n", + "Epoch 165/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.7216 - categorical_accuracy: 0.6772\n", + "Epoch 166/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.7084 - categorical_accuracy: 0.6632\n", + "Epoch 167/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.5464 - categorical_accuracy: 0.7719\n", + "Epoch 168/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4610 - categorical_accuracy: 0.8526\n", + "Epoch 169/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.4174 - categorical_accuracy: 0.8281\n", + "Epoch 170/2000\n", + "9/9 [==============================] - 1s 110ms/step - loss: 0.4575 - categorical_accuracy: 0.8035\n", + "Epoch 171/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.4486 - categorical_accuracy: 0.8000\n", + "Epoch 172/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.6829 - categorical_accuracy: 0.7754\n", + "Epoch 173/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 3.1823 - categorical_accuracy: 0.3298\n", + "Epoch 174/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 1.9142 - categorical_accuracy: 0.2877\n", + "Epoch 175/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 1.4925 - categorical_accuracy: 0.3930\n", + "Epoch 176/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 1.1498 - categorical_accuracy: 0.5439\n", + "Epoch 177/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.9395 - categorical_accuracy: 0.6281\n", + "Epoch 178/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.7772 - categorical_accuracy: 0.6982\n", + "Epoch 179/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.7560 - categorical_accuracy: 0.6772\n", + "Epoch 180/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.6175 - categorical_accuracy: 0.7754\n", + "Epoch 181/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.6107 - categorical_accuracy: 0.7474\n", + "Epoch 182/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.6461 - categorical_accuracy: 0.7579\n", + "Epoch 183/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.6192 - categorical_accuracy: 0.7439\n", + "Epoch 184/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.5603 - categorical_accuracy: 0.7754\n", + "Epoch 185/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.5214 - categorical_accuracy: 0.8211\n", + "Epoch 186/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.5052 - categorical_accuracy: 0.7754\n", + "Epoch 187/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.4252 - categorical_accuracy: 0.8561\n", + "Epoch 188/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3960 - categorical_accuracy: 0.8526\n", + "Epoch 189/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3914 - categorical_accuracy: 0.8316\n", + "Epoch 190/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3190 - categorical_accuracy: 0.8877\n", + "Epoch 191/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3669 - categorical_accuracy: 0.8246\n", + "Epoch 192/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.4882 - categorical_accuracy: 0.8175\n", + "Epoch 193/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.5569 - categorical_accuracy: 0.7649\n", + "Epoch 194/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.5772 - categorical_accuracy: 0.7263\n", + "Epoch 195/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 1.5400 - categorical_accuracy: 0.7018\n", + "Epoch 196/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.8790 - categorical_accuracy: 0.6316\n", + "Epoch 197/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.6054 - categorical_accuracy: 0.7719\n", + "Epoch 198/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.5130 - categorical_accuracy: 0.7860\n", + "Epoch 199/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.4146 - categorical_accuracy: 0.8491\n", + "Epoch 200/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4150 - categorical_accuracy: 0.8070\n", + "Epoch 201/2000\n", + "9/9 [==============================] - 1s 111ms/step - loss: 0.7623 - categorical_accuracy: 0.7263\n", + "Epoch 202/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.8070 - categorical_accuracy: 0.6561\n", + "Epoch 203/2000\n", + "9/9 [==============================] - 1s 136ms/step - loss: 0.5868 - categorical_accuracy: 0.7614\n", + "Epoch 204/2000\n", + "9/9 [==============================] - 1s 134ms/step - loss: 0.5313 - categorical_accuracy: 0.7789\n", + "Epoch 205/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.4665 - categorical_accuracy: 0.8246\n", + "Epoch 206/2000\n", + "9/9 [==============================] - 1s 152ms/step - loss: 0.4480 - categorical_accuracy: 0.8140\n", + "Epoch 207/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3787 - categorical_accuracy: 0.8246\n", + "Epoch 208/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3450 - categorical_accuracy: 0.8737\n", + "Epoch 209/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3288 - categorical_accuracy: 0.8772\n", + "Epoch 210/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3122 - categorical_accuracy: 0.8842\n", + "Epoch 211/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2807 - categorical_accuracy: 0.8947\n", + "Epoch 212/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.3131 - categorical_accuracy: 0.8561\n", + "Epoch 213/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.6611 - categorical_accuracy: 0.7544\n", + "Epoch 214/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.5282 - categorical_accuracy: 0.8000\n", + "Epoch 215/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.4813 - categorical_accuracy: 0.7825\n", + "Epoch 216/2000\n", + "9/9 [==============================] - 1s 127ms/step - loss: 0.4759 - categorical_accuracy: 0.7614\n", + "Epoch 217/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.4938 - categorical_accuracy: 0.7965\n", + "Epoch 218/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.4194 - categorical_accuracy: 0.8000\n", + "Epoch 219/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.3754 - categorical_accuracy: 0.8596\n", + "Epoch 220/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.3658 - categorical_accuracy: 0.8491\n", + "Epoch 221/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.3005 - categorical_accuracy: 0.8982\n", + "Epoch 222/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.2670 - categorical_accuracy: 0.9088\n", + "Epoch 223/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.2428 - categorical_accuracy: 0.9263\n", + "Epoch 224/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2247 - categorical_accuracy: 0.9158\n", + "Epoch 225/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.2048 - categorical_accuracy: 0.9228\n", + "Epoch 226/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.2557 - categorical_accuracy: 0.8912\n", + "Epoch 227/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2756 - categorical_accuracy: 0.8982\n", + "Epoch 228/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.3399 - categorical_accuracy: 0.8526\n", + "Epoch 229/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2809 - categorical_accuracy: 0.8842\n", + "Epoch 230/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.2276 - categorical_accuracy: 0.9088\n", + "Epoch 231/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.2241 - categorical_accuracy: 0.9053\n", + "Epoch 232/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.2499 - categorical_accuracy: 0.8982\n", + "Epoch 233/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.2025 - categorical_accuracy: 0.9228\n", + "Epoch 234/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.2529 - categorical_accuracy: 0.8947\n", + "Epoch 235/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.2167 - categorical_accuracy: 0.9123\n", + "Epoch 236/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.1989 - categorical_accuracy: 0.9193\n", + "Epoch 237/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2316 - categorical_accuracy: 0.9088\n", + "Epoch 238/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.4261 - categorical_accuracy: 0.8035\n", + "Epoch 239/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.4571 - categorical_accuracy: 0.8175\n", + "Epoch 240/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.3028 - categorical_accuracy: 0.8912\n", + "Epoch 241/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.2979 - categorical_accuracy: 0.8702\n", + "Epoch 242/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.2110 - categorical_accuracy: 0.9193\n", + "Epoch 243/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.3449 - categorical_accuracy: 0.8491\n", + "Epoch 244/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.3318 - categorical_accuracy: 0.8596\n", + "Epoch 245/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2981 - categorical_accuracy: 0.8702\n", + "Epoch 246/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.2362 - categorical_accuracy: 0.8947\n", + "Epoch 247/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.2080 - categorical_accuracy: 0.9193\n", + "Epoch 248/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.2032 - categorical_accuracy: 0.9088\n", + "Epoch 249/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.2552 - categorical_accuracy: 0.8842\n", + "Epoch 250/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.1976 - categorical_accuracy: 0.9193\n", + "Epoch 251/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.1844 - categorical_accuracy: 0.9298\n", + "Epoch 252/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.1508 - categorical_accuracy: 0.9333\n", + "Epoch 253/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.1499 - categorical_accuracy: 0.9404\n", + "Epoch 254/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.1613 - categorical_accuracy: 0.9298\n", + "Epoch 255/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.2569 - categorical_accuracy: 0.9053\n", + "Epoch 256/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.6561 - categorical_accuracy: 0.8000\n", + "Epoch 257/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.8307 - categorical_accuracy: 0.7263\n", + "Epoch 258/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.5348 - categorical_accuracy: 0.7895\n", + "Epoch 259/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.4449 - categorical_accuracy: 0.8211\n", + "Epoch 260/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.3721 - categorical_accuracy: 0.8912\n", + "Epoch 261/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.3182 - categorical_accuracy: 0.8807\n", + "Epoch 262/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.2657 - categorical_accuracy: 0.9053\n", + "Epoch 263/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2404 - categorical_accuracy: 0.9228\n", + "Epoch 264/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2020 - categorical_accuracy: 0.9333\n", + "Epoch 265/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.1810 - categorical_accuracy: 0.9368\n", + "Epoch 266/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.1578 - categorical_accuracy: 0.9333\n", + "Epoch 267/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.1963 - categorical_accuracy: 0.9368\n", + "Epoch 268/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.3477 - categorical_accuracy: 0.8842\n", + "Epoch 269/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.3184 - categorical_accuracy: 0.8702\n", + "Epoch 270/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.2469 - categorical_accuracy: 0.9018\n", + "Epoch 271/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.2087 - categorical_accuracy: 0.9228\n", + "Epoch 272/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.1956 - categorical_accuracy: 0.9123\n", + "Epoch 273/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.1485 - categorical_accuracy: 0.9404\n", + "Epoch 274/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.1187 - categorical_accuracy: 0.9544\n", + "Epoch 275/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.1225 - categorical_accuracy: 0.9614\n", + "Epoch 276/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.1354 - categorical_accuracy: 0.9544\n", + "Epoch 277/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.1261 - categorical_accuracy: 0.9614\n", + "Epoch 278/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.0976 - categorical_accuracy: 0.9614\n", + "Epoch 279/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.0969 - categorical_accuracy: 0.9579\n", + "Epoch 280/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.0912 - categorical_accuracy: 0.9579\n", + "Epoch 281/2000\n", + "9/9 [==============================] - 1s 112ms/step - loss: 0.1380 - categorical_accuracy: 0.9544\n", + "Epoch 282/2000\n", + "9/9 [==============================] - 1s 114ms/step - loss: 0.1140 - categorical_accuracy: 0.9579\n", + "Epoch 283/2000\n", + "9/9 [==============================] - 1s 113ms/step - loss: 0.0873 - categorical_accuracy: 0.9614\n", + "Epoch 284/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.0819 - categorical_accuracy: 0.9719\n", + "Epoch 285/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.0937 - categorical_accuracy: 0.9649\n", + "Epoch 286/2000\n", + "9/9 [==============================] - 1s 126ms/step - loss: 0.0875 - categorical_accuracy: 0.9684\n", + "Epoch 287/2000\n", + "9/9 [==============================] - 1s 130ms/step - loss: 0.0725 - categorical_accuracy: 0.9789\n", + "Epoch 288/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.0910 - categorical_accuracy: 0.9684\n", + "Epoch 289/2000\n", + "9/9 [==============================] - 1s 128ms/step - loss: 0.1734 - categorical_accuracy: 0.9298\n", + "Epoch 290/2000\n", + "9/9 [==============================] - 1s 141ms/step - loss: 0.1114 - categorical_accuracy: 0.9579\n", + "Epoch 291/2000\n", + "9/9 [==============================] - 1s 140ms/step - loss: 0.0858 - categorical_accuracy: 0.9719\n", + "Epoch 292/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.0893 - categorical_accuracy: 0.9649\n", + "Epoch 293/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.0731 - categorical_accuracy: 0.9754\n", + "Epoch 294/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 0.0947 - categorical_accuracy: 0.9649\n", + "Epoch 295/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.1005 - categorical_accuracy: 0.9614\n", + "Epoch 296/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.0818 - categorical_accuracy: 0.9649\n", + "Epoch 297/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.2293 - categorical_accuracy: 0.9263\n", + "Epoch 298/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 1.9835 - categorical_accuracy: 0.7053\n", + "Epoch 299/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.6036 - categorical_accuracy: 0.7333\n", + "Epoch 300/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.4299 - categorical_accuracy: 0.8456\n", + "Epoch 301/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.4668 - categorical_accuracy: 0.8351\n", + "Epoch 302/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.3494 - categorical_accuracy: 0.8702\n", + "Epoch 303/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.2678 - categorical_accuracy: 0.9263\n", + "Epoch 304/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.2011 - categorical_accuracy: 0.9439\n", + "Epoch 305/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.1964 - categorical_accuracy: 0.9298\n", + "Epoch 306/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.1633 - categorical_accuracy: 0.9509\n", + "Epoch 307/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.1282 - categorical_accuracy: 0.9649\n", + "Epoch 308/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.1051 - categorical_accuracy: 0.9684\n", + "Epoch 309/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.1763 - categorical_accuracy: 0.9404\n", + "Epoch 310/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.5032 - categorical_accuracy: 0.8246\n", + "Epoch 311/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.7168 - categorical_accuracy: 0.7825\n", + "Epoch 312/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.3908 - categorical_accuracy: 0.8737\n", + "Epoch 313/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.2890 - categorical_accuracy: 0.8947\n", + "Epoch 314/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.2053 - categorical_accuracy: 0.9474\n", + "Epoch 315/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.2044 - categorical_accuracy: 0.9509\n", + "Epoch 316/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.2047 - categorical_accuracy: 0.9404\n", + "Epoch 317/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.1618 - categorical_accuracy: 0.9404\n", + "Epoch 318/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.1369 - categorical_accuracy: 0.9474\n", + "Epoch 319/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.1168 - categorical_accuracy: 0.9649\n", + "Epoch 320/2000\n", + "9/9 [==============================] - 1s 116ms/step - loss: 0.0951 - categorical_accuracy: 0.9684\n", + "Epoch 321/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.1097 - categorical_accuracy: 0.9754\n", + "Epoch 322/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.1027 - categorical_accuracy: 0.9684\n", + "Epoch 323/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 0.0785 - categorical_accuracy: 0.9719\n", + "Epoch 324/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.0796 - categorical_accuracy: 0.9754\n", + "Epoch 325/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.1314 - categorical_accuracy: 0.9579\n", + "Epoch 326/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 0.2078 - categorical_accuracy: 0.9158\n", + "Epoch 327/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.1289 - categorical_accuracy: 0.9509\n", + "Epoch 328/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.1325 - categorical_accuracy: 0.9579\n", + "Epoch 329/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.1333 - categorical_accuracy: 0.9579\n", + "Epoch 330/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.2234 - categorical_accuracy: 0.9018\n", + "Epoch 331/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.2112 - categorical_accuracy: 0.9158\n", + "Epoch 332/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.1626 - categorical_accuracy: 0.9333\n", + "Epoch 333/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 0.1282 - categorical_accuracy: 0.9579\n", + "Epoch 334/2000\n", + "9/9 [==============================] - 1s 115ms/step - loss: 0.0890 - categorical_accuracy: 0.9684\n", + "Epoch 335/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.0938 - categorical_accuracy: 0.9649\n", + "Epoch 336/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.0813 - categorical_accuracy: 0.9754\n", + "Epoch 337/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.0963 - categorical_accuracy: 0.9544\n", + "Epoch 338/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.1967 - categorical_accuracy: 0.9509\n", + "Epoch 339/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.1176 - categorical_accuracy: 0.9649\n", + "Epoch 340/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.1097 - categorical_accuracy: 0.9684\n", + "Epoch 341/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.1076 - categorical_accuracy: 0.9614\n", + "Epoch 342/2000\n", + "9/9 [==============================] - 1s 146ms/step - loss: 0.0813 - categorical_accuracy: 0.9614\n", + "Epoch 343/2000\n", + "9/9 [==============================] - 1s 128ms/step - loss: 0.0971 - categorical_accuracy: 0.9649\n", + "Epoch 344/2000\n", + "9/9 [==============================] - 1s 133ms/step - loss: 0.0854 - categorical_accuracy: 0.9719\n", + "Epoch 345/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.0727 - categorical_accuracy: 0.9825\n", + "Epoch 346/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.0470 - categorical_accuracy: 0.9860\n", + "Epoch 347/2000\n", + "9/9 [==============================] - 1s 128ms/step - loss: 0.0620 - categorical_accuracy: 0.9754\n", + "Epoch 348/2000\n", + "9/9 [==============================] - 1s 121ms/step - loss: 0.0966 - categorical_accuracy: 0.9684\n", + "Epoch 349/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.1593 - categorical_accuracy: 0.9474\n", + "Epoch 350/2000\n", + "9/9 [==============================] - 1s 126ms/step - loss: 0.1728 - categorical_accuracy: 0.9404\n", + "Epoch 351/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.0886 - categorical_accuracy: 0.9719\n", + "Epoch 352/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.1593 - categorical_accuracy: 0.9474\n", + "Epoch 353/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.0994 - categorical_accuracy: 0.9544\n", + "Epoch 354/2000\n", + "9/9 [==============================] - 1s 128ms/step - loss: 0.0725 - categorical_accuracy: 0.9754\n", + "Epoch 355/2000\n", + "9/9 [==============================] - 1s 128ms/step - loss: 0.0710 - categorical_accuracy: 0.9754\n", + "Epoch 356/2000\n", + "9/9 [==============================] - 1s 127ms/step - loss: 0.0819 - categorical_accuracy: 0.9649\n", + "Epoch 357/2000\n", + "9/9 [==============================] - 1s 131ms/step - loss: 0.0499 - categorical_accuracy: 0.9825\n", + "Epoch 358/2000\n", + "9/9 [==============================] - 1s 133ms/step - loss: 0.0472 - categorical_accuracy: 0.9825\n", + "Epoch 359/2000\n", + "9/9 [==============================] - 1s 134ms/step - loss: 0.0567 - categorical_accuracy: 0.9754\n", + "Epoch 360/2000\n", + "9/9 [==============================] - 1s 130ms/step - loss: 0.0533 - categorical_accuracy: 0.9789\n", + "Epoch 361/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.0329 - categorical_accuracy: 0.9825\n", + "Epoch 362/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.0925 - categorical_accuracy: 0.9544\n", + "Epoch 363/2000\n", + "9/9 [==============================] - 1s 133ms/step - loss: 0.1330 - categorical_accuracy: 0.9404\n", + "Epoch 364/2000\n", + "9/9 [==============================] - 1s 130ms/step - loss: 0.0377 - categorical_accuracy: 0.9895\n", + "Epoch 365/2000\n", + "9/9 [==============================] - 1s 133ms/step - loss: 0.0605 - categorical_accuracy: 0.9789\n", + "Epoch 366/2000\n", + "9/9 [==============================] - 1s 135ms/step - loss: 0.1950 - categorical_accuracy: 0.9263\n", + "Epoch 367/2000\n", + "9/9 [==============================] - 2s 176ms/step - loss: 0.7168 - categorical_accuracy: 0.8211\n", + "Epoch 368/2000\n", + "9/9 [==============================] - 1s 136ms/step - loss: 1.7016 - categorical_accuracy: 0.6246\n", + "Epoch 369/2000\n", + "9/9 [==============================] - 1s 140ms/step - loss: 0.8740 - categorical_accuracy: 0.7439\n", + "Epoch 370/2000\n", + "9/9 [==============================] - 1s 136ms/step - loss: 0.6703 - categorical_accuracy: 0.8070\n", + "Epoch 371/2000\n", + "9/9 [==============================] - 1s 131ms/step - loss: 0.4747 - categorical_accuracy: 0.8737\n", + "Epoch 372/2000\n", + "9/9 [==============================] - 1s 129ms/step - loss: 0.3108 - categorical_accuracy: 0.9544\n", + "Epoch 373/2000\n", + "9/9 [==============================] - 1s 128ms/step - loss: 0.2183 - categorical_accuracy: 0.9579\n", + "Epoch 374/2000\n", + "9/9 [==============================] - 1s 131ms/step - loss: 0.1555 - categorical_accuracy: 0.9825\n", + "Epoch 375/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.1161 - categorical_accuracy: 0.9789\n", + "Epoch 376/2000\n", + "9/9 [==============================] - 1s 126ms/step - loss: 0.0853 - categorical_accuracy: 0.9825\n", + "Epoch 377/2000\n", + "9/9 [==============================] - 1s 133ms/step - loss: 0.0847 - categorical_accuracy: 0.9860\n", + "Epoch 378/2000\n", + "9/9 [==============================] - 1s 150ms/step - loss: 0.0710 - categorical_accuracy: 0.9860\n", + "Epoch 379/2000\n", + "9/9 [==============================] - 1s 124ms/step - loss: 0.0556 - categorical_accuracy: 0.9930\n", + "Epoch 380/2000\n", + "9/9 [==============================] - 1s 130ms/step - loss: 0.0509 - categorical_accuracy: 0.9895\n", + "Epoch 381/2000\n", + "9/9 [==============================] - 1s 134ms/step - loss: 0.0436 - categorical_accuracy: 0.9860\n", + "Epoch 382/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.0470 - categorical_accuracy: 0.9895\n", + "Epoch 383/2000\n", + "9/9 [==============================] - 1s 135ms/step - loss: 0.0346 - categorical_accuracy: 0.9965\n", + "Epoch 384/2000\n", + "9/9 [==============================] - 1s 132ms/step - loss: 0.0280 - categorical_accuracy: 0.9930\n", + "Epoch 385/2000\n", + "9/9 [==============================] - 1s 129ms/step - loss: 0.0331 - categorical_accuracy: 0.9895\n", + "Epoch 386/2000\n", + "9/9 [==============================] - 1s 129ms/step - loss: 0.0393 - categorical_accuracy: 0.9895\n", + "Epoch 387/2000\n", + "9/9 [==============================] - 1s 127ms/step - loss: 0.0182 - categorical_accuracy: 1.0000\n", + "Epoch 388/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.0227 - categorical_accuracy: 1.0000\n", + "Epoch 389/2000\n", + "9/9 [==============================] - 1s 137ms/step - loss: 0.0317 - categorical_accuracy: 0.9965\n", + "Epoch 390/2000\n", + "9/9 [==============================] - 1s 130ms/step - loss: 0.4311 - categorical_accuracy: 0.9158\n", + "Epoch 391/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.2178 - categorical_accuracy: 0.9228\n", + "Epoch 392/2000\n", + "9/9 [==============================] - 1s 132ms/step - loss: 0.1412 - categorical_accuracy: 0.9439\n", + "Epoch 393/2000\n", + "9/9 [==============================] - 1s 133ms/step - loss: 0.1274 - categorical_accuracy: 0.9474\n", + "Epoch 394/2000\n", + "9/9 [==============================] - 1s 138ms/step - loss: 0.0818 - categorical_accuracy: 0.9684\n", + "Epoch 395/2000\n", + "9/9 [==============================] - 1s 129ms/step - loss: 0.0978 - categorical_accuracy: 0.9544\n", + "Epoch 396/2000\n", + "9/9 [==============================] - 1s 120ms/step - loss: 0.0890 - categorical_accuracy: 0.9579\n", + "Epoch 397/2000\n", + "9/9 [==============================] - 1s 122ms/step - loss: 0.0679 - categorical_accuracy: 0.9719\n", + "Epoch 398/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.0740 - categorical_accuracy: 0.9719\n", + "Epoch 399/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.0450 - categorical_accuracy: 0.9895\n", + "Epoch 400/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.0600 - categorical_accuracy: 0.9825\n", + "Epoch 401/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.0427 - categorical_accuracy: 0.9860\n", + "Epoch 402/2000\n", + "9/9 [==============================] - 1s 126ms/step - loss: 0.0247 - categorical_accuracy: 1.0000\n", + "Epoch 403/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.0275 - categorical_accuracy: 0.9965\n", + "Epoch 404/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.0299 - categorical_accuracy: 0.9860\n", + "Epoch 405/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.0362 - categorical_accuracy: 0.9895\n", + "Epoch 406/2000\n", + "9/9 [==============================] - 1s 123ms/step - loss: 0.0228 - categorical_accuracy: 0.9965\n", + "Epoch 407/2000\n", + "9/9 [==============================] - 1s 119ms/step - loss: 0.0198 - categorical_accuracy: 0.9965\n", + "Epoch 408/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.0140 - categorical_accuracy: 0.9965\n", + "Epoch 409/2000\n", + "9/9 [==============================] - 1s 117ms/step - loss: 0.0249 - categorical_accuracy: 0.9965\n", + "Epoch 410/2000\n", + "9/9 [==============================] - 1s 118ms/step - loss: 0.0514 - categorical_accuracy: 0.9825\n", + "Epoch 411/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.0201 - categorical_accuracy: 0.9965\n", + "Epoch 412/2000\n", + "9/9 [==============================] - 1s 137ms/step - loss: 0.0118 - categorical_accuracy: 1.0000\n", + "Epoch 413/2000\n", + "9/9 [==============================] - 1s 125ms/step - loss: 0.0139 - categorical_accuracy: 1.0000\n", + "Epoch 414/2000\n", + "1/9 [==>...........................] - ETA: 1s - loss: 0.0032 - categorical_accuracy: 1.0000" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[91], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfit\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX_train\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my_train\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mepochs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m2000\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcallbacks\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[43mtb_callback\u001b[49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\keras\\utils\\traceback_utils.py:64\u001b[0m, in \u001b[0;36mfilter_traceback..error_handler\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 62\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 63\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m---> 64\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 65\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e: \u001b[38;5;66;03m# pylint: disable=broad-except\u001b[39;00m\n\u001b[0;32m 66\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m _process_traceback_frames(e\u001b[38;5;241m.\u001b[39m__traceback__)\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\keras\\engine\\training.py:1384\u001b[0m, in \u001b[0;36mModel.fit\u001b[1;34m(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing)\u001b[0m\n\u001b[0;32m 1377\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m tf\u001b[38;5;241m.\u001b[39mprofiler\u001b[38;5;241m.\u001b[39mexperimental\u001b[38;5;241m.\u001b[39mTrace(\n\u001b[0;32m 1378\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtrain\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m 1379\u001b[0m epoch_num\u001b[38;5;241m=\u001b[39mepoch,\n\u001b[0;32m 1380\u001b[0m step_num\u001b[38;5;241m=\u001b[39mstep,\n\u001b[0;32m 1381\u001b[0m batch_size\u001b[38;5;241m=\u001b[39mbatch_size,\n\u001b[0;32m 1382\u001b[0m _r\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m):\n\u001b[0;32m 1383\u001b[0m callbacks\u001b[38;5;241m.\u001b[39mon_train_batch_begin(step)\n\u001b[1;32m-> 1384\u001b[0m tmp_logs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtrain_function\u001b[49m\u001b[43m(\u001b[49m\u001b[43miterator\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 1385\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m data_handler\u001b[38;5;241m.\u001b[39mshould_sync:\n\u001b[0;32m 1386\u001b[0m context\u001b[38;5;241m.\u001b[39masync_wait()\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\tensorflow\\python\\util\\traceback_utils.py:150\u001b[0m, in \u001b[0;36mfilter_traceback..error_handler\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 148\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 149\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 150\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 151\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 152\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m _process_traceback_frames(e\u001b[38;5;241m.\u001b[39m__traceback__)\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\tensorflow\\python\\eager\\def_function.py:915\u001b[0m, in \u001b[0;36mFunction.__call__\u001b[1;34m(self, *args, **kwds)\u001b[0m\n\u001b[0;32m 912\u001b[0m compiler \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mxla\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_jit_compile \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnonXla\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 914\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m OptionalXlaContext(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_jit_compile):\n\u001b[1;32m--> 915\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_call(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds)\n\u001b[0;32m 917\u001b[0m new_tracing_count \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexperimental_get_tracing_count()\n\u001b[0;32m 918\u001b[0m without_tracing \u001b[38;5;241m=\u001b[39m (tracing_count \u001b[38;5;241m==\u001b[39m new_tracing_count)\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\tensorflow\\python\\eager\\def_function.py:947\u001b[0m, in \u001b[0;36mFunction._call\u001b[1;34m(self, *args, **kwds)\u001b[0m\n\u001b[0;32m 944\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lock\u001b[38;5;241m.\u001b[39mrelease()\n\u001b[0;32m 945\u001b[0m \u001b[38;5;66;03m# In this case we have created variables on the first call, so we run the\u001b[39;00m\n\u001b[0;32m 946\u001b[0m \u001b[38;5;66;03m# defunned version which is guaranteed to never create variables.\u001b[39;00m\n\u001b[1;32m--> 947\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stateless_fn(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds) \u001b[38;5;66;03m# pylint: disable=not-callable\u001b[39;00m\n\u001b[0;32m 948\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stateful_fn \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 949\u001b[0m \u001b[38;5;66;03m# Release the lock early so that multiple threads can perform the call\u001b[39;00m\n\u001b[0;32m 950\u001b[0m \u001b[38;5;66;03m# in parallel.\u001b[39;00m\n\u001b[0;32m 951\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lock\u001b[38;5;241m.\u001b[39mrelease()\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\tensorflow\\python\\eager\\function.py:2956\u001b[0m, in \u001b[0;36mFunction.__call__\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 2953\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lock:\n\u001b[0;32m 2954\u001b[0m (graph_function,\n\u001b[0;32m 2955\u001b[0m filtered_flat_args) \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_maybe_define_function(args, kwargs)\n\u001b[1;32m-> 2956\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mgraph_function\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_call_flat\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 2957\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiltered_flat_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcaptured_inputs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph_function\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcaptured_inputs\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\tensorflow\\python\\eager\\function.py:1853\u001b[0m, in \u001b[0;36mConcreteFunction._call_flat\u001b[1;34m(self, args, captured_inputs, cancellation_manager)\u001b[0m\n\u001b[0;32m 1849\u001b[0m possible_gradient_type \u001b[38;5;241m=\u001b[39m gradients_util\u001b[38;5;241m.\u001b[39mPossibleTapeGradientTypes(args)\n\u001b[0;32m 1850\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (possible_gradient_type \u001b[38;5;241m==\u001b[39m gradients_util\u001b[38;5;241m.\u001b[39mPOSSIBLE_GRADIENT_TYPES_NONE\n\u001b[0;32m 1851\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m executing_eagerly):\n\u001b[0;32m 1852\u001b[0m \u001b[38;5;66;03m# No tape is watching; skip to running the function.\u001b[39;00m\n\u001b[1;32m-> 1853\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_build_call_outputs(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_inference_function\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcall\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 1854\u001b[0m \u001b[43m \u001b[49m\u001b[43mctx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcancellation_manager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcancellation_manager\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[0;32m 1855\u001b[0m forward_backward \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_select_forward_and_backward_functions(\n\u001b[0;32m 1856\u001b[0m args,\n\u001b[0;32m 1857\u001b[0m possible_gradient_type,\n\u001b[0;32m 1858\u001b[0m executing_eagerly)\n\u001b[0;32m 1859\u001b[0m forward_function, args_with_tangents \u001b[38;5;241m=\u001b[39m forward_backward\u001b[38;5;241m.\u001b[39mforward()\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\tensorflow\\python\\eager\\function.py:499\u001b[0m, in \u001b[0;36m_EagerDefinedFunction.call\u001b[1;34m(self, ctx, args, cancellation_manager)\u001b[0m\n\u001b[0;32m 497\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m _InterpolateFunctionError(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m 498\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cancellation_manager \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m--> 499\u001b[0m outputs \u001b[38;5;241m=\u001b[39m \u001b[43mexecute\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 500\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msignature\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 501\u001b[0m \u001b[43m \u001b[49m\u001b[43mnum_outputs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_num_outputs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 502\u001b[0m \u001b[43m \u001b[49m\u001b[43minputs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 503\u001b[0m \u001b[43m \u001b[49m\u001b[43mattrs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mattrs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 504\u001b[0m \u001b[43m \u001b[49m\u001b[43mctx\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mctx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 505\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 506\u001b[0m outputs \u001b[38;5;241m=\u001b[39m execute\u001b[38;5;241m.\u001b[39mexecute_with_cancellation(\n\u001b[0;32m 507\u001b[0m \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msignature\u001b[38;5;241m.\u001b[39mname),\n\u001b[0;32m 508\u001b[0m num_outputs\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_num_outputs,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 511\u001b[0m ctx\u001b[38;5;241m=\u001b[39mctx,\n\u001b[0;32m 512\u001b[0m cancellation_manager\u001b[38;5;241m=\u001b[39mcancellation_manager)\n", + "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\tensorflow\\python\\eager\\execute.py:54\u001b[0m, in \u001b[0;36mquick_execute\u001b[1;34m(op_name, num_outputs, inputs, attrs, ctx, name)\u001b[0m\n\u001b[0;32m 52\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 53\u001b[0m ctx\u001b[38;5;241m.\u001b[39mensure_initialized()\n\u001b[1;32m---> 54\u001b[0m tensors \u001b[38;5;241m=\u001b[39m \u001b[43mpywrap_tfe\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mTFE_Py_Execute\u001b[49m\u001b[43m(\u001b[49m\u001b[43mctx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_handle\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdevice_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mop_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 55\u001b[0m \u001b[43m \u001b[49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mattrs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnum_outputs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 56\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m core\u001b[38;5;241m.\u001b[39m_NotOkStatusException \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 57\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m name \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "\u001b[1;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "model.fit(X_train, y_train, epochs=2000, callbacks=[tb_callback])" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "id": "9b6f53fd", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Model: \"sequential_3\"\n", + "_________________________________________________________________\n", + " Layer (type) Output Shape Param # \n", + "=================================================================\n", + " lstm_9 (LSTM) (None, 30, 64) 442112 \n", + " \n", + " lstm_10 (LSTM) (None, 30, 128) 98816 \n", + " \n", + " lstm_11 (LSTM) (None, 64) 49408 \n", + " \n", + " dense_9 (Dense) (None, 64) 4160 \n", + " \n", + " dense_10 (Dense) (None, 32) 2080 \n", + " \n", + " dense_11 (Dense) (None, 10) 330 \n", + " \n", + "=================================================================\n", + "Total params: 596,906\n", + "Trainable params: 596,906\n", + "Non-trainable params: 0\n", + "_________________________________________________________________\n" + ] + } + ], + "source": [ + "model.summary()" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "id": "f0ec256c", + "metadata": {}, + "outputs": [], + "source": [ + "res = model.predict(X_test)" + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "id": "2ac0e804", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'good'" + ] + }, + "execution_count": 94, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "actions[np.argmax(res[1])]" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "id": "50366129", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'good'" + ] + }, + "execution_count": 95, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "actions[np.argmax(y_test[1])]" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "id": "55cc5d1d", + "metadata": {}, + "outputs": [], + "source": [ + "model.save('action.h5')" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "id": "e755693f", + "metadata": {}, + "outputs": [], + "source": [ + "del model" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "637c0b4c", + "metadata": {}, + "outputs": [], + "source": [ + "import tensorflow as tf" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f40841bb", + "metadata": {}, + "outputs": [], + "source": [ + "model.load_weights('action.h5')" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "id": "6b8ae44e", + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.metrics import multilabel_confusion_matrix, confusion_matrix,accuracy_score" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "id": "a18a4b88", + "metadata": {}, + "outputs": [], + "source": [ + "yhat = model.predict(X_test)" + ] + }, + { + "cell_type": "code", + "execution_count": 99, + "id": "7fc93c46", + "metadata": {}, + "outputs": [], + "source": [ + "ytrue = np.argmax(y_test, axis=1).tolist()\n", + "yhat = np.argmax(yhat, axis=1).tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "id": "8b1a1877", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[[12, 0],\n", + " [ 0, 3]],\n", + "\n", + " [[14, 1],\n", + " [ 0, 0]],\n", + "\n", + " [[13, 0],\n", + " [ 0, 2]],\n", + "\n", + " [[12, 0],\n", + " [ 1, 2]],\n", + "\n", + " [[14, 0],\n", + " [ 0, 1]],\n", + "\n", + " [[13, 0],\n", + " [ 0, 2]],\n", + "\n", + " [[13, 0],\n", + " [ 0, 2]],\n", + "\n", + " [[14, 0],\n", + " [ 0, 1]],\n", + "\n", + " [[14, 0],\n", + " [ 0, 1]]], dtype=int64)" + ] + }, + "execution_count": 100, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "multilabel_confusion_matrix(ytrue, yhat)" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "id": "01356f20", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.9333333333333333" + ] + }, + "execution_count": 101, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "accuracy_score(ytrue, yhat)" + ] + }, + { + "cell_type": "code", + "execution_count": 111, + "id": "8d03a39d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "iloveyou\n", + "\n", + "iloveyou\n", + "\n", + "iloveyou\n", + "\n", + "iloveyou\n", + "\n", + "iloveyou\n", + "\n", + "yes\n", + "\n", + "yes\n", + "\n", + "yes\n", + "\n", + "yes\n", + "\n", + "hello\n", + "\n", + "hello\n", + "\n", + "hello\n" + ] + } + ], + "source": [ + "# Code block for realtime hand gesture detection and identification\n", + "sequence = []\n", + "sentence = []\n", + "threshold = 0.8\n", + "\n", + "cap = cv2.VideoCapture(0)\n", + "# Set mediapipe model \n", + "with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic:\n", + " while cap.isOpened():\n", + "\n", + " # Read feed\n", + " ret, frame = cap.read()\n", + "\n", + " # Make detections\n", + " image, results = mediapipe_detection(frame, holistic)\n", + " print(results)\n", + " \n", + " # Draw landmarks\n", + " draw_styled_landmarks(image, results)\n", + " \n", + " # 2. Prediction logic\n", + " keypoints = extract_keypoints(results)\n", + "# sequence.insert(0,keypoints)\n", + "# sequence = sequence[:30]\n", + " sequence.append(keypoints)\n", + " sequence = sequence[-30:]\n", + " \n", + " if len(sequence) == 30:\n", + " res = model.predict(np.expand_dims(sequence, axis=0))[0]\n", + " print(actions[np.argmax(res)])\n", + " \n", + " #3. Viz logic\n", + " if res[np.argmax(res)] > threshold: \n", + " if len(sentence) > 0: \n", + " if actions[np.argmax(res)] != sentence[-1]:\n", + " sentence.append(actions[np.argmax(res)])\n", + " else:\n", + " sentence.append(actions[np.argmax(res)])\n", + "\n", + " if len(sentence) > 5: \n", + " sentence = sentence[-5:]\n", + " \n", + " cv2.rectangle(image, (0,0), (640, 40), (245, 117, 16), -1)\n", + " cv2.putText(image, ' '.join(sentence), (3,30), \n", + " cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2, cv2.LINE_AA)\n", + " \n", + " # Show to screen\n", + " cv2.imshow('OpenCV Feed', image)\n", + "\n", + " # Break gracefully\n", + " if cv2.waitKey(10) & 0xFF == ord('q'):\n", + " break\n", + " cap.release()\n", + " cv2.destroyAllWindows()" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "id": "eb84fd86", + "metadata": {}, + "outputs": [], + "source": [ + "cap.release()\n", + "cv2.destroyAllWindows()" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "id": "6b1ff572", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "res[np.argmax(res)] > threshold" + ] + }, + { + "cell_type": "markdown", + "id": "c4886698", + "metadata": {}, + "source": [ + "model.predict(np.expand_dims(X_test[0], axis=0))" + ] + }, + { + "cell_type": "markdown", + "id": "0826e16b", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 57402986e30dcce905c24cb2bfd76ef8a1c426b3 Mon Sep 17 00:00:00 2001 From: Rohitsonvane88 <99544328+Rohitsonvane88@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:55:42 +0530 Subject: [PATCH 4/4] Create Documentation-page.html Created Documentation page using pure html and css. --- Fronted Projects/Documentation-page.html | 412 +++++++++++++++++++++++ 1 file changed, 412 insertions(+) create mode 100644 Fronted Projects/Documentation-page.html diff --git a/Fronted Projects/Documentation-page.html b/Fronted Projects/Documentation-page.html new file mode 100644 index 00000000..555095b0 --- /dev/null +++ b/Fronted Projects/Documentation-page.html @@ -0,0 +1,412 @@ + + + + + + +
+
+

Introduction

+
+

+ HTML is an acronym for HyperText Markup Language, and it is the + standard language for creating web-pages. Every web page you surf on + your browser is built using HTML. The primary use of HTML to provide + a proper structure to the web-page so all the content or data of the + page could represent adequately. A stand-alone HTML can create only + static and skeleton looking black and white pages, but with the help + of CSS and JavaScript , we can create a more interactive and + intuitive web-page. When we try to visit a website or click on the + link, we basically request the server to show us the page, then the + server acts on our request and sends us an appropriate HTML document + as a response. Then this HTML document parsed by browse, and we able + to see the content. +

+

HTML Document

+
+<!DOCTYPE html>
+                <html>
+                <head>
+                <title>Page Title</title>
+                </head>
+                <body>
+
+                <h1>This is a Heading</h1>
+                <p>This is a paragraph.</p>
+
+                </body>
+                </html>
+
+
+
+

HTML Editors

+
+

+ However, you can use notepad to create and edit HTML documents, but + we recommend to install an open-source editor. There are many free + to use text-editor software present on the internet, which provides + a better interactive User interface and some add-on functionality + which you miss on a notepad. +

+

Here is the list of top 4 HTML text editors you can pick:

+ +
    +
  • Sublime Text Editor
  • +
  • Notepad++
  • +
  • Visual Studio Code
  • +
  • Atom
  • +
+
+
+
+

HTML Elements

+
+

+ The HTML elements provide the semantic meaning to the web-page + content. We usually interchangeably use the term HTML elements and + tags, but technically both are different. An HTML tag is just a + character inside the angle bracket<>, whereas the HTML element is a + collection of starting tag, its attribute, content and end tag. For + example: +

+
<p class= "para"> Hello World </p>
+
+
+
+

HTML Attributes

+
+

+ In HTML, the attributes are used to provide additional information + about the elements. For most of the HTML elements, attributes are + optional, but there are some elements where we have to deliver the + attributes. Attributes always specified within the opening tag of + the HTML element and they specified in a name and value pair. + Example +

+
<image src= "cat.jpg" alt ="cat image">
+

+ In this example src ="cat.jpg" and alt="cat image" are two + attributes where src and alt are attributes name and "cat.jpg" and + "cat image" are attributes values. Here alt attribute is optional, + but src is mandatory because src specify which image to show. There + should be at least one space gap between two attributes, and the + value of the attributes must have resided in the double inverted + comma. Some most important HTML +

+
+
+
+

HTML Heading

+

+ To display the section heading, title or subtitle we can use the HTML + heading tags. In HTML 5 we have 6 heading tags start from <h1> + up to <h6>, where <h1> specify the largest heading and + <h6> represent the smallest or sub heading. If the content is + specified by heading tags, then it would be displayed large and bold + as compared to other text content present on the web-page. + Example +

+
+<h1>First Heading </h1>
+            <h2>Second Heading </h2>
+            <h3>Third Heading </h3>
+            <h4>Forth Heading </h4>
+            <h5>Fifth Heading </h5>
+            <h6>Sixth Heading </h6>
+
+
+

HTML Paragraph

+
+

+ In HTML paragraphs can be defined using <p> element. Paragraph + text always starts from a new line, the browser parsed the <p> + tag and automatically add some margin and white space after the end + </p> tag. +

+
+<p> Hello! and Welcome to TechGeekBuzz </p>
+                <p> Here you get to know all about the latest technology. </p>
+
+
+
+

HTML Style

+
+

+ Every browser has a specific engine that parses the HTML document and displays a default style of the page content. +

+
<body style="background-color:yellow;">
+
+                <h1>TechGeekBuzz</h1>
+                <p>Welcome to TechGeekBuzz.</p>
+                
+                </body>
+
+
+
+

HTML Formatting

+
+

+ In HTML, we have many special elements that can provide special meaning to text content. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + HTML Elements + + + Description +
+ <b> + + Bold the text +
+ <strong> + + An alternative for <b>, which tell that this text is essential. +
+ <i> + + Italic the text +
+ <em> + + Similar to italic but used when we want to emphasize the text. +
+ <mark> + + It marks the text with a default "yellow" background colour +
+ <small> + + Decrease the text size +
+ <del> + + It prints a cross line over the text. +
+ <ins> + + Represents the inserted text by putting an underline. +
+ <sub> + + This element is used to display the subscript. +
+ <sup> + + It can make a text superscript. +
+
+
+
+ +
+

Reference

+
+
    +
  • + All the documentation in this page is taken from + HTML Tutorial +
  • +
+
+
+
+ +