diff --git "a/Training_and_Testing.ipynb" "b/Training_and_Testing.ipynb" new file mode 100644--- /dev/null +++ "b/Training_and_Testing.ipynb" @@ -0,0 +1,8593 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "HC0hbhrfzbHr" + }, + "source": [ + "# **General cells no matter which model or dataset**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "RmaalBOkM2xS" + }, + "outputs": [], + "source": [ + "import tensorflow as tf\n", + "from tensorflow.keras.layers import TimeDistributed, LSTM, Dense, Flatten ,Conv3D, MaxPooling3D, Dropout, BatchNormalization\n", + "from tensorflow.keras.applications import ResNet50\n", + "from tensorflow.keras.models import Sequential\n", + "from tensorflow.keras.preprocessing.sequence import pad_sequences\n", + "import numpy as np\n", + "import cv2\n", + "from tensorflow.keras.models import load_model\n", + "from sklearn.model_selection import train_test_split\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "VRgQFMlWhdux", + "outputId": "aa87096f-51cb-4a59-8baa-0e12e06fe378" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Mounted at /content/drive\n" + ] + } + ], + "source": [ + "from google.colab import drive\n", + "drive.mount('/content/drive')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "ptqHwjvLzTRr" + }, + "outputs": [], + "source": [ + "def get_frame_count(video_path):\n", + " # Open the video file\n", + " cap = cv2.VideoCapture(video_path)\n", + "\n", + " # Check if the video opened successfully\n", + " if not cap.isOpened():\n", + " print(f\"Error: Cannot open video {video_path}\")\n", + " return None\n", + "\n", + " # Get the total number of frames\n", + " frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\n", + "\n", + " # Release the video capture object\n", + " cap.release()\n", + "\n", + " return frame_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "7dfa8I8mzT63" + }, + "outputs": [], + "source": [ + "class NormalModel:\n", + " def __init__(self, input_size = (40,224,224,3), num_classes=1):\n", + "\n", + " self.model = Sequential()\n", + "\n", + "\n", + " def preprocess_video(self, video_path, num_frames=40):\n", + " \"\"\"Read the video, sample 50 frames, and resize them to 224x224.\"\"\"\n", + " cap = cv2.VideoCapture(video_path)\n", + " total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\n", + "\n", + " # Calculate frame indices to sample uniformly across the video\n", + " frame_indices = np.linspace(0, total_frames - 1, num=num_frames, dtype=int)\n", + " sampled_frames = []\n", + "\n", + " for idx in frame_indices:\n", + " cap.set(cv2.CAP_PROP_POS_FRAMES, idx) # Set the frame position\n", + " ret, frame = cap.read()\n", + " if not ret:\n", + " print(f\"Warning: Could not read frame {idx} from {video_path}.\")\n", + " # break\n", + " continue\n", + "\n", + " # Resize the frame to 224x224 (to match ResNet50 input size)\n", + " frame = cv2.resize(frame, (224, 224))\n", + " sampled_frames.append(frame)\n", + "\n", + " cap.release()\n", + "\n", + " # If fewer frames were read, pad with zeros\n", + " if len(sampled_frames) < num_frames:\n", + " padding = np.zeros((num_frames - len(sampled_frames), 224, 224, 3))\n", + " sampled_frames = np.concatenate([sampled_frames, padding], axis=0)\n", + "\n", + " return np.array(sampled_frames)\n", + "\n", + "\n", + "\n", + " def train(self, video_paths, labels, batch_size=30):\n", + " \"\"\"Train the model in mini-batches to manage memory.\"\"\"\n", + " for i in range(0, len(video_paths), batch_size):\n", + " batch_videos = video_paths[i:i + batch_size]\n", + " batch_labels = labels[i:i + batch_size]\n", + "\n", + " # Preprocess each video and collect as a batch\n", + " X_batch = np.array([self.preprocess_video(path) for path in batch_videos])\n", + " y_batch = np.array(batch_labels)\n", + "\n", + " # Train the model on the current batch and capture the loss and accuracy\n", + " loss, accuracy = self.model.train_on_batch(X_batch, y_batch)\n", + "\n", + " # Print or log the training progress\n", + " print(f\"Batch {i // batch_size + 1}: Loss = {loss:.4f}, Accuracy = {accuracy:.4f}\")\n", + "\n", + "\n", + " def test(self, video_paths, batch_size=32):\n", + " \"\"\"Test the model on the given videos in batches.\"\"\"\n", + " predictions = []\n", + "\n", + " for i in range(0, len(video_paths), batch_size):\n", + " batch_paths = video_paths[i:i + batch_size]\n", + "\n", + " X_batch = np.array([self.preprocess_video(path) for path in batch_paths])\n", + "\n", + " batch_predictions = self.model.predict(X_batch)\n", + "\n", + " predictions.extend(batch_predictions[:, 0].tolist())\n", + "\n", + " return predictions\n", + "\n", + "\n", + " def load_model(self, filepath):\n", + " \"\"\"Load the entire model from the specified file path.\"\"\"\n", + " self.model = load_model(filepath)\n", + " print(f\"Model loaded from {filepath}.\")\n", + "\n", + " def save_model(self, filepath):\n", + " \"\"\"Save the entire model to the specified file path.\"\"\"\n", + " self.model.save(filepath)\n", + " print(f\"Model saved to {filepath}.\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "qmYZtcR-zWjL" + }, + "outputs": [], + "source": [ + "\n", + "def calculate_accuracy(predictions, labels, threshold=0.5):\n", + " \"\"\"\n", + " Calculate the accuracy of predictions given true labels.\n", + "\n", + " Args:\n", + " predictions (np.array): The predicted probabilities (output from the model).\n", + " labels (np.array): The true labels for the data.\n", + " threshold (float): The threshold to determine class predictions.\n", + "\n", + " Returns:\n", + " float: The accuracy as a percentage.\n", + " \"\"\"\n", + "\n", + " predictions = np.array(predictions)\n", + " labels = np.array(labels)\n", + "\n", + " predicted_classes = (predictions >= threshold).astype(int)\n", + "\n", + " accuracy = np.mean(predicted_classes == labels) * 100\n", + " return accuracy" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "D5-dr_CQiwuF", + "outputId": "f5d9f388-b29b-44f0-b104-f2d2f0227793" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Archive: /content/drive/MyDrive/Models/new_model.zip\n", + " extracting: /content/model.h5 \n" + ] + } + ], + "source": [ + "!unzip /content/drive/MyDrive/Models/new_model.zip -d /content/ # for single LSTM + CNN model\n", + "\n", + "!mv /content/model.h5 /content/A_model.h5 # rename it, model Nourhan and this model have the same name" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "9SZJrchwz8Y2", + "outputId": "9f136e0c-bbb7-4e8f-b07d-2452896a9d1e" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Archive: /content/drive/MyDrive/Models/Nourhan_model.zip\n", + " extracting: /content/model.h5 \n" + ] + } + ], + "source": [ + "!unzip /content/drive/MyDrive/Models/Nourhan_model.zip -d /content/ # for Bi LSTM + CNN model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "glIU7Ega0ILm", + "outputId": "e9b225d3-fede-457d-f4b2-0140500058bf" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Archive: /content/drive/MyDrive/Models/3D_CNN_model.zip\n", + " extracting: /content/3D_CNN_model.h5 \n" + ] + } + ], + "source": [ + "!unzip /content/drive/MyDrive/Models/3D_CNN_model.zip -d /content/ # for 3D CNN architecture model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "8fMNZJf2hxd_", + "outputId": "378c6f99-0d5a-4275-bfc1-add00026a5b5" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Archive: /content/drive/MyDrive/Models/pre_3D_model.zip\n", + " extracting: /content/pre_3D_model.h5 \n" + ] + } + ], + "source": [ + "!unzip /content/drive/MyDrive/Models/pre_3D_model.zip -d /content/ # for pretrained 3D model" + ] + }, + { + "cell_type": "code", + "source": [ + "!unzip /content/drive/MyDrive/Models/pre_3D_model_v2.zip -d /content/ # for pretrained 3D model" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "nU-VptNMc_63", + "outputId": "b1158f7c-db91-438a-aeb1-64269bd5c66f" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Archive: /content/drive/MyDrive/Models/pre_3D_model_v2.zip\n", + " extracting: /content/content/pre_3D_model_v2.h5 \n" + ] + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "jGA1gzIl0YIg" + }, + "source": [ + "# **For Hockey fights Dataset**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "jWhaQAEwFL0m", + "outputId": "ee3a2da2-100c-4744-8e6f-d69fb33e6e35" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset URL: https://www.kaggle.com/datasets/yassershrief/hockey-fight-vidoes\n", + "License(s): unknown\n", + "Downloading hockey-fight-vidoes.zip to /content/hockey_fight\n", + " 92% 150M/164M [00:01<00:00, 74.1MB/s]\n", + "100% 164M/164M [00:01<00:00, 92.9MB/s]\n", + "/content/hockey_fight : 0 files\n", + "/content/hockey_fight/data : 1000 files\n" + ] + } + ], + "source": [ + "!kaggle datasets download -d yassershrief/hockey-fight-vidoes --unzip -p /content/hockey_fight\n", + "\n", + "import os\n", + "\n", + "base_dir = '/content/hockey_fight'\n", + "for root, dirs, files in os.walk(base_dir):\n", + " print(root, \":\", len(files), \"files\")\n", + "BASE_DIR = '/content/hockey_fight/data'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "jzu-ShGmvmbo" + }, + "outputs": [], + "source": [ + "def prepare_data(base_path):\n", + " categories = {\n", + " \"Violence\": 0, # Class 0\n", + " \"NonViolence\": 1 # Class 1\n", + " }\n", + "\n", + " file_paths = []\n", + " labels = []\n", + "\n", + " # Iterate through all video files in the base directory\n", + " for file_name in os.listdir(base_path):\n", + "\n", + " if file_name.lower().startswith('f'):\n", + " label = categories[\"Violence\"]\n", + " else:\n", + " label = categories[\"NonViolence\"]\n", + "\n", + " file_paths.append(os.path.join(base_path, file_name))\n", + " labels.append(label)\n", + "\n", + " # Convert lists to numpy arrays\n", + " file_paths = np.array(file_paths)\n", + " labels = np.array(labels)\n", + "\n", + " # Shuffle data while keeping labels in sync\n", + " indices = np.arange(len(file_paths)) # Create an array of indices\n", + " np.random.shuffle(indices) # Shuffle the indices\n", + "\n", + " # Use the shuffled indices to rearrange file_paths and labels\n", + " shuffled_file_paths = file_paths[indices]\n", + " shuffled_labels = labels[indices]\n", + "\n", + " return shuffled_file_paths, shuffled_labels\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "weyM6Gk1tMxK", + "outputId": "80d36ea4-158f-4907-d0a2-c038dd1ecefd" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 42\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 40\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 42\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 49\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 49\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 42\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 49\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 42\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 49\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 49\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 40\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 49\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 40\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 40\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 49\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n", + "Total number of frames: 41\n" + ] + } + ], + "source": [ + "\n", + "file_paths_1 , labels_1 = prepare_data(BASE_DIR)\n", + "\n", + "for path in file_paths_1:\n", + " frame_count = get_frame_count(path)\n", + " print(f\"Total number of frames: {frame_count}\")\n", + "\n", + "# /content/real_life_violence/Real Life Violence Dataset/" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "1lHcDvJxwVoX" + }, + "outputs": [], + "source": [ + "X_train, X_test, y_train, y_test = train_test_split(file_paths_1 , labels_1 , test_size=0.15 , stratify=labels_1)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "lNmueWp0vSc5" + }, + "source": [ + "# **For Real-life Violence Dataset**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "9JTjBEx9vaB_", + "outputId": "a7bbff81-4f2a-42b1-cb06-b87a5a3d7af9" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset URL: https://www.kaggle.com/datasets/mohamedmustafa/real-life-violence-situations-dataset\n", + "License(s): copyright-authors\n", + "Downloading real-life-violence-situations-dataset.zip to /content/real_life_violence\n", + "100% 3.58G/3.58G [01:24<00:00, 25.4MB/s]\n", + "100% 3.58G/3.58G [01:24<00:00, 45.4MB/s]\n", + "/content/real_life_violence : 0 files\n", + "/content/real_life_violence/real life violence situations : 0 files\n", + "/content/real_life_violence/real life violence situations/Real Life Violence Dataset : 0 files\n", + "/content/real_life_violence/real life violence situations/Real Life Violence Dataset/Violence : 1000 files\n", + "/content/real_life_violence/real life violence situations/Real Life Violence Dataset/NonViolence : 1000 files\n", + "/content/real_life_violence/Real Life Violence Dataset : 0 files\n", + "/content/real_life_violence/Real Life Violence Dataset/Violence : 1000 files\n", + "/content/real_life_violence/Real Life Violence Dataset/NonViolence : 1000 files\n" + ] + } + ], + "source": [ + "!kaggle datasets download -d mohamedmustafa/real-life-violence-situations-dataset --unzip -p /content/real_life_violence\n", + "\n", + "import os\n", + "\n", + "base_dir = '/content/real_life_violence'\n", + "for root, dirs, files in os.walk(base_dir):\n", + " print(root, \":\", len(files), \"files\")\n", + "BASE_DIR = '/content/real_life_violence/Real Life Violence Dataset'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "LyMfHmv-wUuH" + }, + "outputs": [], + "source": [ + "def prepare_data(base_path):\n", + " label_map = {\n", + " \"Violence\": 0, # Class 0\n", + " \"NonViolence\": 1 # Class 1\n", + " }\n", + "\n", + " file_paths = []\n", + " labels = []\n", + "\n", + " # Loop through each class folder (Normal, Violence, Weaponized)\n", + " for class_name, label in label_map.items():\n", + " class_path = os.path.join(base_path, class_name)\n", + "\n", + " # Collect all video file paths in the current class folder\n", + " for file_name in os.listdir(class_path):\n", + " if file_name.endswith(('.mp4', '.avi', '.mov')): # Adjust for valid video formats\n", + " file_paths.append(os.path.join(class_path, file_name))\n", + " labels.append(label)\n", + "\n", + "\n", + " file_paths = np.array(file_paths)\n", + "\n", + " labels = np.array(labels)\n", + "\n", + " # Shuffle data while keeping labels in sync\n", + " indices = np.arange(len(file_paths)) # Create an array of indices\n", + " np.random.shuffle(indices) # Shuffle the indices\n", + "\n", + " # Use the shuffled indices to rearrange file_paths and labels\n", + " shuffled_file_paths = file_paths[indices]\n", + " shuffled_labels = labels[indices]\n", + " # Convert lists to numpy arrays for easier handling\n", + " return shuffled_file_paths, shuffled_labels" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "e1yXy6bHwwqa", + "outputId": "b366a94f-e06a-4b09-9682-0d963696cf86" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Total number of frames: 120\n", + "Total number of frames: 113\n", + "Total number of frames: 150\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 112\n", + "Total number of frames: 146\n", + "Total number of frames: 129\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 177\n", + "Total number of frames: 115\n", + "Total number of frames: 95\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 147\n", + "Total number of frames: 141\n", + "Total number of frames: 123\n", + "Total number of frames: 132\n", + "Total number of frames: 108\n", + "Total number of frames: 143\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 135\n", + "Total number of frames: 102\n", + "Total number of frames: 153\n", + "Total number of frames: 133\n", + "Total number of frames: 135\n", + "Total number of frames: 55\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 118\n", + "Total number of frames: 55\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 168\n", + "Total number of frames: 145\n", + "Total number of frames: 133\n", + "Total number of frames: 147\n", + "Total number of frames: 117\n", + "Total number of frames: 115\n", + "Total number of frames: 124\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 55\n", + "Total number of frames: 171\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 111\n", + "Total number of frames: 55\n", + "Total number of frames: 148\n", + "Total number of frames: 138\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 162\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 153\n", + "Total number of frames: 92\n", + "Total number of frames: 171\n", + "Total number of frames: 138\n", + "Total number of frames: 117\n", + "Total number of frames: 129\n", + "Total number of frames: 108\n", + "Total number of frames: 114\n", + "Total number of frames: 125\n", + "Total number of frames: 168\n", + "Total number of frames: 125\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 108\n", + "Total number of frames: 141\n", + "Total number of frames: 185\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 55\n", + "Total number of frames: 120\n", + "Total number of frames: 129\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 128\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 29\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 132\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 88\n", + "Total number of frames: 123\n", + "Total number of frames: 70\n", + "Total number of frames: 118\n", + "Total number of frames: 114\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 105\n", + "Total number of frames: 171\n", + "Total number of frames: 144\n", + "Total number of frames: 185\n", + "Total number of frames: 158\n", + "Total number of frames: 141\n", + "Total number of frames: 150\n", + "Total number of frames: 137\n", + "Total number of frames: 150\n", + "Total number of frames: 105\n", + "Total number of frames: 156\n", + "Total number of frames: 87\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 135\n", + "Total number of frames: 135\n", + "Total number of frames: 159\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 141\n", + "Total number of frames: 156\n", + "Total number of frames: 117\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 120\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 132\n", + "Total number of frames: 145\n", + "Total number of frames: 147\n", + "Total number of frames: 125\n", + "Total number of frames: 162\n", + "Total number of frames: 128\n", + "Total number of frames: 186\n", + "Total number of frames: 93\n", + "Total number of frames: 114\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 103\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 138\n", + "Total number of frames: 117\n", + "Total number of frames: 138\n", + "Total number of frames: 161\n", + "Total number of frames: 145\n", + "Total number of frames: 122\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 168\n", + "Total number of frames: 114\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 110\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 183\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 126\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 124\n", + "Total number of frames: 133\n", + "Total number of frames: 108\n", + "Total number of frames: 55\n", + "Total number of frames: 185\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 120\n", + "Total number of frames: 138\n", + "Total number of frames: 115\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 144\n", + "Total number of frames: 177\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 145\n", + "Total number of frames: 132\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 159\n", + "Total number of frames: 125\n", + "Total number of frames: 177\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 115\n", + "Total number of frames: 110\n", + "Total number of frames: 177\n", + "Total number of frames: 145\n", + "Total number of frames: 147\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 165\n", + "Total number of frames: 135\n", + "Total number of frames: 141\n", + "Total number of frames: 138\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 177\n", + "Total number of frames: 153\n", + "Total number of frames: 145\n", + "Total number of frames: 130\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 120\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 132\n", + "Total number of frames: 74\n", + "Total number of frames: 150\n", + "Total number of frames: 98\n", + "Total number of frames: 135\n", + "Total number of frames: 120\n", + "Total number of frames: 150\n", + "Total number of frames: 55\n", + "Total number of frames: 161\n", + "Total number of frames: 141\n", + "Total number of frames: 85\n", + "Total number of frames: 135\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 120\n", + "Total number of frames: 145\n", + "Total number of frames: 110\n", + "Total number of frames: 122\n", + "Total number of frames: 177\n", + "Total number of frames: 144\n", + "Total number of frames: 168\n", + "Total number of frames: 150\n", + "Total number of frames: 117\n", + "Total number of frames: 125\n", + "Total number of frames: 180\n", + "Total number of frames: 126\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 103\n", + "Total number of frames: 133\n", + "Total number of frames: 156\n", + "Total number of frames: 156\n", + "Total number of frames: 147\n", + "Total number of frames: 162\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 96\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 156\n", + "Total number of frames: 143\n", + "Total number of frames: 113\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 126\n", + "Total number of frames: 125\n", + "Total number of frames: 108\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 144\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 185\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 153\n", + "Total number of frames: 120\n", + "Total number of frames: 117\n", + "Total number of frames: 125\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 154\n", + "Total number of frames: 141\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 162\n", + "Total number of frames: 132\n", + "Total number of frames: 120\n", + "Total number of frames: 162\n", + "Total number of frames: 156\n", + "Total number of frames: 120\n", + "Total number of frames: 153\n", + "Total number of frames: 145\n", + "Total number of frames: 165\n", + "Total number of frames: 120\n", + "Total number of frames: 171\n", + "Total number of frames: 125\n", + "Total number of frames: 96\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 107\n", + "Total number of frames: 135\n", + "Total number of frames: 115\n", + "Total number of frames: 161\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 147\n", + "Total number of frames: 125\n", + "Total number of frames: 156\n", + "Total number of frames: 177\n", + "Total number of frames: 153\n", + "Total number of frames: 126\n", + "Total number of frames: 177\n", + "Total number of frames: 99\n", + "Total number of frames: 55\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 120\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 186\n", + "Total number of frames: 150\n", + "Total number of frames: 105\n", + "Total number of frames: 150\n", + "Total number of frames: 162\n", + "Total number of frames: 111\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 11272\n", + "Total number of frames: 162\n", + "Total number of frames: 120\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 108\n", + "Total number of frames: 123\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 120\n", + "Total number of frames: 177\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 201\n", + "Total number of frames: 144\n", + "Total number of frames: 55\n", + "Total number of frames: 55\n", + "Total number of frames: 77\n", + "Total number of frames: 120\n", + "Total number of frames: 137\n", + "Total number of frames: 125\n", + "Total number of frames: 189\n", + "Total number of frames: 147\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 106\n", + "Total number of frames: 162\n", + "Total number of frames: 156\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 88\n", + "Total number of frames: 143\n", + "Total number of frames: 210\n", + "Total number of frames: 185\n", + "Total number of frames: 114\n", + "Total number of frames: 141\n", + "Total number of frames: 105\n", + "Total number of frames: 112\n", + "Total number of frames: 145\n", + "Total number of frames: 156\n", + "Total number of frames: 145\n", + "Total number of frames: 114\n", + "Total number of frames: 150\n", + "Total number of frames: 137\n", + "Total number of frames: 159\n", + "Total number of frames: 168\n", + "Total number of frames: 133\n", + "Total number of frames: 185\n", + "Total number of frames: 138\n", + "Total number of frames: 150\n", + "Total number of frames: 144\n", + "Total number of frames: 55\n", + "Total number of frames: 185\n", + "Total number of frames: 168\n", + "Total number of frames: 129\n", + "Total number of frames: 180\n", + "Total number of frames: 115\n", + "Total number of frames: 210\n", + "Total number of frames: 125\n", + "Total number of frames: 159\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 159\n", + "Total number of frames: 120\n", + "Total number of frames: 111\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 130\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 177\n", + "Total number of frames: 153\n", + "Total number of frames: 128\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 138\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 133\n", + "Total number of frames: 159\n", + "Total number of frames: 154\n", + "Total number of frames: 113\n", + "Total number of frames: 125\n", + "Total number of frames: 141\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 135\n", + "Total number of frames: 171\n", + "Total number of frames: 145\n", + "Total number of frames: 153\n", + "Total number of frames: 185\n", + "Total number of frames: 171\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 204\n", + "Total number of frames: 125\n", + "Total number of frames: 95\n", + "Total number of frames: 147\n", + "Total number of frames: 139\n", + "Total number of frames: 108\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 111\n", + "Total number of frames: 145\n", + "Total number of frames: 141\n", + "Total number of frames: 55\n", + "Total number of frames: 141\n", + "Total number of frames: 153\n", + "Total number of frames: 147\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 168\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 138\n", + "Total number of frames: 150\n", + "Total number of frames: 108\n", + "Total number of frames: 143\n", + "Total number of frames: 90\n", + "Total number of frames: 36\n", + "Total number of frames: 125\n", + "Total number of frames: 102\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 135\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 122\n", + "Total number of frames: 125\n", + "Total number of frames: 90\n", + "Total number of frames: 113\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 153\n", + "Total number of frames: 129\n", + "Total number of frames: 112\n", + "Total number of frames: 108\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 115\n", + "Total number of frames: 108\n", + "Total number of frames: 125\n", + "Total number of frames: 183\n", + "Total number of frames: 125\n", + "Total number of frames: 128\n", + "Total number of frames: 94\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 126\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 108\n", + "Total number of frames: 115\n", + "Total number of frames: 117\n", + "Total number of frames: 150\n", + "Total number of frames: 165\n", + "Total number of frames: 185\n", + "Total number of frames: 185\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 135\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 168\n", + "Total number of frames: 120\n", + "Total number of frames: 147\n", + "Total number of frames: 120\n", + "Total number of frames: 105\n", + "Total number of frames: 168\n", + "Total number of frames: 144\n", + "Total number of frames: 150\n", + "Total number of frames: 107\n", + "Total number of frames: 151\n", + "Total number of frames: 126\n", + "Total number of frames: 115\n", + "Total number of frames: 120\n", + "Total number of frames: 115\n", + "Total number of frames: 141\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 95\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 147\n", + "Total number of frames: 110\n", + "Total number of frames: 141\n", + "Total number of frames: 150\n", + "Total number of frames: 136\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 141\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 62\n", + "Total number of frames: 138\n", + "Total number of frames: 165\n", + "Total number of frames: 132\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 177\n", + "Total number of frames: 150\n", + "Total number of frames: 102\n", + "Total number of frames: 125\n", + "Total number of frames: 111\n", + "Total number of frames: 145\n", + "Total number of frames: 129\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 128\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 135\n", + "Total number of frames: 150\n", + "Total number of frames: 141\n", + "Total number of frames: 185\n", + "Total number of frames: 180\n", + "Total number of frames: 115\n", + "Total number of frames: 98\n", + "Total number of frames: 120\n", + "Total number of frames: 126\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 174\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 110\n", + "Total number of frames: 185\n", + "Total number of frames: 76\n", + "Total number of frames: 125\n", + "Total number of frames: 156\n", + "Total number of frames: 185\n", + "Total number of frames: 123\n", + "Total number of frames: 113\n", + "Total number of frames: 140\n", + "Total number of frames: 185\n", + "Total number of frames: 147\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 129\n", + "Total number of frames: 115\n", + "Total number of frames: 107\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 180\n", + "Total number of frames: 144\n", + "Total number of frames: 55\n", + "Total number of frames: 174\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 124\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 141\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 5397\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 124\n", + "Total number of frames: 162\n", + "Total number of frames: 145\n", + "Total number of frames: 153\n", + "Total number of frames: 168\n", + "Total number of frames: 137\n", + "Total number of frames: 153\n", + "Total number of frames: 138\n", + "Total number of frames: 177\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 168\n", + "Total number of frames: 145\n", + "Total number of frames: 132\n", + "Total number of frames: 141\n", + "Total number of frames: 153\n", + "Total number of frames: 141\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 111\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 117\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 186\n", + "Total number of frames: 108\n", + "Total number of frames: 108\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 177\n", + "Total number of frames: 105\n", + "Total number of frames: 123\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 177\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 138\n", + "Total number of frames: 55\n", + "Total number of frames: 150\n", + "Total number of frames: 120\n", + "Total number of frames: 145\n", + "Total number of frames: 120\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 93\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 144\n", + "Total number of frames: 55\n", + "Total number of frames: 153\n", + "Total number of frames: 144\n", + "Total number of frames: 126\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 55\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 126\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 78\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 147\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 154\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 114\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 165\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 156\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 162\n", + "Total number of frames: 115\n", + "Total number of frames: 117\n", + "Total number of frames: 145\n", + "Total number of frames: 110\n", + "Total number of frames: 117\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 123\n", + "Total number of frames: 108\n", + "Total number of frames: 177\n", + "Total number of frames: 118\n", + "Total number of frames: 114\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 177\n", + "Total number of frames: 125\n", + "Total number of frames: 123\n", + "Total number of frames: 55\n", + "Total number of frames: 185\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 140\n", + "Total number of frames: 95\n", + "Total number of frames: 105\n", + "Total number of frames: 95\n", + "Total number of frames: 114\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 174\n", + "Total number of frames: 125\n", + "Total number of frames: 180\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 85\n", + "Total number of frames: 145\n", + "Total number of frames: 153\n", + "Total number of frames: 100\n", + "Total number of frames: 129\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 126\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 162\n", + "Total number of frames: 103\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 114\n", + "Total number of frames: 150\n", + "Total number of frames: 165\n", + "Total number of frames: 114\n", + "Total number of frames: 156\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 177\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 159\n", + "Total number of frames: 186\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 135\n", + "Total number of frames: 120\n", + "Total number of frames: 156\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 120\n", + "Total number of frames: 125\n", + "Total number of frames: 104\n", + "Total number of frames: 177\n", + "Total number of frames: 185\n", + "Total number of frames: 144\n", + "Total number of frames: 55\n", + "Total number of frames: 120\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 113\n", + "Total number of frames: 189\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 170\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 185\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 123\n", + "Total number of frames: 159\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 159\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 150\n", + "Total number of frames: 123\n", + "Total number of frames: 180\n", + "Total number of frames: 123\n", + "Total number of frames: 177\n", + "Total number of frames: 105\n", + "Total number of frames: 185\n", + "Total number of frames: 111\n", + "Total number of frames: 185\n", + "Total number of frames: 156\n", + "Total number of frames: 159\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 177\n", + "Total number of frames: 115\n", + "Total number of frames: 138\n", + "Total number of frames: 185\n", + "Total number of frames: 156\n", + "Total number of frames: 171\n", + "Total number of frames: 125\n", + "Total number of frames: 165\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 180\n", + "Total number of frames: 113\n", + "Total number of frames: 125\n", + "Total number of frames: 95\n", + "Total number of frames: 55\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 117\n", + "Total number of frames: 55\n", + "Total number of frames: 132\n", + "Total number of frames: 108\n", + "Total number of frames: 145\n", + "Total number of frames: 114\n", + "Total number of frames: 138\n", + "Total number of frames: 141\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 156\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 105\n", + "Total number of frames: 108\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 156\n", + "Total number of frames: 153\n", + "Total number of frames: 104\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 4109\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 140\n", + "Total number of frames: 145\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 139\n", + "Total number of frames: 135\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 120\n", + "Total number of frames: 145\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 108\n", + "Total number of frames: 162\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 106\n", + "Total number of frames: 115\n", + "Total number of frames: 153\n", + "Total number of frames: 93\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 120\n", + "Total number of frames: 138\n", + "Total number of frames: 55\n", + "Total number of frames: 55\n", + "Total number of frames: 185\n", + "Total number of frames: 156\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 222\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 117\n", + "Total number of frames: 105\n", + "Total number of frames: 168\n", + "Total number of frames: 126\n", + "Total number of frames: 100\n", + "Total number of frames: 95\n", + "Total number of frames: 115\n", + "Total number of frames: 165\n", + "Total number of frames: 123\n", + "Total number of frames: 115\n", + "Total number of frames: 131\n", + "Total number of frames: 115\n", + "Total number of frames: 105\n", + "Total number of frames: 117\n", + "Total number of frames: 115\n", + "Total number of frames: 114\n", + "Total number of frames: 132\n", + "Total number of frames: 129\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 143\n", + "Total number of frames: 150\n", + "Total number of frames: 137\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 123\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 113\n", + "Total number of frames: 107\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 138\n", + "Total number of frames: 156\n", + "Total number of frames: 145\n", + "Total number of frames: 144\n", + "Total number of frames: 126\n", + "Total number of frames: 143\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 86\n", + "Total number of frames: 138\n", + "Total number of frames: 129\n", + "Total number of frames: 141\n", + "Total number of frames: 145\n", + "Total number of frames: 105\n", + "Total number of frames: 133\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 126\n", + "Total number of frames: 132\n", + "Total number of frames: 123\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 283\n", + "Total number of frames: 135\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 185\n", + "Total number of frames: 111\n", + "Total number of frames: 144\n", + "Total number of frames: 87\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 133\n", + "Total number of frames: 150\n", + "Total number of frames: 144\n", + "Total number of frames: 147\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 114\n", + "Total number of frames: 108\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 133\n", + "Total number of frames: 78\n", + "Total number of frames: 135\n", + "Total number of frames: 159\n", + "Total number of frames: 162\n", + "Total number of frames: 123\n", + "Total number of frames: 135\n", + "Total number of frames: 145\n", + "Total number of frames: 108\n", + "Total number of frames: 135\n", + "Total number of frames: 63\n", + "Total number of frames: 126\n", + "Total number of frames: 180\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 120\n", + "Total number of frames: 114\n", + "Total number of frames: 50\n", + "Total number of frames: 168\n", + "Total number of frames: 152\n", + "Total number of frames: 114\n", + "Total number of frames: 177\n", + "Total number of frames: 129\n", + "Total number of frames: 145\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 198\n", + "Total number of frames: 105\n", + "Total number of frames: 70\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 138\n", + "Total number of frames: 147\n", + "Total number of frames: 55\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 162\n", + "Total number of frames: 150\n", + "Total number of frames: 141\n", + "Total number of frames: 177\n", + "Total number of frames: 162\n", + "Total number of frames: 171\n", + "Total number of frames: 125\n", + "Total number of frames: 147\n", + "Total number of frames: 150\n", + "Total number of frames: 142\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 100\n", + "Total number of frames: 156\n", + "Total number of frames: 150\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 135\n", + "Total number of frames: 159\n", + "Total number of frames: 110\n", + "Total number of frames: 150\n", + "Total number of frames: 129\n", + "Total number of frames: 138\n", + "Total number of frames: 144\n", + "Total number of frames: 162\n", + "Total number of frames: 186\n", + "Total number of frames: 150\n", + "Total number of frames: 132\n", + "Total number of frames: 164\n", + "Total number of frames: 126\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 162\n", + "Total number of frames: 145\n", + "Total number of frames: 108\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 126\n", + "Total number of frames: 55\n", + "Total number of frames: 129\n", + "Total number of frames: 129\n", + "Total number of frames: 55\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 153\n", + "Total number of frames: 150\n", + "Total number of frames: 177\n", + "Total number of frames: 120\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 135\n", + "Total number of frames: 125\n", + "Total number of frames: 162\n", + "Total number of frames: 155\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 177\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 117\n", + "Total number of frames: 121\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 165\n", + "Total number of frames: 144\n", + "Total number of frames: 120\n", + "Total number of frames: 125\n", + "Total number of frames: 162\n", + "Total number of frames: 168\n", + "Total number of frames: 153\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 163\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 177\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 135\n", + "Total number of frames: 112\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 174\n", + "Total number of frames: 168\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 123\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 120\n", + "Total number of frames: 145\n", + "Total number of frames: 109\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 129\n", + "Total number of frames: 177\n", + "Total number of frames: 174\n", + "Total number of frames: 55\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 108\n", + "Total number of frames: 150\n", + "Total number of frames: 195\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 168\n", + "Total number of frames: 141\n", + "Total number of frames: 185\n", + "Total number of frames: 159\n", + "Total number of frames: 105\n", + "Total number of frames: 135\n", + "Total number of frames: 159\n", + "Total number of frames: 171\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 127\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 174\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 120\n", + "Total number of frames: 125\n", + "Total number of frames: 156\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 105\n", + "Total number of frames: 165\n", + "Total number of frames: 105\n", + "Total number of frames: 120\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 102\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 88\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 113\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 105\n", + "Total number of frames: 123\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 141\n", + "Total number of frames: 102\n", + "Total number of frames: 115\n", + "Total number of frames: 168\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 128\n", + "Total number of frames: 153\n", + "Total number of frames: 115\n", + "Total number of frames: 147\n", + "Total number of frames: 150\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 111\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 174\n", + "Total number of frames: 55\n", + "Total number of frames: 108\n", + "Total number of frames: 120\n", + "Total number of frames: 144\n", + "Total number of frames: 185\n", + "Total number of frames: 147\n", + "Total number of frames: 117\n", + "Total number of frames: 125\n", + "Total number of frames: 165\n", + "Total number of frames: 185\n", + "Total number of frames: 124\n", + "Total number of frames: 177\n", + "Total number of frames: 125\n", + "Total number of frames: 84\n", + "Total number of frames: 140\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 141\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 105\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 144\n", + "Total number of frames: 120\n", + "Total number of frames: 145\n", + "Total number of frames: 177\n", + "Total number of frames: 111\n", + "Total number of frames: 135\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 177\n", + "Total number of frames: 150\n", + "Total number of frames: 108\n", + "Total number of frames: 141\n", + "Total number of frames: 177\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 145\n", + "Total number of frames: 141\n", + "Total number of frames: 125\n", + "Total number of frames: 98\n", + "Total number of frames: 129\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 132\n", + "Total number of frames: 138\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 156\n", + "Total number of frames: 55\n", + "Total number of frames: 120\n", + "Total number of frames: 138\n", + "Total number of frames: 120\n", + "Total number of frames: 150\n", + "Total number of frames: 120\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 120\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 162\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 185\n", + "Total number of frames: 55\n", + "Total number of frames: 100\n", + "Total number of frames: 114\n", + "Total number of frames: 162\n", + "Total number of frames: 55\n", + "Total number of frames: 140\n", + "Total number of frames: 105\n", + "Total number of frames: 156\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 123\n", + "Total number of frames: 119\n", + "Total number of frames: 105\n", + "Total number of frames: 185\n", + "Total number of frames: 62\n", + "Total number of frames: 168\n", + "Total number of frames: 138\n", + "Total number of frames: 185\n", + "Total number of frames: 129\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 93\n", + "Total number of frames: 115\n", + "Total number of frames: 135\n", + "Total number of frames: 117\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 126\n", + "Total number of frames: 153\n", + "Total number of frames: 147\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 180\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 138\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 117\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 145\n", + "Total number of frames: 156\n", + "Total number of frames: 150\n", + "Total number of frames: 108\n", + "Total number of frames: 123\n", + "Total number of frames: 162\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 115\n", + "Total number of frames: 156\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 119\n", + "Total number of frames: 168\n", + "Total number of frames: 159\n", + "Total number of frames: 108\n", + "Total number of frames: 92\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 144\n", + "Total number of frames: 145\n", + "Total number of frames: 114\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 145\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 141\n", + "Total number of frames: 145\n", + "Total number of frames: 144\n", + "Total number of frames: 108\n", + "Total number of frames: 120\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 123\n", + "Total number of frames: 185\n", + "Total number of frames: 132\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 129\n", + "Total number of frames: 185\n", + "Total number of frames: 132\n", + "Total number of frames: 138\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 105\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 90\n", + "Total number of frames: 150\n", + "Total number of frames: 137\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 177\n", + "Total number of frames: 122\n", + "Total number of frames: 125\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 105\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 90\n", + "Total number of frames: 120\n", + "Total number of frames: 145\n", + "Total number of frames: 132\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 134\n", + "Total number of frames: 125\n", + "Total number of frames: 114\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 108\n", + "Total number of frames: 66\n", + "Total number of frames: 145\n", + "Total number of frames: 120\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 135\n", + "Total number of frames: 128\n", + "Total number of frames: 153\n", + "Total number of frames: 115\n", + "Total number of frames: 145\n", + "Total number of frames: 126\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 222\n", + "Total number of frames: 125\n", + "Total number of frames: 123\n", + "Total number of frames: 111\n", + "Total number of frames: 125\n", + "Total number of frames: 138\n", + "Total number of frames: 124\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 126\n", + "Total number of frames: 177\n", + "Total number of frames: 156\n", + "Total number of frames: 140\n", + "Total number of frames: 156\n", + "Total number of frames: 147\n", + "Total number of frames: 185\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 156\n", + "Total number of frames: 115\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 143\n", + "Total number of frames: 176\n", + "Total number of frames: 117\n", + "Total number of frames: 141\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 150\n", + "Total number of frames: 185\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 120\n", + "Total number of frames: 92\n", + "Total number of frames: 150\n", + "Total number of frames: 55\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 55\n", + "Total number of frames: 156\n", + "Total number of frames: 115\n", + "Total number of frames: 55\n", + "Total number of frames: 128\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 185\n", + "Total number of frames: 145\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 105\n", + "Total number of frames: 145\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 153\n", + "Total number of frames: 115\n", + "Total number of frames: 171\n", + "Total number of frames: 145\n", + "Total number of frames: 100\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 141\n", + "Total number of frames: 144\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 145\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 105\n", + "Total number of frames: 105\n", + "Total number of frames: 141\n", + "Total number of frames: 132\n", + "Total number of frames: 55\n", + "Total number of frames: 153\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 108\n", + "Total number of frames: 122\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 144\n", + "Total number of frames: 133\n", + "Total number of frames: 123\n", + "Total number of frames: 55\n", + "Total number of frames: 185\n", + "Total number of frames: 124\n", + "Total number of frames: 185\n", + "Total number of frames: 55\n", + "Total number of frames: 129\n", + "Total number of frames: 150\n", + "Total number of frames: 138\n", + "Total number of frames: 150\n", + "Total number of frames: 228\n", + "Total number of frames: 110\n", + "Total number of frames: 136\n", + "Total number of frames: 120\n", + "Total number of frames: 153\n", + "Total number of frames: 156\n", + "Total number of frames: 154\n", + "Total number of frames: 150\n", + "Total number of frames: 126\n", + "Total number of frames: 145\n", + "Total number of frames: 123\n", + "Total number of frames: 55\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 123\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 103\n", + "Total number of frames: 150\n", + "Total number of frames: 183\n", + "Total number of frames: 150\n", + "Total number of frames: 168\n", + "Total number of frames: 144\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 153\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 128\n", + "Total number of frames: 126\n", + "Total number of frames: 145\n", + "Total number of frames: 162\n", + "Total number of frames: 185\n", + "Total number of frames: 162\n", + "Total number of frames: 113\n", + "Total number of frames: 141\n", + "Total number of frames: 55\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 168\n", + "Total number of frames: 125\n", + "Total number of frames: 135\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 156\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 144\n", + "Total number of frames: 120\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 141\n", + "Total number of frames: 115\n", + "Total number of frames: 122\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 141\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 123\n", + "Total number of frames: 153\n", + "Total number of frames: 150\n", + "Total number of frames: 153\n", + "Total number of frames: 107\n", + "Total number of frames: 145\n", + "Total number of frames: 147\n", + "Total number of frames: 156\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 132\n", + "Total number of frames: 130\n", + "Total number of frames: 177\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 156\n", + "Total number of frames: 55\n", + "Total number of frames: 153\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 123\n", + "Total number of frames: 162\n", + "Total number of frames: 150\n", + "Total number of frames: 120\n", + "Total number of frames: 55\n", + "Total number of frames: 150\n", + "Total number of frames: 150\n", + "Total number of frames: 140\n", + "Total number of frames: 140\n", + "Total number of frames: 213\n", + "Total number of frames: 150\n", + "Total number of frames: 129\n", + "Total number of frames: 150\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 128\n", + "Total number of frames: 134\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 153\n", + "Total number of frames: 108\n", + "Total number of frames: 159\n", + "Total number of frames: 105\n", + "Total number of frames: 132\n", + "Total number of frames: 126\n", + "Total number of frames: 55\n", + "Total number of frames: 108\n", + "Total number of frames: 150\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 141\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 125\n", + "Total number of frames: 126\n", + "Total number of frames: 145\n", + "Total number of frames: 123\n", + "Total number of frames: 150\n", + "Total number of frames: 55\n", + "Total number of frames: 125\n", + "Total number of frames: 162\n", + "Total number of frames: 192\n", + "Total number of frames: 150\n", + "Total number of frames: 201\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 129\n", + "Total number of frames: 145\n", + "Total number of frames: 110\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 113\n", + "Total number of frames: 111\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 177\n", + "Total number of frames: 150\n", + "Total number of frames: 119\n", + "Total number of frames: 150\n", + "Total number of frames: 145\n", + "Total number of frames: 153\n", + "Total number of frames: 125\n", + "Total number of frames: 150\n", + "Total number of frames: 129\n", + "Total number of frames: 156\n", + "Total number of frames: 171\n", + "Total number of frames: 120\n", + "Total number of frames: 115\n", + "Total number of frames: 150\n", + "Total number of frames: 168\n", + "Total number of frames: 115\n", + "Total number of frames: 115\n", + "Total number of frames: 135\n", + "Total number of frames: 134\n", + "Total number of frames: 145\n", + "Total number of frames: 125\n", + "Total number of frames: 133\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 115\n", + "Total number of frames: 156\n", + "Total number of frames: 144\n", + "Total number of frames: 141\n", + "Total number of frames: 185\n", + "Total number of frames: 156\n", + "Total number of frames: 105\n", + "Total number of frames: 147\n", + "Total number of frames: 125\n", + "Total number of frames: 145\n", + "Total number of frames: 150\n", + "Total number of frames: 125\n", + "Total number of frames: 140\n", + "Total number of frames: 185\n", + "Total number of frames: 150\n", + "Total number of frames: 103\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 115\n", + "Total number of frames: 100\n", + "Total number of frames: 185\n", + "Total number of frames: 153\n", + "Total number of frames: 138\n", + "Total number of frames: 129\n", + "Total number of frames: 105\n", + "Total number of frames: 125\n", + "Total number of frames: 96\n", + "Total number of frames: 117\n", + "Total number of frames: 125\n", + "Total number of frames: 132\n", + "Total number of frames: 125\n", + "Total number of frames: 125\n", + "Total number of frames: 185\n", + "Total number of frames: 189\n", + "Total number of frames: 150\n", + "Total number of frames: 87\n", + "Total number of frames: 125\n", + "Total number of frames: 73\n", + "Total number of frames: 156\n", + "Total number of frames: 150\n", + "Total number of frames: 139\n", + "Total number of frames: 125\n", + "Total number of frames: 95\n", + "Total number of frames: 138\n", + "Total number of frames: 135\n", + "Total number of frames: 125\n", + "Total number of frames: 120\n", + "Total number of frames: 115\n", + "Total number of frames: 129\n", + "Total number of frames: 55\n", + "Total number of frames: 98\n", + "Total number of frames: 180\n" + ] + } + ], + "source": [ + "\n", + "file_paths_2 , labels_2 = prepare_data(BASE_DIR)\n", + "\n", + "for path in file_paths_2:\n", + " frame_count = get_frame_count(path)\n", + " print(f\"Total number of frames: {frame_count}\")\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "Z5-4zrB3xhnn" + }, + "outputs": [], + "source": [ + "X_train, X_test, y_train, y_test = train_test_split(file_paths_2 , labels_2 , test_size=0.20 , stratify=labels_2)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "q_eo_fXzsge-" + }, + "source": [ + "# **For SVCD Dataset**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "0NRoS4u9skwm", + "outputId": "c9be7426-9200-4575-fe9d-44268e93172c" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset URL: https://www.kaggle.com/datasets/toluwaniaremu/smartcity-cctv-violence-detection-dataset-scvd\n", + "License(s): CC-BY-NC-SA-4.0\n", + "Downloading smartcity-cctv-violence-detection-dataset-scvd.zip to /content/svcd\n", + " 98% 1.00G/1.03G [00:06<00:00, 204MB/s]\n", + "100% 1.03G/1.03G [00:06<00:00, 161MB/s]\n", + "/content/svcd : 0 files\n", + "/content/svcd/SCVD : 0 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split : 0 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Test : 0 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Test/Weaponized : 190 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Test/Normal : 169 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Test/Violence : 118 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Train : 0 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Train/Weaponized : 832 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Train/Normal : 872 files\n", + "/content/svcd/SCVD/SCVD_converted_sec_split/Train/Violence : 970 files\n", + "/content/svcd/SCVD/SCVD_converted : 0 files\n", + "/content/svcd/SCVD/SCVD_converted/Test : 0 files\n", + "/content/svcd/SCVD/SCVD_converted/Test/Weaponized : 24 files\n", + "/content/svcd/SCVD/SCVD_converted/Test/Normal : 46 files\n", + "/content/svcd/SCVD/SCVD_converted/Test/Violence : 12 files\n", + "/content/svcd/SCVD/SCVD_converted/Train : 0 files\n", + "/content/svcd/SCVD/SCVD_converted/Train/Weaponized : 100 files\n", + "/content/svcd/SCVD/SCVD_converted/Train/Normal : 200 files\n", + "/content/svcd/SCVD/SCVD_converted/Train/Violence : 99 files\n" + ] + } + ], + "source": [ + "!kaggle datasets download -d toluwaniaremu/smartcity-cctv-violence-detection-dataset-scvd --unzip -p /content/svcd\n", + "\n", + "import os\n", + "\n", + "base_dir = '/content/svcd'\n", + "for root, dirs, files in os.walk(base_dir):\n", + " print(root, \":\", len(files), \"files\")\n", + "BASE_DIR_train = '/content/svcd/SCVD/SCVD_converted_sec_split/Train' # '/content/svcd/SCVD/SCVD_converted/Train' # for the smaller dataset\n", + "BASE_DIR_test = '/content/svcd/SCVD/SCVD_converted_sec_split/Test' # '/content/svcd/SCVD/SCVD_converted/Test' # for the smaller dataset" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "D_HKmia7ty1-" + }, + "outputs": [], + "source": [ + "def prepare_data(base_path):\n", + " label_map = {\n", + " \"Violence\": 0, # Class 0\n", + " \"Weaponized\": 0 , # Class 0\n", + " \"Normal\": 1 # Class 1\n", + " }\n", + "\n", + " file_paths = []\n", + " labels = []\n", + "\n", + " # Loop through each class folder (Normal, Violence, Weaponized)\n", + " for class_name, label in label_map.items():\n", + " class_path = os.path.join(base_path, class_name)\n", + "\n", + " # Collect all video file paths in the current class folder\n", + " for file_name in os.listdir(class_path):\n", + " if file_name.endswith(('.mp4', '.avi', '.mov')): # Adjust for valid video formats\n", + " file_paths.append(os.path.join(class_path, file_name))\n", + " labels.append(label)\n", + "\n", + "\n", + " file_paths = np.array(file_paths)\n", + "\n", + " labels = np.array(labels)\n", + "\n", + " # Shuffle data while keeping labels in sync\n", + " indices = np.arange(len(file_paths)) # Create an array of indices\n", + " np.random.shuffle(indices) # Shuffle the indices\n", + "\n", + " # Use the shuffled indices to rearrange file_paths and labels\n", + " shuffled_file_paths = file_paths[indices]\n", + " shuffled_labels = labels[indices]\n", + " # Convert lists to numpy arrays for easier handling\n", + " return shuffled_file_paths, shuffled_labels" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "4zUUoFnL2uZ8", + "outputId": "8cfdb2e9-36a0-4a99-ae3b-4f328cd00d06" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 18\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n", + "Total number of frames: 30\n" + ] + } + ], + "source": [ + "\n", + "\n", + "file_paths_3_tr , labels_3_tr = prepare_data(BASE_DIR_train)\n", + "file_paths_3_ts , labels_3_ts = prepare_data(BASE_DIR_test)\n", + "\n", + "file_paths_3 = np.concatenate((file_paths_3_tr , file_paths_3_ts))\n", + "labels_3 = np.concatenate((labels_3_tr , labels_3_ts))\n", + "\n", + "\n", + "\n", + "for path in file_paths_3_tr:\n", + " frame_count = get_frame_count(path)\n", + " print(f\"Total number of frames: {frame_count}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "pRgA6qDD4Nsb" + }, + "outputs": [], + "source": [ + "X_train , y_train = file_paths_3_tr , labels_3_tr\n", + "X_test , y_test = file_paths_3_ts , labels_3_ts" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "LlJKexWA2uzR" + }, + "source": [ + "# **For Dataset 4**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ezy5qF_j24MY", + "outputId": "5c315cda-51c2-42f7-c24e-8b5efa876fee" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into '/content/violence-detection-dataset'...\n", + "remote: Enumerating objects: 376, done.\u001b[K\n", + "remote: Counting objects: 100% (12/12), done.\u001b[K\n", + "remote: Compressing objects: 100% (9/9), done.\u001b[K\n", + "remote: Total 376 (delta 3), reused 11 (delta 3), pack-reused 364 (from 1)\u001b[K\n", + "Receiving objects: 100% (376/376), 1.02 GiB | 54.80 MiB/s, done.\n", + "Resolving deltas: 100% (3/3), done.\n", + "Updating files: 100% (355/355), done.\n" + ] + } + ], + "source": [ + "!git clone https://github.com/airtlab/A-Dataset-for-Automatic-Violence-Detection-in-Videos.git /content/violence-detection-dataset" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "UyQrzwKN29x9" + }, + "outputs": [], + "source": [ + "def prepare_data(base_path):\n", + "\n", + " categories = {\n", + " \"violent\": 0, # Class 0\n", + " \"non-violent\": 1 # Class 1\n", + " }\n", + "\n", + " file_paths = []\n", + " labels = []\n", + "\n", + " # Iterate through each category (violent and non-violent)\n", + " for category, label in categories.items():\n", + " category_path = os.path.join(base_path, category)\n", + "\n", + " # Explore each cam subdirectory within the category\n", + " for cam_folder in [\"cam1\", \"cam2\"]:\n", + " cam_path = os.path.join(category_path, cam_folder)\n", + " if os.path.isdir(cam_path):\n", + " for file_name in os.listdir(cam_path):\n", + " if file_name.endswith('.mp4'):\n", + " file_paths.append(os.path.join(cam_path, file_name))\n", + " labels.append(label)\n", + "\n", + " # Convert lists to numpy arrays and shuffle data\n", + " file_paths = np.array(file_paths)\n", + " labels = np.array(labels)\n", + " indices = np.arange(len(file_paths))\n", + " np.random.shuffle(indices)\n", + " shuffled_file_paths = file_paths[indices]\n", + " shuffled_labels = labels[indices]\n", + "\n", + " return shuffled_file_paths, shuffled_labels" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "FH34TZtt3CAj", + "outputId": "e8819dbc-1529-4ecd-d95a-decbfb9f6b6e" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Total number of frames: 134\n", + "Total number of frames: 165\n", + "Total number of frames: 125\n", + "Total number of frames: 87\n", + "Total number of frames: 189\n", + "Total number of frames: 337\n", + "Total number of frames: 169\n", + "Total number of frames: 168\n", + "Total number of frames: 350\n", + "Total number of frames: 124\n", + "Total number of frames: 138\n", + "Total number of frames: 130\n", + "Total number of frames: 192\n", + "Total number of frames: 102\n", + "Total number of frames: 102\n", + "Total number of frames: 116\n", + "Total number of frames: 214\n", + "Total number of frames: 147\n", + "Total number of frames: 126\n", + "Total number of frames: 369\n", + "Total number of frames: 186\n", + "Total number of frames: 219\n", + "Total number of frames: 159\n", + "Total number of frames: 117\n", + "Total number of frames: 350\n", + "Total number of frames: 227\n", + "Total number of frames: 150\n", + "Total number of frames: 337\n", + "Total number of frames: 151\n", + "Total number of frames: 160\n", + "Total number of frames: 105\n", + "Total number of frames: 192\n", + "Total number of frames: 160\n", + "Total number of frames: 230\n", + "Total number of frames: 369\n", + "Total number of frames: 110\n", + "Total number of frames: 232\n", + "Total number of frames: 153\n", + "Total number of frames: 158\n", + "Total number of frames: 227\n", + "Total number of frames: 148\n", + "Total number of frames: 101\n", + "Total number of frames: 159\n", + "Total number of frames: 127\n", + "Total number of frames: 126\n", + "Total number of frames: 157\n", + "Total number of frames: 116\n", + "Total number of frames: 236\n", + "Total number of frames: 239\n", + "Total number of frames: 159\n", + "Total number of frames: 198\n", + "Total number of frames: 160\n", + "Total number of frames: 103\n", + "Total number of frames: 182\n", + "Total number of frames: 141\n", + "Total number of frames: 96\n", + "Total number of frames: 295\n", + "Total number of frames: 275\n", + "Total number of frames: 127\n", + "Total number of frames: 126\n", + "Total number of frames: 147\n", + "Total number of frames: 102\n", + "Total number of frames: 186\n", + "Total number of frames: 113\n", + "Total number of frames: 106\n", + "Total number of frames: 93\n", + "Total number of frames: 214\n", + "Total number of frames: 227\n", + "Total number of frames: 240\n", + "Total number of frames: 116\n", + "Total number of frames: 224\n", + "Total number of frames: 261\n", + "Total number of frames: 147\n", + "Total number of frames: 180\n", + "Total number of frames: 177\n", + "Total number of frames: 166\n", + "Total number of frames: 150\n", + "Total number of frames: 93\n", + "Total number of frames: 179\n", + "Total number of frames: 191\n", + "Total number of frames: 190\n", + "Total number of frames: 179\n", + "Total number of frames: 149\n", + "Total number of frames: 221\n", + "Total number of frames: 178\n", + "Total number of frames: 206\n", + "Total number of frames: 116\n", + "Total number of frames: 189\n", + "Total number of frames: 129\n", + "Total number of frames: 281\n", + "Total number of frames: 156\n", + "Total number of frames: 136\n", + "Total number of frames: 122\n", + "Total number of frames: 102\n", + "Total number of frames: 107\n", + "Total number of frames: 234\n", + "Total number of frames: 192\n", + "Total number of frames: 149\n", + "Total number of frames: 200\n", + "Total number of frames: 159\n", + "Total number of frames: 122\n", + "Total number of frames: 177\n", + "Total number of frames: 148\n", + "Total number of frames: 190\n", + "Total number of frames: 188\n", + "Total number of frames: 126\n", + "Total number of frames: 191\n", + "Total number of frames: 190\n", + "Total number of frames: 162\n", + "Total number of frames: 179\n", + "Total number of frames: 147\n", + "Total number of frames: 192\n", + "Total number of frames: 203\n", + "Total number of frames: 107\n", + "Total number of frames: 106\n", + "Total number of frames: 144\n", + "Total number of frames: 178\n", + "Total number of frames: 168\n", + "Total number of frames: 129\n", + "Total number of frames: 229\n", + "Total number of frames: 182\n", + "Total number of frames: 230\n", + "Total number of frames: 169\n", + "Total number of frames: 89\n", + "Total number of frames: 89\n", + "Total number of frames: 154\n", + "Total number of frames: 140\n", + "Total number of frames: 156\n", + "Total number of frames: 125\n", + "Total number of frames: 130\n", + "Total number of frames: 274\n", + "Total number of frames: 106\n", + "Total number of frames: 192\n", + "Total number of frames: 186\n", + "Total number of frames: 234\n", + "Total number of frames: 151\n", + "Total number of frames: 327\n", + "Total number of frames: 161\n", + "Total number of frames: 132\n", + "Total number of frames: 110\n", + "Total number of frames: 136\n", + "Total number of frames: 105\n", + "Total number of frames: 138\n", + "Total number of frames: 136\n", + "Total number of frames: 179\n", + "Total number of frames: 145\n", + "Total number of frames: 122\n", + "Total number of frames: 147\n", + "Total number of frames: 160\n", + "Total number of frames: 150\n", + "Total number of frames: 156\n", + "Total number of frames: 126\n", + "Total number of frames: 127\n", + "Total number of frames: 114\n", + "Total number of frames: 178\n", + "Total number of frames: 190\n", + "Total number of frames: 159\n", + "Total number of frames: 160\n", + "Total number of frames: 102\n", + "Total number of frames: 131\n", + "Total number of frames: 182\n", + "Total number of frames: 151\n", + "Total number of frames: 140\n", + "Total number of frames: 111\n", + "Total number of frames: 281\n", + "Total number of frames: 116\n", + "Total number of frames: 240\n", + "Total number of frames: 122\n", + "Total number of frames: 109\n", + "Total number of frames: 155\n", + "Total number of frames: 158\n", + "Total number of frames: 103\n", + "Total number of frames: 168\n", + "Total number of frames: 221\n", + "Total number of frames: 434\n", + "Total number of frames: 153\n", + "Total number of frames: 189\n", + "Total number of frames: 173\n", + "Total number of frames: 116\n", + "Total number of frames: 124\n", + "Total number of frames: 138\n", + "Total number of frames: 96\n", + "Total number of frames: 201\n", + "Total number of frames: 141\n", + "Total number of frames: 111\n", + "Total number of frames: 159\n", + "Total number of frames: 165\n", + "Total number of frames: 172\n", + "Total number of frames: 130\n", + "Total number of frames: 168\n", + "Total number of frames: 87\n", + "Total number of frames: 251\n", + "Total number of frames: 150\n", + "Total number of frames: 230\n", + "Total number of frames: 172\n", + "Total number of frames: 162\n", + "Total number of frames: 250\n", + "Total number of frames: 189\n", + "Total number of frames: 165\n", + "Total number of frames: 168\n", + "Total number of frames: 186\n", + "Total number of frames: 191\n", + "Total number of frames: 290\n", + "Total number of frames: 229\n", + "Total number of frames: 172\n", + "Total number of frames: 182\n", + "Total number of frames: 138\n", + "Total number of frames: 219\n", + "Total number of frames: 219\n", + "Total number of frames: 179\n", + "Total number of frames: 179\n", + "Total number of frames: 96\n", + "Total number of frames: 138\n", + "Total number of frames: 130\n", + "Total number of frames: 138\n", + "Total number of frames: 134\n", + "Total number of frames: 239\n", + "Total number of frames: 215\n", + "Total number of frames: 182\n", + "Total number of frames: 106\n", + "Total number of frames: 243\n", + "Total number of frames: 162\n", + "Total number of frames: 131\n", + "Total number of frames: 74\n", + "Total number of frames: 119\n", + "Total number of frames: 125\n", + "Total number of frames: 160\n", + "Total number of frames: 294\n", + "Total number of frames: 198\n", + "Total number of frames: 274\n", + "Total number of frames: 113\n", + "Total number of frames: 125\n", + "Total number of frames: 231\n", + "Total number of frames: 227\n", + "Total number of frames: 179\n", + "Total number of frames: 106\n", + "Total number of frames: 156\n", + "Total number of frames: 180\n", + "Total number of frames: 113\n", + "Total number of frames: 169\n", + "Total number of frames: 251\n", + "Total number of frames: 116\n", + "Total number of frames: 274\n", + "Total number of frames: 102\n", + "Total number of frames: 275\n", + "Total number of frames: 143\n", + "Total number of frames: 84\n", + "Total number of frames: 136\n", + "Total number of frames: 178\n", + "Total number of frames: 164\n", + "Total number of frames: 103\n", + "Total number of frames: 111\n", + "Total number of frames: 135\n", + "Total number of frames: 236\n", + "Total number of frames: 121\n", + "Total number of frames: 215\n", + "Total number of frames: 237\n", + "Total number of frames: 143\n", + "Total number of frames: 158\n", + "Total number of frames: 216\n", + "Total number of frames: 168\n", + "Total number of frames: 172\n", + "Total number of frames: 219\n", + "Total number of frames: 241\n", + "Total number of frames: 136\n", + "Total number of frames: 96\n", + "Total number of frames: 151\n", + "Total number of frames: 206\n", + "Total number of frames: 161\n", + "Total number of frames: 101\n", + "Total number of frames: 149\n", + "Total number of frames: 149\n", + "Total number of frames: 161\n", + "Total number of frames: 171\n", + "Total number of frames: 171\n", + "Total number of frames: 107\n", + "Total number of frames: 124\n", + "Total number of frames: 74\n", + "Total number of frames: 116\n", + "Total number of frames: 160\n", + "Total number of frames: 128\n", + "Total number of frames: 274\n", + "Total number of frames: 206\n", + "Total number of frames: 234\n", + "Total number of frames: 206\n", + "Total number of frames: 165\n", + "Total number of frames: 203\n", + "Total number of frames: 133\n", + "Total number of frames: 159\n", + "Total number of frames: 121\n", + "Total number of frames: 150\n", + "Total number of frames: 114\n", + "Total number of frames: 162\n", + "Total number of frames: 224\n", + "Total number of frames: 128\n", + "Total number of frames: 102\n", + "Total number of frames: 216\n", + "Total number of frames: 135\n", + "Total number of frames: 122\n", + "Total number of frames: 113\n", + "Total number of frames: 201\n", + "Total number of frames: 103\n", + "Total number of frames: 261\n", + "Total number of frames: 136\n", + "Total number of frames: 192\n", + "Total number of frames: 144\n", + "Total number of frames: 166\n", + "Total number of frames: 140\n", + "Total number of frames: 191\n", + "Total number of frames: 141\n", + "Total number of frames: 158\n", + "Total number of frames: 102\n", + "Total number of frames: 165\n", + "Total number of frames: 119\n", + "Total number of frames: 200\n", + "Total number of frames: 170\n", + "Total number of frames: 164\n", + "Total number of frames: 230\n", + "Total number of frames: 122\n", + "Total number of frames: 243\n", + "Total number of frames: 149\n", + "Total number of frames: 113\n", + "Total number of frames: 250\n", + "Total number of frames: 170\n", + "Total number of frames: 241\n", + "Total number of frames: 149\n", + "Total number of frames: 84\n", + "Total number of frames: 154\n", + "Total number of frames: 192\n", + "Total number of frames: 290\n", + "Total number of frames: 165\n", + "Total number of frames: 172\n", + "Total number of frames: 148\n", + "Total number of frames: 169\n", + "Total number of frames: 144\n", + "Total number of frames: 140\n", + "Total number of frames: 131\n", + "Total number of frames: 188\n", + "Total number of frames: 192\n", + "Total number of frames: 147\n", + "Total number of frames: 111\n", + "Total number of frames: 131\n", + "Total number of frames: 145\n", + "Total number of frames: 234\n", + "Total number of frames: 127\n", + "Total number of frames: 159\n", + "Total number of frames: 179\n", + "Total number of frames: 327\n", + "Total number of frames: 210\n", + "Total number of frames: 434\n" + ] + } + ], + "source": [ + "def get_frame_count(video_path):\n", + " # Open the video file\n", + " cap = cv2.VideoCapture(video_path)\n", + "\n", + " # Check if the video opened successfully\n", + " if not cap.isOpened():\n", + " print(f\"Error: Cannot open video {video_path}\")\n", + " return None\n", + "\n", + " # Get the total number of frames\n", + " frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\n", + "\n", + " # Release the video capture object\n", + " cap.release()\n", + "\n", + " return frame_count\n", + "\n", + "base_dir = '/content/violence-detection-dataset/violence-detection-dataset'\n", + "file_paths_4, labels_4 = prepare_data(base_dir)\n", + "\n", + "\n", + "for path in file_paths_4:\n", + " frame_count = get_frame_count(path)\n", + " print(f\"Total number of frames: {frame_count}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "8Ml1kFwh3LI5" + }, + "outputs": [], + "source": [ + "X_train, X_test, y_train, y_test = train_test_split(file_paths_4 , labels_4 , test_size=0.2 , random_state=42, stratify=labels_4)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ebFKgSoTMx62" + }, + "source": [ + "# **Test section (the pretrained 3D class)**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "id": "IKxFtcnPM04F" + }, + "outputs": [], + "source": [ + "import torch\n", + "import torch.nn as nn\n", + "import torchvision\n", + "import cv2\n", + "import numpy as np\n", + "\n", + "class MyModel(nn.Module):\n", + " def __init__(self, num_classes=1):\n", + " super(MyModel, self).__init__() # Initialize nn.Module\n", + " # Load a pre-trained 3D ResNet (R3D-18) model\n", + " self.model = torchvision.models.video.r3d_18(pretrained=True)\n", + "\n", + " # Modify the final layer for binary classification\n", + " self.model.fc = nn.Linear(self.model.fc.in_features, num_classes)\n", + "\n", + " # Use binary cross-entropy for binary classification\n", + " self.criterion = nn.BCEWithLogitsLoss()\n", + " self.optimizer = torch.optim.Adam(self.model.parameters(), lr=1e-4)\n", + "\n", + " def preprocess_video(self, video_path, num_frames=40):\n", + " \"\"\"Preprocess video: sample frames, resize, normalize, and return tensor.\"\"\"\n", + " cap = cv2.VideoCapture(video_path)\n", + " total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\n", + " frame_indices = np.linspace(0, total_frames - 1, num=num_frames, dtype=int)\n", + " sampled_frames = []\n", + "\n", + " for idx in frame_indices:\n", + " cap.set(cv2.CAP_PROP_POS_FRAMES, idx)\n", + " ret, frame = cap.read()\n", + " if not ret:\n", + " continue\n", + " frame = cv2.resize(frame, (112, 112)) # Resize to 112x112 for R3D-18\n", + " frame = np.transpose(frame, (2, 0, 1)) # Channels-first\n", + " sampled_frames.append(frame)\n", + "\n", + " cap.release()\n", + "\n", + " if len(sampled_frames) < num_frames:\n", + " padding = np.zeros((num_frames - len(sampled_frames), 3, 112, 112))\n", + " sampled_frames = np.concatenate([sampled_frames, padding], axis=0)\n", + "\n", + " # Convert to tensor and rearrange dimensions to (3, num_frames, 112, 112)\n", + " return torch.tensor(sampled_frames).float().permute(1, 0, 2, 3).unsqueeze(0)\n", + "\n", + " def train_model(self, video_paths, labels, batch_size=30):\n", + " \"\"\"Train the model in mini-batches.\"\"\"\n", + " self.model.train()\n", + " for i in range(0, len(video_paths), batch_size):\n", + " batch_videos = video_paths[i:i + batch_size]\n", + " batch_labels = torch.tensor(labels[i:i + batch_size]).float().unsqueeze(1)\n", + "\n", + " X_batch = torch.cat([self.preprocess_video(path) for path in batch_videos])\n", + " y_batch = batch_labels\n", + "\n", + " self.optimizer.zero_grad()\n", + " outputs = self.model(X_batch)\n", + " loss = self.criterion(outputs, y_batch)\n", + " loss.backward()\n", + " self.optimizer.step()\n", + " print(f\"Batch {i // batch_size + 1}: Loss = {loss.item():.4f}\")\n", + "\n", + "\n", + " def forward(self, x):\n", + " return self.model(x)\n", + "\n", + " def test(self, video_paths, labels):\n", + " \"\"\"Test the model on the given videos and compute accuracy.\"\"\"\n", + " self.model.eval()\n", + "\n", + " predictions = []\n", + "\n", + " with torch.no_grad():\n", + " for i, video_path in enumerate(video_paths):\n", + " # Preprocess the video and get the label\n", + " X = self.preprocess_video(video_path)\n", + " # X = X.to(self.device) # Move data to the same device as the model\n", + "\n", + " # Make prediction\n", + " output = self.model(X)\n", + " pred = torch.sigmoid(output) # Apply sigmoid for binary classification\n", + " pred_label = (pred >= 0.5).float() # Threshold at 0.5\n", + "\n", + " # Track predictions\n", + " predictions.append(pred_label.item())\n", + "\n", + "\n", + " return predictions\n", + "\n", + " def save_model(self, filepath):\n", + " torch.save({\n", + " 'model_state_dict': self.state_dict(),\n", + " }, filepath)\n", + " print(f\"Model saved to {filepath}.\")\n", + "\n", + " @staticmethod\n", + " def load_model(filepath, num_classes=1):\n", + " model = MyModel(num_classes)\n", + " checkpoint = torch.load(filepath, weights_only=True) # Set weights_only=True\n", + " model.load_state_dict(checkpoint['model_state_dict'])\n", + " # model.optimizer.load_state_dict(checkpoint['optimizer_state_dict'])\n", + " model.eval() # Set to evaluation mode\n", + " print(f\"Model loaded from {filepath}.\")\n", + " return model\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "RfNggkkVZHLR", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "e2affa62-8b04-4762-dc21-da6b3400d0de" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Model loaded from /content/pre_3D_model_v2.h5.\n" + ] + } + ], + "source": [ + "model = MyModel().load_model('/content/pre_3D_model_v2.h5') # change the path to the chosen .h5 file\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "5JoRr0xEfB50", + "outputId": "9d9eb321-2bb3-4ccc-bb80-7711dd8faf37" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Batch 1: Loss = 0.0075\n", + "Batch 2: Loss = 0.0143\n", + "Batch 3: Loss = 0.0096\n", + "Batch 4: Loss = 0.0152\n", + "Batch 5: Loss = 0.0052\n", + "Batch 6: Loss = 0.0109\n", + "Batch 7: Loss = 0.0076\n", + "Batch 8: Loss = 0.0106\n", + "Batch 9: Loss = 0.0181\n", + "Batch 10: Loss = 0.0088\n", + "Batch 11: Loss = 0.0058\n", + "Batch 12: Loss = 0.0071\n", + "Batch 13: Loss = 0.0082\n", + "Batch 14: Loss = 0.0045\n", + "Batch 15: Loss = 0.0184\n", + "Batch 16: Loss = 0.0143\n", + "Batch 17: Loss = 0.0237\n", + "Batch 18: Loss = 0.0043\n", + "Batch 19: Loss = 0.0138\n", + "Batch 20: Loss = 0.0129\n", + "Batch 21: Loss = 0.0031\n", + "Batch 22: Loss = 0.0192\n", + "Batch 23: Loss = 0.0067\n", + "Batch 24: Loss = 0.0158\n", + "Batch 25: Loss = 0.0050\n", + "Batch 26: Loss = 0.0047\n", + "Batch 27: Loss = 0.0165\n", + "Batch 28: Loss = 0.0109\n", + "Batch 29: Loss = 0.0041\n", + "Batch 1: Loss = 0.0029\n", + "Batch 2: Loss = 0.0091\n", + "Batch 3: Loss = 0.0043\n", + "Batch 4: Loss = 0.0030\n", + "Batch 5: Loss = 0.0023\n", + "Batch 6: Loss = 0.0051\n", + "Batch 7: Loss = 0.0041\n", + "Batch 8: Loss = 0.0027\n", + "Batch 9: Loss = 0.0036\n", + "Batch 10: Loss = 0.0060\n", + "Batch 11: Loss = 0.0029\n", + "Batch 12: Loss = 0.0026\n", + "Batch 13: Loss = 0.0030\n", + "Batch 14: Loss = 0.0025\n", + "Batch 15: Loss = 0.0070\n", + "Batch 16: Loss = 0.0062\n", + "Batch 17: Loss = 0.0068\n", + "Batch 18: Loss = 0.0019\n", + "Batch 19: Loss = 0.0032\n", + "Batch 20: Loss = 0.0049\n", + "Batch 21: Loss = 0.0016\n", + "Batch 22: Loss = 0.0078\n", + "Batch 23: Loss = 0.0028\n", + "Batch 24: Loss = 0.0029\n", + "Batch 25: Loss = 0.0026\n", + "Batch 26: Loss = 0.0022\n", + "Batch 27: Loss = 0.0076\n", + "Batch 28: Loss = 0.0024\n", + "Batch 29: Loss = 0.0018\n" + ] + } + ], + "source": [ + "for i in range(2): # modify number of epochs\n", + " model.train_model(X_train, y_train)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ohDKC_6It44T", + "outputId": "d1f58968-637e-48fb-cfd3-7e28637e081a" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Model saved to /content/pre_3D_model_v2.h5.\n" + ] + } + ], + "source": [ + "model.save_model('/content/pre_3D_model_v2.h5')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "XtaWFs2ieD6M" + }, + "outputs": [], + "source": [ + "pred = model.test(X_test, y_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "YJabBZ31nZSu", + "outputId": "691d6050-0593-4294-dcca-9d1fb6a74a71" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "98.0" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "calculate_accuracy(pred, y_test)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "hxOQ4_1axz3d" + }, + "source": [ + "# **For Normal Models**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "yfnclzeDx3rp" + }, + "outputs": [], + "source": [ + "model = NormalModel()\n", + "model.load_model('/content/3D_CNN_model.h5') # change the path to the chosen .h5 file\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "NVpvIWVf0zDl" + }, + "outputs": [], + "source": [ + "model.train(X_train, y_train)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "KXcGqOKL01Xr" + }, + "outputs": [], + "source": [ + "pred = model.test(X_test)\n", + "\n", + "calculate_accuracy(pred, y_test)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "olPWzprc03VO" + }, + "outputs": [], + "source": [ + "model.save_model('/content/3D_CNN_model.h5')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "F168fSls1xyr" + }, + "source": [ + "# **For saving the model in the drive**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "jkiUHfVJmVRI", + "outputId": "0fa2d9ab-4076-4975-9c19-89f84c97b78a" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'/content/drive/MyDrive/Models/pre_3D_model.zip'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 34 + } + ], + "source": [ + "\n", + "import zipfile\n", + "import shutil\n", + "\n", + "h5_file_path = '/content/content/pre_3D_model_v2.h5' # path of the .h5 file\n", + "zip_file_path = '/content/pre_3D_model.zip' # Path to save the zip file\n", + "\n", + "\n", + "with zipfile.ZipFile(zip_file_path, 'w') as zipf:\n", + " zipf.write(h5_file_path, arcname='/content/pre_3D_model.h5') # here will be the name inside the .zip file\n", + "\n", + "\n", + "shutil.move(zip_file_path, '/content/drive/MyDrive/Models/pre_3D_model.zip') # change which file in the folder to overwrite\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "HglJEyQdXVbD" + }, + "source": [ + "# **Test across all models**" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "j9Nu5IQwXZ6-" + }, + "source": [ + "first, load the corresponding dataset from above header" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-JL-Is5nXhQA", + "outputId": "1448aae7-1202-45f3-c411-5d98bb12d2fd" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Model loaded from /content/A_model.h5.\n", + "1/1 [==============================] - 3s 3s/step\n", + "1/1 [==============================] - 1s 806ms/step\n", + "1/1 [==============================] - 1s 745ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 723ms/step\n", + "1/1 [==============================] - 1s 720ms/step\n", + "1/1 [==============================] - 1s 767ms/step\n", + "1/1 [==============================] - 1s 692ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 664ms/step\n", + "1/1 [==============================] - 1s 644ms/step\n", + "1/1 [==============================] - 1s 676ms/step\n", + "1/1 [==============================] - 1s 838ms/step\n", + "1/1 [==============================] - 1s 822ms/step\n", + "1/1 [==============================] - 1s 773ms/step\n", + "1/1 [==============================] - 1s 790ms/step\n", + "1/1 [==============================] - 1s 812ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 698ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 675ms/step\n", + "1/1 [==============================] - 1s 697ms/step\n", + "1/1 [==============================] - 1s 712ms/step\n", + "1/1 [==============================] - 1s 702ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 692ms/step\n", + "1/1 [==============================] - 1s 741ms/step\n", + "1/1 [==============================] - 1s 677ms/step\n", + "1/1 [==============================] - 1s 680ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 707ms/step\n", + "1/1 [==============================] - 1s 704ms/step\n", + "1/1 [==============================] - 1s 664ms/step\n", + "1/1 [==============================] - 1s 606ms/step\n", + "1/1 [==============================] - 1s 680ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 674ms/step\n", + "1/1 [==============================] - 1s 655ms/step\n", + "1/1 [==============================] - 1s 640ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 795ms/step\n", + "1/1 [==============================] - 1s 812ms/step\n", + "1/1 [==============================] - 1s 793ms/step\n", + "1/1 [==============================] - 1s 722ms/step\n", + "1/1 [==============================] - 1s 778ms/step\n", + "1/1 [==============================] - 1s 702ms/step\n", + "1/1 [==============================] - 1s 707ms/step\n", + "1/1 [==============================] - 1s 741ms/step\n", + "1/1 [==============================] - 1s 651ms/step\n", + "1/1 [==============================] - 1s 651ms/step\n", + "1/1 [==============================] - 1s 757ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 715ms/step\n", + "1/1 [==============================] - 1s 715ms/step\n", + "1/1 [==============================] - 1s 678ms/step\n", + "1/1 [==============================] - 1s 689ms/step\n", + "1/1 [==============================] - 1s 704ms/step\n", + "1/1 [==============================] - 1s 693ms/step\n", + "1/1 [==============================] - 1s 685ms/step\n", + "1/1 [==============================] - 1s 677ms/step\n", + "1/1 [==============================] - 1s 721ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 690ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 675ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 721ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 826ms/step\n", + "1/1 [==============================] - 1s 761ms/step\n", + "1/1 [==============================] - 1s 831ms/step\n", + "1/1 [==============================] - 1s 769ms/step\n", + "1/1 [==============================] - 1s 701ms/step\n", + "1/1 [==============================] - 1s 727ms/step\n", + "1/1 [==============================] - 1s 724ms/step\n", + "1/1 [==============================] - 1s 727ms/step\n", + "1/1 [==============================] - 1s 701ms/step\n", + "1/1 [==============================] - 1s 700ms/step\n", + "1/1 [==============================] - 1s 717ms/step\n", + "1/1 [==============================] - 1s 722ms/step\n", + "1/1 [==============================] - 1s 679ms/step\n", + "1/1 [==============================] - 1s 743ms/step\n", + "1/1 [==============================] - 1s 673ms/step\n", + "1/1 [==============================] - 1s 670ms/step\n", + "1/1 [==============================] - 1s 680ms/step\n", + "1/1 [==============================] - 1s 663ms/step\n", + "1/1 [==============================] - 1s 739ms/step\n", + "1/1 [==============================] - 1s 713ms/step\n", + "1/1 [==============================] - 1s 724ms/step\n", + "1/1 [==============================] - 1s 757ms/step\n", + "1/1 [==============================] - 1s 722ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 711ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 712ms/step\n", + "1/1 [==============================] - 1s 789ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 751ms/step\n", + "1/1 [==============================] - 1s 726ms/step\n", + "1/1 [==============================] - 1s 707ms/step\n", + "1/1 [==============================] - 1s 679ms/step\n", + "1/1 [==============================] - 1s 714ms/step\n", + "1/1 [==============================] - 1s 756ms/step\n", + "1/1 [==============================] - 1s 708ms/step\n", + "1/1 [==============================] - 1s 758ms/step\n", + "1/1 [==============================] - 1s 775ms/step\n", + "1/1 [==============================] - 1s 708ms/step\n", + "1/1 [==============================] - 1s 786ms/step\n", + "1/1 [==============================] - 1s 702ms/step\n", + "1/1 [==============================] - 1s 693ms/step\n", + "1/1 [==============================] - 1s 699ms/step\n", + "1/1 [==============================] - 1s 697ms/step\n", + "1/1 [==============================] - 1s 706ms/step\n", + "1/1 [==============================] - 1s 741ms/step\n", + "1/1 [==============================] - 1s 718ms/step\n", + "1/1 [==============================] - 1s 711ms/step\n", + "1/1 [==============================] - 1s 770ms/step\n", + "1/1 [==============================] - 1s 690ms/step\n", + "1/1 [==============================] - 1s 732ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 681ms/step\n", + "1/1 [==============================] - 1s 689ms/step\n", + "1/1 [==============================] - 1s 683ms/step\n", + "1/1 [==============================] - 1s 657ms/step\n", + "1/1 [==============================] - 1s 884ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 741ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 721ms/step\n", + "1/1 [==============================] - 1s 706ms/step\n", + "1/1 [==============================] - 1s 712ms/step\n", + "1/1 [==============================] - 1s 730ms/step\n", + "1/1 [==============================] - 1s 698ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 638ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 696ms/step\n", + "1/1 [==============================] - 1s 672ms/step\n", + "1/1 [==============================] - 1s 665ms/step\n", + "1/1 [==============================] - 1s 712ms/step\n", + "1/1 [==============================] - 1s 728ms/step\n", + "1/1 [==============================] - 1s 707ms/step\n", + "1/1 [==============================] - 1s 711ms/step\n", + "1/1 [==============================] - 1s 682ms/step\n", + "1/1 [==============================] - 1s 688ms/step\n", + "1/1 [==============================] - 1s 634ms/step\n", + "1/1 [==============================] - 1s 664ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 665ms/step\n", + "1/1 [==============================] - 1s 684ms/step\n", + "1/1 [==============================] - 1s 678ms/step\n", + "1/1 [==============================] - 1s 693ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 731ms/step\n", + "1/1 [==============================] - 1s 826ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 752ms/step\n", + "1/1 [==============================] - 1s 707ms/step\n", + "1/1 [==============================] - 1s 724ms/step\n", + "1/1 [==============================] - 1s 714ms/step\n", + "1/1 [==============================] - 1s 738ms/step\n", + "1/1 [==============================] - 1s 753ms/step\n", + "1/1 [==============================] - 1s 771ms/step\n", + "1/1 [==============================] - 1s 710ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 697ms/step\n", + "1/1 [==============================] - 1s 775ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 701ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 687ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 700ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 697ms/step\n", + "1/1 [==============================] - 1s 687ms/step\n", + "1/1 [==============================] - 1s 709ms/step\n", + "1/1 [==============================] - 1s 708ms/step\n", + "1/1 [==============================] - 1s 751ms/step\n", + "1/1 [==============================] - 1s 701ms/step\n", + "1/1 [==============================] - 1s 693ms/step\n", + "1/1 [==============================] - 1s 658ms/step\n", + "1/1 [==============================] - 1s 669ms/step\n", + "1/1 [==============================] - 1s 791ms/step\n", + "1/1 [==============================] - 1s 828ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 743ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 658ms/step\n", + "1/1 [==============================] - 1s 642ms/step\n", + "1/1 [==============================] - 1s 723ms/step\n", + "1/1 [==============================] - 1s 748ms/step\n", + "1/1 [==============================] - 1s 774ms/step\n", + "1/1 [==============================] - 1s 749ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 699ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 745ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 700ms/step\n", + "1/1 [==============================] - 1s 665ms/step\n", + "1/1 [==============================] - 1s 725ms/step\n", + "1/1 [==============================] - 1s 683ms/step\n", + "1/1 [==============================] - 1s 708ms/step\n", + "1/1 [==============================] - 1s 666ms/step\n", + "1/1 [==============================] - 1s 677ms/step\n", + "1/1 [==============================] - 1s 651ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 725ms/step\n", + "1/1 [==============================] - 1s 725ms/step\n", + "1/1 [==============================] - 1s 700ms/step\n", + "1/1 [==============================] - 1s 704ms/step\n", + "1/1 [==============================] - 1s 777ms/step\n", + "1/1 [==============================] - 1s 734ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 745ms/step\n", + "1/1 [==============================] - 1s 721ms/step\n", + "1/1 [==============================] - 1s 668ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 719ms/step\n", + "1/1 [==============================] - 1s 670ms/step\n", + "1/1 [==============================] - 1s 710ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 728ms/step\n", + "1/1 [==============================] - 1s 726ms/step\n", + "1/1 [==============================] - 1s 674ms/step\n", + "1/1 [==============================] - 1s 692ms/step\n", + "1/1 [==============================] - 1s 699ms/step\n", + "1/1 [==============================] - 1s 619ms/step\n", + "1/1 [==============================] - 1s 674ms/step\n", + "1/1 [==============================] - 1s 669ms/step\n", + "1/1 [==============================] - 1s 687ms/step\n", + "1/1 [==============================] - 1s 749ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 764ms/step\n", + "1/1 [==============================] - 1s 749ms/step\n", + "1/1 [==============================] - 1s 722ms/step\n", + "1/1 [==============================] - 1s 728ms/step\n", + "1/1 [==============================] - 1s 739ms/step\n", + "1/1 [==============================] - 1s 712ms/step\n", + "1/1 [==============================] - 1s 696ms/step\n", + "1/1 [==============================] - 1s 666ms/step\n", + "1/1 [==============================] - 1s 711ms/step\n", + "1/1 [==============================] - 1s 653ms/step\n", + "1/1 [==============================] - 1s 709ms/step\n", + "1/1 [==============================] - 1s 727ms/step\n", + "1/1 [==============================] - 1s 808ms/step\n", + "1/1 [==============================] - 1s 705ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 721ms/step\n", + "1/1 [==============================] - 1s 684ms/step\n", + "1/1 [==============================] - 1s 752ms/step\n", + "1/1 [==============================] - 1s 663ms/step\n", + "1/1 [==============================] - 1s 659ms/step\n", + "1/1 [==============================] - 1s 690ms/step\n", + "1/1 [==============================] - 1s 689ms/step\n", + "1/1 [==============================] - 1s 681ms/step\n", + "1/1 [==============================] - 1s 674ms/step\n", + "1/1 [==============================] - 1s 657ms/step\n", + "1/1 [==============================] - 1s 709ms/step\n", + "1/1 [==============================] - 1s 657ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 718ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 818ms/step\n", + "1/1 [==============================] - 1s 724ms/step\n", + "1/1 [==============================] - 1s 718ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 709ms/step\n", + "1/1 [==============================] - 1s 705ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 730ms/step\n", + "1/1 [==============================] - 1s 719ms/step\n", + "1/1 [==============================] - 1s 717ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 708ms/step\n", + "1/1 [==============================] - 1s 666ms/step\n", + "1/1 [==============================] - 1s 701ms/step\n", + "1/1 [==============================] - 1s 719ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 711ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 685ms/step\n", + "1/1 [==============================] - 1s 705ms/step\n", + "1/1 [==============================] - 1s 707ms/step\n", + "1/1 [==============================] - 1s 584ms/step\n", + "1/1 [==============================] - 1s 684ms/step\n", + "1/1 [==============================] - 1s 654ms/step\n", + "1/1 [==============================] - 1s 766ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 667ms/step\n", + "1/1 [==============================] - 1s 649ms/step\n", + "1/1 [==============================] - 1s 847ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 819ms/step\n", + "1/1 [==============================] - 1s 748ms/step\n", + "1/1 [==============================] - 1s 719ms/step\n", + "1/1 [==============================] - 1s 752ms/step\n", + "1/1 [==============================] - 1s 736ms/step\n", + "1/1 [==============================] - 1s 756ms/step\n", + "1/1 [==============================] - 1s 736ms/step\n", + "1/1 [==============================] - 1s 698ms/step\n", + "1/1 [==============================] - 1s 703ms/step\n", + "1/1 [==============================] - 1s 726ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 738ms/step\n", + "1/1 [==============================] - 1s 711ms/step\n", + "1/1 [==============================] - 1s 796ms/step\n", + "1/1 [==============================] - 1s 710ms/step\n", + "1/1 [==============================] - 1s 705ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 678ms/step\n", + "1/1 [==============================] - 1s 696ms/step\n", + "1/1 [==============================] - 1s 653ms/step\n", + "1/1 [==============================] - 1s 682ms/step\n", + "1/1 [==============================] - 1s 707ms/step\n", + "1/1 [==============================] - 1s 748ms/step\n", + "1/1 [==============================] - 1s 705ms/step\n", + "1/1 [==============================] - 1s 621ms/step\n", + "1/1 [==============================] - 1s 710ms/step\n", + "1/1 [==============================] - 1s 853ms/step\n", + "1/1 [==============================] - 1s 782ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 776ms/step\n", + "1/1 [==============================] - 1s 700ms/step\n", + "1/1 [==============================] - 1s 691ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 687ms/step\n", + "1/1 [==============================] - 1s 768ms/step\n", + "1/1 [==============================] - 1s 742ms/step\n", + "1/1 [==============================] - 1s 739ms/step\n", + "1/1 [==============================] - 1s 661ms/step\n", + "1/1 [==============================] - 1s 652ms/step\n", + "1/1 [==============================] - 1s 695ms/step\n", + "1/1 [==============================] - 1s 709ms/step\n", + "1/1 [==============================] - 1s 705ms/step\n", + "1/1 [==============================] - 1s 694ms/step\n", + "1/1 [==============================] - 1s 691ms/step\n", + "1/1 [==============================] - 1s 657ms/step\n", + "1/1 [==============================] - 1s 675ms/step\n", + "1/1 [==============================] - 1s 692ms/step\n", + "1/1 [==============================] - 1s 659ms/step\n", + "1/1 [==============================] - 1s 732ms/step\n", + "1/1 [==============================] - 1s 689ms/step\n", + "1/1 [==============================] - 1s 742ms/step\n", + "1/1 [==============================] - 1s 749ms/step\n", + "1/1 [==============================] - 1s 751ms/step\n", + "1/1 [==============================] - 1s 813ms/step\n", + "1/1 [==============================] - 1s 725ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 719ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 792ms/step\n", + "1/1 [==============================] - 1s 702ms/step\n", + "1/1 [==============================] - 1s 752ms/step\n", + "1/1 [==============================] - 1s 704ms/step\n", + "1/1 [==============================] - 1s 722ms/step\n", + "1/1 [==============================] - 1s 683ms/step\n", + "1/1 [==============================] - 1s 640ms/step\n", + "1/1 [==============================] - 1s 726ms/step\n", + "1/1 [==============================] - 1s 664ms/step\n", + "1/1 [==============================] - 1s 677ms/step\n", + "1/1 [==============================] - 1s 668ms/step\n", + "1/1 [==============================] - 1s 774ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 699ms/step\n", + "1/1 [==============================] - 1s 677ms/step\n", + "1/1 [==============================] - 1s 722ms/step\n", + "1/1 [==============================] - 1s 736ms/step\n", + "1/1 [==============================] - 1s 660ms/step\n", + "1/1 [==============================] - 1s 667ms/step\n", + "1/1 [==============================] - 1s 678ms/step\n", + "1/1 [==============================] - 1s 665ms/step\n", + "1/1 [==============================] - 1s 674ms/step\n", + "1/1 [==============================] - 1s 825ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 775ms/step\n", + "1/1 [==============================] - 1s 736ms/step\n", + "1/1 [==============================] - 1s 710ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 677ms/step\n", + "1/1 [==============================] - 1s 648ms/step\n", + "1/1 [==============================] - 1s 800ms/step\n", + "1/1 [==============================] - 1s 762ms/step\n", + "1/1 [==============================] - 1s 783ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "Model loaded from /content/model.h5.\n", + "1/1 [==============================] - 3s 3s/step\n", + "1/1 [==============================] - 1s 809ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 836ms/step\n", + "1/1 [==============================] - 1s 778ms/step\n", + "1/1 [==============================] - 1s 764ms/step\n", + "1/1 [==============================] - 1s 781ms/step\n", + "1/1 [==============================] - 1s 796ms/step\n", + "1/1 [==============================] - 1s 740ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 749ms/step\n", + "1/1 [==============================] - 1s 865ms/step\n", + "1/1 [==============================] - 1s 789ms/step\n", + "1/1 [==============================] - 1s 837ms/step\n", + "1/1 [==============================] - 1s 861ms/step\n", + "1/1 [==============================] - 1s 851ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 743ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 757ms/step\n", + "1/1 [==============================] - 1s 752ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 825ms/step\n", + "1/1 [==============================] - 1s 768ms/step\n", + "1/1 [==============================] - 1s 841ms/step\n", + "1/1 [==============================] - 1s 798ms/step\n", + "1/1 [==============================] - 1s 795ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 753ms/step\n", + "1/1 [==============================] - 1s 732ms/step\n", + "1/1 [==============================] - 1s 687ms/step\n", + "1/1 [==============================] - 1s 677ms/step\n", + "1/1 [==============================] - 1s 779ms/step\n", + "1/1 [==============================] - 1s 760ms/step\n", + "1/1 [==============================] - 1s 738ms/step\n", + "1/1 [==============================] - 1s 760ms/step\n", + "1/1 [==============================] - 1s 783ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 710ms/step\n", + "1/1 [==============================] - 1s 738ms/step\n", + "1/1 [==============================] - 1s 926ms/step\n", + "1/1 [==============================] - 1s 920ms/step\n", + "1/1 [==============================] - 1s 842ms/step\n", + "1/1 [==============================] - 1s 826ms/step\n", + "1/1 [==============================] - 1s 801ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 766ms/step\n", + "1/1 [==============================] - 1s 756ms/step\n", + "1/1 [==============================] - 1s 829ms/step\n", + "1/1 [==============================] - 1s 762ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 835ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 761ms/step\n", + "1/1 [==============================] - 1s 763ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 727ms/step\n", + "1/1 [==============================] - 1s 743ms/step\n", + "1/1 [==============================] - 1s 805ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 730ms/step\n", + "1/1 [==============================] - 1s 762ms/step\n", + "1/1 [==============================] - 1s 768ms/step\n", + "1/1 [==============================] - 1s 741ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 819ms/step\n", + "1/1 [==============================] - 1s 799ms/step\n", + "1/1 [==============================] - 1s 804ms/step\n", + "1/1 [==============================] - 1s 790ms/step\n", + "1/1 [==============================] - 1s 760ms/step\n", + "1/1 [==============================] - 1s 776ms/step\n", + "1/1 [==============================] - 1s 833ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 738ms/step\n", + "1/1 [==============================] - 1s 783ms/step\n", + "1/1 [==============================] - 1s 763ms/step\n", + "1/1 [==============================] - 1s 820ms/step\n", + "1/1 [==============================] - 1s 775ms/step\n", + "1/1 [==============================] - 1s 883ms/step\n", + "1/1 [==============================] - 1s 767ms/step\n", + "1/1 [==============================] - 1s 764ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 773ms/step\n", + "1/1 [==============================] - 1s 787ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 805ms/step\n", + "1/1 [==============================] - 1s 729ms/step\n", + "1/1 [==============================] - 1s 754ms/step\n", + "1/1 [==============================] - 1s 728ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 749ms/step\n", + "1/1 [==============================] - 1s 711ms/step\n", + "1/1 [==============================] - 1s 713ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 835ms/step\n", + "1/1 [==============================] - 1s 769ms/step\n", + "1/1 [==============================] - 1s 846ms/step\n", + "1/1 [==============================] - 1s 764ms/step\n", + "1/1 [==============================] - 1s 784ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 749ms/step\n", + "1/1 [==============================] - 1s 758ms/step\n", + "1/1 [==============================] - 1s 795ms/step\n", + "1/1 [==============================] - 1s 811ms/step\n", + "1/1 [==============================] - 1s 721ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 761ms/step\n", + "1/1 [==============================] - 1s 725ms/step\n", + "1/1 [==============================] - 1s 720ms/step\n", + "1/1 [==============================] - 1s 797ms/step\n", + "1/1 [==============================] - 1s 751ms/step\n", + "1/1 [==============================] - 1s 751ms/step\n", + "1/1 [==============================] - 1s 734ms/step\n", + "1/1 [==============================] - 1s 771ms/step\n", + "1/1 [==============================] - 1s 716ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 766ms/step\n", + "1/1 [==============================] - 1s 834ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 732ms/step\n", + "1/1 [==============================] - 1s 798ms/step\n", + "1/1 [==============================] - 1s 837ms/step\n", + "1/1 [==============================] - 1s 830ms/step\n", + "1/1 [==============================] - 1s 837ms/step\n", + "1/1 [==============================] - 1s 730ms/step\n", + "1/1 [==============================] - 1s 861ms/step\n", + "1/1 [==============================] - 1s 732ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 790ms/step\n", + "1/1 [==============================] - 1s 743ms/step\n", + "1/1 [==============================] - 1s 752ms/step\n", + "1/1 [==============================] - 1s 733ms/step\n", + "1/1 [==============================] - 1s 735ms/step\n", + "1/1 [==============================] - 1s 772ms/step\n", + "1/1 [==============================] - 1s 738ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 792ms/step\n", + "1/1 [==============================] - 1s 743ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 775ms/step\n", + "1/1 [==============================] - 1s 784ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 781ms/step\n", + "1/1 [==============================] - 1s 772ms/step\n", + "1/1 [==============================] - 1s 748ms/step\n", + "1/1 [==============================] - 1s 743ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 728ms/step\n", + "1/1 [==============================] - 1s 801ms/step\n", + "1/1 [==============================] - 1s 950ms/step\n", + "1/1 [==============================] - 1s 844ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 851ms/step\n", + "1/1 [==============================] - 1s 821ms/step\n", + "1/1 [==============================] - 1s 760ms/step\n", + "1/1 [==============================] - 1s 764ms/step\n", + "1/1 [==============================] - 1s 794ms/step\n", + "1/1 [==============================] - 1s 835ms/step\n", + "1/1 [==============================] - 1s 827ms/step\n", + "1/1 [==============================] - 1s 790ms/step\n", + "1/1 [==============================] - 1s 801ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 781ms/step\n", + "1/1 [==============================] - 1s 771ms/step\n", + "1/1 [==============================] - 1s 784ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 747ms/step\n", + "1/1 [==============================] - 1s 807ms/step\n", + "1/1 [==============================] - 1s 763ms/step\n", + "1/1 [==============================] - 1s 748ms/step\n", + "1/1 [==============================] - 1s 799ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 772ms/step\n", + "1/1 [==============================] - 1s 751ms/step\n", + "1/1 [==============================] - 1s 763ms/step\n", + "1/1 [==============================] - 1s 773ms/step\n", + "1/1 [==============================] - 1s 805ms/step\n", + "1/1 [==============================] - 1s 863ms/step\n", + "1/1 [==============================] - 1s 888ms/step\n", + "1/1 [==============================] - 1s 852ms/step\n", + "1/1 [==============================] - 1s 851ms/step\n", + "1/1 [==============================] - 1s 851ms/step\n", + "1/1 [==============================] - 1s 876ms/step\n", + "1/1 [==============================] - 1s 877ms/step\n", + "1/1 [==============================] - 1s 781ms/step\n", + "1/1 [==============================] - 1s 768ms/step\n", + "1/1 [==============================] - 1s 783ms/step\n", + "1/1 [==============================] - 1s 870ms/step\n", + "1/1 [==============================] - 1s 798ms/step\n", + "1/1 [==============================] - 1s 771ms/step\n", + "1/1 [==============================] - 1s 772ms/step\n", + "1/1 [==============================] - 1s 841ms/step\n", + "1/1 [==============================] - 1s 786ms/step\n", + "1/1 [==============================] - 1s 836ms/step\n", + "1/1 [==============================] - 1s 852ms/step\n", + "1/1 [==============================] - 1s 813ms/step\n", + "1/1 [==============================] - 1s 773ms/step\n", + "1/1 [==============================] - 1s 741ms/step\n", + "1/1 [==============================] - 1s 730ms/step\n", + "1/1 [==============================] - 1s 779ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 817ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 745ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 764ms/step\n", + "1/1 [==============================] - 1s 839ms/step\n", + "1/1 [==============================] - 1s 769ms/step\n", + "1/1 [==============================] - 1s 849ms/step\n", + "1/1 [==============================] - 1s 842ms/step\n", + "1/1 [==============================] - 1s 808ms/step\n", + "1/1 [==============================] - 1s 805ms/step\n", + "1/1 [==============================] - 1s 805ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 795ms/step\n", + "1/1 [==============================] - 1s 773ms/step\n", + "1/1 [==============================] - 1s 813ms/step\n", + "1/1 [==============================] - 1s 803ms/step\n", + "1/1 [==============================] - 1s 812ms/step\n", + "1/1 [==============================] - 1s 786ms/step\n", + "1/1 [==============================] - 1s 766ms/step\n", + "1/1 [==============================] - 1s 803ms/step\n", + "1/1 [==============================] - 1s 817ms/step\n", + "1/1 [==============================] - 1s 812ms/step\n", + "1/1 [==============================] - 1s 802ms/step\n", + "1/1 [==============================] - 1s 879ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 774ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 781ms/step\n", + "1/1 [==============================] - 1s 798ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 761ms/step\n", + "1/1 [==============================] - 1s 892ms/step\n", + "1/1 [==============================] - 1s 814ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 822ms/step\n", + "1/1 [==============================] - 1s 802ms/step\n", + "1/1 [==============================] - 1s 777ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 874ms/step\n", + "1/1 [==============================] - 1s 786ms/step\n", + "1/1 [==============================] - 1s 803ms/step\n", + "1/1 [==============================] - 1s 825ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 774ms/step\n", + "1/1 [==============================] - 1s 824ms/step\n", + "1/1 [==============================] - 1s 768ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 806ms/step\n", + "1/1 [==============================] - 1s 826ms/step\n", + "1/1 [==============================] - 1s 828ms/step\n", + "1/1 [==============================] - 1s 751ms/step\n", + "1/1 [==============================] - 1s 726ms/step\n", + "1/1 [==============================] - 1s 768ms/step\n", + "1/1 [==============================] - 1s 756ms/step\n", + "1/1 [==============================] - 1s 787ms/step\n", + "1/1 [==============================] - 1s 696ms/step\n", + "1/1 [==============================] - 1s 762ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 770ms/step\n", + "1/1 [==============================] - 1s 795ms/step\n", + "1/1 [==============================] - 1s 890ms/step\n", + "1/1 [==============================] - 1s 850ms/step\n", + "1/1 [==============================] - 1s 771ms/step\n", + "1/1 [==============================] - 1s 839ms/step\n", + "1/1 [==============================] - 1s 828ms/step\n", + "1/1 [==============================] - 1s 790ms/step\n", + "1/1 [==============================] - 1s 810ms/step\n", + "1/1 [==============================] - 1s 775ms/step\n", + "1/1 [==============================] - 1s 764ms/step\n", + "1/1 [==============================] - 1s 809ms/step\n", + "1/1 [==============================] - 1s 791ms/step\n", + "1/1 [==============================] - 1s 767ms/step\n", + "1/1 [==============================] - 1s 781ms/step\n", + "1/1 [==============================] - 1s 810ms/step\n", + "1/1 [==============================] - 1s 843ms/step\n", + "1/1 [==============================] - 1s 779ms/step\n", + "1/1 [==============================] - 1s 769ms/step\n", + "1/1 [==============================] - 1s 832ms/step\n", + "1/1 [==============================] - 1s 678ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 756ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 723ms/step\n", + "1/1 [==============================] - 1s 804ms/step\n", + "1/1 [==============================] - 1s 722ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 798ms/step\n", + "1/1 [==============================] - 1s 752ms/step\n", + "1/1 [==============================] - 1s 746ms/step\n", + "1/1 [==============================] - 1s 849ms/step\n", + "1/1 [==============================] - 1s 962ms/step\n", + "1/1 [==============================] - 1s 836ms/step\n", + "1/1 [==============================] - 1s 859ms/step\n", + "1/1 [==============================] - 1s 909ms/step\n", + "1/1 [==============================] - 1s 797ms/step\n", + "1/1 [==============================] - 1s 756ms/step\n", + "1/1 [==============================] - 1s 793ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 784ms/step\n", + "1/1 [==============================] - 1s 783ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 767ms/step\n", + "1/1 [==============================] - 1s 761ms/step\n", + "1/1 [==============================] - 1s 757ms/step\n", + "1/1 [==============================] - 1s 773ms/step\n", + "1/1 [==============================] - 1s 785ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 736ms/step\n", + "1/1 [==============================] - 1s 765ms/step\n", + "1/1 [==============================] - 1s 767ms/step\n", + "1/1 [==============================] - 1s 737ms/step\n", + "1/1 [==============================] - 1s 772ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 744ms/step\n", + "1/1 [==============================] - 1s 761ms/step\n", + "1/1 [==============================] - 1s 762ms/step\n", + "1/1 [==============================] - 1s 820ms/step\n", + "1/1 [==============================] - 1s 770ms/step\n", + "1/1 [==============================] - 1s 891ms/step\n", + "1/1 [==============================] - 1s 847ms/step\n", + "1/1 [==============================] - 1s 838ms/step\n", + "1/1 [==============================] - 1s 870ms/step\n", + "1/1 [==============================] - 1s 820ms/step\n", + "1/1 [==============================] - 1s 842ms/step\n", + "1/1 [==============================] - 1s 748ms/step\n", + "1/1 [==============================] - 1s 822ms/step\n", + "1/1 [==============================] - 1s 759ms/step\n", + "1/1 [==============================] - 1s 805ms/step\n", + "1/1 [==============================] - 1s 750ms/step\n", + "1/1 [==============================] - 1s 761ms/step\n", + "1/1 [==============================] - 1s 758ms/step\n", + "1/1 [==============================] - 1s 786ms/step\n", + "1/1 [==============================] - 1s 809ms/step\n", + "1/1 [==============================] - 1s 763ms/step\n", + "1/1 [==============================] - 1s 802ms/step\n", + "1/1 [==============================] - 1s 770ms/step\n", + "1/1 [==============================] - 1s 754ms/step\n", + "1/1 [==============================] - 1s 763ms/step\n", + "1/1 [==============================] - 1s 757ms/step\n", + "1/1 [==============================] - 1s 753ms/step\n", + "1/1 [==============================] - 1s 694ms/step\n", + "1/1 [==============================] - 1s 760ms/step\n", + "1/1 [==============================] - 1s 781ms/step\n", + "1/1 [==============================] - 1s 825ms/step\n", + "1/1 [==============================] - 1s 799ms/step\n", + "1/1 [==============================] - 1s 818ms/step\n", + "1/1 [==============================] - 1s 881ms/step\n", + "1/1 [==============================] - 1s 870ms/step\n", + "1/1 [==============================] - 1s 820ms/step\n", + "1/1 [==============================] - 1s 817ms/step\n", + "1/1 [==============================] - 1s 855ms/step\n", + "1/1 [==============================] - 1s 830ms/step\n", + "1/1 [==============================] - 1s 802ms/step\n", + "1/1 [==============================] - 1s 780ms/step\n", + "1/1 [==============================] - 1s 788ms/step\n", + "1/1 [==============================] - 1s 796ms/step\n", + "1/1 [==============================] - 1s 802ms/step\n", + "1/1 [==============================] - 1s 787ms/step\n", + "1/1 [==============================] - 1s 800ms/step\n", + "1/1 [==============================] - 1s 791ms/step\n", + "1/1 [==============================] - 1s 794ms/step\n", + "1/1 [==============================] - 1s 866ms/step\n", + "1/1 [==============================] - 1s 824ms/step\n", + "1/1 [==============================] - 1s 794ms/step\n", + "1/1 [==============================] - 1s 802ms/step\n", + "1/1 [==============================] - 1s 741ms/step\n", + "1/1 [==============================] - 1s 766ms/step\n", + "1/1 [==============================] - 1s 763ms/step\n", + "1/1 [==============================] - 1s 697ms/step\n", + "1/1 [==============================] - 1s 831ms/step\n", + "1/1 [==============================] - 1s 756ms/step\n", + "1/1 [==============================] - 1s 767ms/step\n", + "1/1 [==============================] - 1s 762ms/step\n", + "1/1 [==============================] - 1s 755ms/step\n", + "1/1 [==============================] - 1s 830ms/step\n", + "1/1 [==============================] - 1s 847ms/step\n", + "1/1 [==============================] - 1s 819ms/step\n", + "1/1 [==============================] - 1s 831ms/step\n", + "1/1 [==============================] - 1s 801ms/step\n", + "1/1 [==============================] - 1s 784ms/step\n", + "1/1 [==============================] - 1s 801ms/step\n", + "1/1 [==============================] - 1s 829ms/step\n", + "1/1 [==============================] - 1s 794ms/step\n", + "1/1 [==============================] - 1s 777ms/step\n", + "1/1 [==============================] - 1s 806ms/step\n", + "1/1 [==============================] - 1s 837ms/step\n", + "1/1 [==============================] - 1s 713ms/step\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.\n", + " warnings.warn(\n", + "/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=R3D_18_Weights.KINETICS400_V1`. You can also use `weights=R3D_18_Weights.DEFAULT` to get the most up-to-date weights.\n", + " warnings.warn(msg)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Model loaded from /content/pre_3D_model.h5.\n", + "The accuracy of first model (one LSTM) on the real-life Violence dataset = 87.75%\n", + "The accuracy of first model (Bi LSTM) on the real-life Violence dataset = 50.0%\n", + "The accuracy of first model (pre-trained 3D) on the real-life Violence dataset = 52.25%\n" + ] + } + ], + "source": [ + "Dataset_name = 'real-life Violence' # change the name\n", + "\n", + "model_1 = NormalModel()\n", + "model_1.load_model('/content/A_model.h5')\n", + "model_1_result = calculate_accuracy(model_1.test(X_test) , y_test)\n", + "\n", + "model_2 = NormalModel()\n", + "model_2.load_model('/content/model.h5')\n", + "model_2_result = calculate_accuracy(model_2.test(X_test) , y_test)\n", + "\n", + "model_3 = MyModel().load_model('/content/pre_3D_model.h5')\n", + "model_3_result = calculate_accuracy(model_3.test(X_test , y_test) , y_test)\n", + "\n", + "print(f'The accuracy of first model (one LSTM) on the {Dataset_name} dataset = {model_1_result}%')\n", + "print(f'The accuracy of first model (Bi LSTM) on the {Dataset_name} dataset = {model_2_result}%')\n", + "print(f'The accuracy of first model (pre-trained 3D) on the {Dataset_name} dataset = {model_3_result}%')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "14Efnj601ZwP" + }, + "source": [ + "# **For training the pre-trained 3D over all datasets**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "0wQfrMRO1e3k", + "outputId": "ec65e302-0b66-44f4-fdc2-4e0c23bc5331" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "5200 5200 1301 1301\n" + ] + } + ], + "source": [ + "all_data = np.array([], dtype=object)\n", + "all_labels = np.array([], dtype=int)\n", + "\n", + "# np.random.seed(42)\n", + "\n", + "file_paths = [file_paths_1, file_paths_2, file_paths_3, file_paths_4]\n", + "labels = [labels_1, labels_2, labels_3 , labels_4]\n", + "\n", + "for paths, classes in zip(file_paths, labels):\n", + " all_data = np.concatenate((all_data, np.array(paths, dtype=object)))\n", + " all_labels = np.concatenate((all_labels, np.array(classes, dtype=int)))\n", + "\n", + "indices = np.arange(all_data.shape[0])\n", + "np.random.shuffle(indices)\n", + "all_data = all_data[indices]\n", + "all_labels = all_labels[indices]\n", + "\n", + "X_train , X_test, y_train, y_test = train_test_split(all_data , all_labels , test_size = 0.2 , stratify=all_labels)\n", + "\n", + "\n", + "print(len(X_train) , len(y_train) , len(X_test) , len(y_test))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "IAeanxwEc33W", + "outputId": "0d75c9b1-bbde-40e4-a7bd-22217487be17" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.\n", + " warnings.warn(\n", + "/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=R3D_18_Weights.KINETICS400_V1`. You can also use `weights=R3D_18_Weights.DEFAULT` to get the most up-to-date weights.\n", + " warnings.warn(msg)\n", + "Downloading: \"https://download.pytorch.org/models/r3d_18-b3b3357e.pth\" to /root/.cache/torch/hub/checkpoints/r3d_18-b3b3357e.pth\n", + "100%|██████████| 127M/127M [00:00<00:00, 216MB/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Model loaded from /content/content/pre_3D_model_v2.h5.\n" + ] + } + ], + "source": [ + "model = MyModel().load_model('/content/content/pre_3D_model_v2.h5')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "collapsed": true, + "id": "250Er3o37D9Q", + "outputId": "5ec10fe6-29f2-4ae1-cb02-6ea22f6a420b" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.\n", + " warnings.warn(\n", + "/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=R3D_18_Weights.KINETICS400_V1`. You can also use `weights=R3D_18_Weights.DEFAULT` to get the most up-to-date weights.\n", + " warnings.warn(msg)\n", + "Downloading: \"https://download.pytorch.org/models/r3d_18-b3b3357e.pth\" to /root/.cache/torch/hub/checkpoints/r3d_18-b3b3357e.pth\n", + "100%|██████████| 127M/127M [00:00<00:00, 211MB/s]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Model loaded from /content/pre_3D_model.h5.\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + ":43: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ../torch/csrc/utils/tensor_new.cpp:278.)\n", + " return torch.tensor(sampled_frames).float().permute(1, 0, 2, 3).unsqueeze(0)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Batch 1: Loss = 0.3940\n", + "Batch 2: Loss = 0.3259\n", + "Batch 3: Loss = 0.2759\n", + "Batch 4: Loss = 0.1498\n", + "Batch 5: Loss = 0.3804\n", + "Batch 6: Loss = 0.5726\n", + "Batch 7: Loss = 0.2009\n", + "Batch 8: Loss = 0.1653\n", + "Batch 9: Loss = 0.1218\n", + "Batch 10: Loss = 0.3490\n", + "Batch 11: Loss = 0.2296\n", + "Batch 12: Loss = 0.2138\n", + "Batch 13: Loss = 0.0973\n", + "Batch 14: Loss = 0.0951\n", + "Batch 15: Loss = 0.2510\n", + "Batch 16: Loss = 0.1758\n", + "Batch 17: Loss = 0.2845\n", + "Batch 18: Loss = 0.1654\n", + "Batch 19: Loss = 0.1044\n", + "Batch 20: Loss = 0.1124\n", + "Batch 21: Loss = 0.1571\n", + "Batch 22: Loss = 0.1967\n", + "Batch 23: Loss = 0.2451\n", + "Batch 24: Loss = 0.5118\n", + "Batch 25: Loss = 0.2556\n", + "Batch 26: Loss = 0.1320\n", + "Batch 27: Loss = 0.1707\n", + "Batch 28: Loss = 0.3808\n", + "Batch 29: Loss = 0.0617\n", + "Batch 30: Loss = 0.0596\n", + "Batch 31: Loss = 0.0636\n", + "Batch 32: Loss = 0.0771\n", + "Batch 33: Loss = 0.0768\n", + "Batch 34: Loss = 0.3999\n", + "Batch 35: Loss = 0.1921\n", + "Batch 36: Loss = 0.1351\n", + "Batch 37: Loss = 0.1076\n", + "Batch 38: Loss = 0.2017\n", + "Batch 39: Loss = 0.1576\n", + "Batch 40: Loss = 0.3676\n", + "Batch 41: Loss = 0.1160\n", + "Batch 42: Loss = 0.0869\n", + "Batch 43: Loss = 0.1069\n", + "Batch 44: Loss = 0.0261\n", + "Batch 45: Loss = 0.0647\n", + "Batch 46: Loss = 0.0835\n", + "Batch 47: Loss = 0.0987\n", + "Batch 48: Loss = 0.0971\n", + "Batch 49: Loss = 0.1222\n", + "Batch 50: Loss = 0.0455\n", + "Batch 51: Loss = 0.1196\n", + "Batch 52: Loss = 0.0700\n", + "Batch 53: Loss = 0.0413\n", + "Batch 54: Loss = 0.0552\n", + "Batch 55: Loss = 0.1002\n", + "Batch 56: Loss = 0.2460\n", + "Batch 57: Loss = 0.1284\n", + "Batch 58: Loss = 0.0888\n", + "Batch 59: Loss = 0.0969\n", + "Batch 60: Loss = 0.1915\n", + "Batch 61: Loss = 0.1054\n", + "Batch 62: Loss = 0.0266\n", + "Batch 63: Loss = 0.0410\n", + "Batch 64: Loss = 0.2197\n", + "Batch 65: Loss = 0.0843\n", + "Batch 66: Loss = 0.0887\n", + "Batch 67: Loss = 0.0965\n", + "Batch 68: Loss = 0.0609\n", + "Batch 69: Loss = 0.1238\n", + "Batch 70: Loss = 0.0319\n", + "Batch 71: Loss = 0.0884\n", + "Batch 72: Loss = 0.0728\n", + "Batch 73: Loss = 0.1514\n", + "Batch 74: Loss = 0.1070\n", + "Batch 75: Loss = 0.3553\n", + "Batch 76: Loss = 0.2542\n", + "Batch 77: Loss = 0.1233\n", + "Batch 78: Loss = 0.0726\n", + "Batch 79: Loss = 0.2551\n", + "Batch 80: Loss = 0.1286\n", + "Batch 81: Loss = 0.1033\n", + "Batch 82: Loss = 0.1947\n", + "Batch 83: Loss = 0.0312\n", + "Batch 84: Loss = 0.0436\n", + "Batch 85: Loss = 0.3376\n", + "Batch 86: Loss = 0.0858\n", + "Batch 87: Loss = 0.2624\n", + "Batch 88: Loss = 0.0310\n", + "Batch 89: Loss = 0.0691\n", + "Batch 90: Loss = 0.3421\n", + "Batch 91: Loss = 0.2582\n", + "Batch 92: Loss = 0.1950\n", + "Batch 93: Loss = 0.2696\n", + "Batch 94: Loss = 0.1187\n", + "Batch 95: Loss = 0.0426\n", + "Batch 96: Loss = 0.1346\n", + "Batch 97: Loss = 0.1138\n", + "Batch 98: Loss = 0.3192\n", + "Batch 99: Loss = 0.1094\n", + "Batch 100: Loss = 0.1633\n", + "Batch 101: Loss = 0.0848\n", + "Batch 102: Loss = 0.0509\n", + "Batch 103: Loss = 0.1355\n", + "Batch 104: Loss = 0.1664\n", + "Batch 105: Loss = 0.1093\n", + "Batch 106: Loss = 0.0438\n", + "Batch 107: Loss = 0.0355\n", + "Batch 108: Loss = 0.0211\n", + "Batch 109: Loss = 0.0477\n", + "Batch 110: Loss = 0.0259\n", + "Batch 111: Loss = 0.0085\n", + "Batch 112: Loss = 0.0711\n", + "Batch 113: Loss = 0.0279\n", + "Batch 114: Loss = 0.1479\n", + "Batch 115: Loss = 0.0252\n", + "Batch 116: Loss = 0.1141\n", + "Batch 117: Loss = 0.0116\n", + "Batch 118: Loss = 0.2557\n", + "Batch 119: Loss = 0.0199\n", + "Batch 120: Loss = 0.0080\n", + "Batch 121: Loss = 0.0223\n", + "Batch 122: Loss = 0.1108\n", + "Batch 123: Loss = 0.0851\n", + "Batch 124: Loss = 0.0293\n", + "Batch 125: Loss = 0.0218\n", + "Batch 126: Loss = 0.0831\n", + "Batch 127: Loss = 0.0659\n", + "Batch 128: Loss = 0.0147\n", + "Batch 129: Loss = 0.0225\n", + "Batch 130: Loss = 0.0133\n", + "Batch 131: Loss = 0.0409\n", + "Batch 132: Loss = 0.1086\n", + "Batch 133: Loss = 0.0098\n", + "Batch 134: Loss = 0.0264\n", + "Batch 135: Loss = 0.0284\n", + "Batch 136: Loss = 0.0433\n", + "Batch 137: Loss = 0.0239\n", + "Batch 138: Loss = 0.0236\n", + "Batch 139: Loss = 0.0215\n", + "Batch 140: Loss = 0.1148\n", + "Batch 141: Loss = 0.0607\n", + "Batch 142: Loss = 0.0252\n", + "Batch 143: Loss = 0.0124\n", + "Batch 144: Loss = 0.0078\n", + "Batch 145: Loss = 0.0223\n", + "Batch 146: Loss = 0.0109\n", + "Batch 147: Loss = 0.0272\n", + "Batch 148: Loss = 0.0099\n", + "Batch 149: Loss = 0.1267\n", + "Batch 150: Loss = 0.0151\n", + "Batch 151: Loss = 0.0065\n", + "Batch 152: Loss = 0.0265\n", + "Batch 153: Loss = 0.0058\n", + "Batch 154: Loss = 0.0096\n", + "Batch 155: Loss = 0.0067\n", + "Batch 156: Loss = 0.0288\n", + "Batch 157: Loss = 0.1290\n", + "Batch 158: Loss = 0.0089\n", + "Batch 159: Loss = 0.0187\n", + "Batch 160: Loss = 0.1372\n", + "Batch 161: Loss = 0.0779\n", + "Batch 162: Loss = 0.0301\n", + "Batch 163: Loss = 0.0216\n", + "Batch 164: Loss = 0.0571\n", + "Batch 165: Loss = 0.0115\n", + "Batch 166: Loss = 0.0081\n", + "Batch 167: Loss = 0.0109\n", + "Batch 168: Loss = 0.0196\n", + "Batch 169: Loss = 0.0518\n", + "Batch 170: Loss = 0.1397\n", + "Batch 171: Loss = 0.0084\n", + "Batch 172: Loss = 0.0957\n", + "Batch 173: Loss = 0.0130\n", + "Batch 174: Loss = 0.0223\n", + "Batch 175: Loss = 0.0053\n", + "Batch 176: Loss = 0.0130\n", + "Batch 177: Loss = 0.0097\n", + "Batch 178: Loss = 0.0388\n", + "Batch 179: Loss = 0.0150\n" + ] + } + ], + "source": [ + "model.train_model(X_train , y_train)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "4XgnPYAg7RH9", + "outputId": "d5907bc7-d9c7-4888-d9fa-17537e662c24" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Model saved to /content/pre_3D_model.h5.\n" + ] + } + ], + "source": [ + "model.save_model('/content/pre_3D_model.h5')\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Be37FylG-nDo", + "outputId": "d497e03e-a8f9-40b7-cf06-e4c1c4f51c67" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + ":43: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ../torch/csrc/utils/tensor_new.cpp:278.)\n", + " return torch.tensor(sampled_frames).float().permute(1, 0, 2, 3).unsqueeze(0)\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "99.07763259031515" + ] + }, + "metadata": {}, + "execution_count": 32 + } + ], + "source": [ + "pred = model.test(X_test, y_test)\n", + "calculate_accuracy(pred, y_test)" + ] + } + ], + "metadata": { + "accelerator": "TPU", + "colab": { + "collapsed_sections": [ + "HC0hbhrfzbHr", + "jGA1gzIl0YIg", + "lNmueWp0vSc5", + "q_eo_fXzsge-", + "LlJKexWA2uzR", + "ebFKgSoTMx62", + "hxOQ4_1axz3d", + "F168fSls1xyr", + "HglJEyQdXVbD", + "14Efnj601ZwP" + ], + "gpuType": "V28", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file