import cv2 import numpy as np import os from matplotlib import pyplot as plt import time…
- User
import cv2 import numpy as np import os from matplotlib import pyplot as plt import time import mediapipe as mp
Path for exported data, numpy arrays
DATA_PATH = os.path.join('MP_Data')
Actions that we try to detect
actions = np.array(["الصبح","availabile","direct","hour","kaam","Masr","saturday","money","stop_cut","ticket","train"])
Thirty videos worth of data
no_sequences = 100
Videos are going to be 30 frames in length
sequence_length = 50 actions for action in actions: for sequence in range(no_sequences): try: os.makedirs(os.path.join(DATA_PATH, action, str(sequence))) except: pass from sklearn.model_selection import train_test_split from tensorflow.keras.utils import to_categorical label_map = {label:num for num, label in enumerate(actions)} label_map sequences, labels = [], [] for action in actions: for sequence in range(no_sequences): window = [] for frame_num in range(sequence_length): res = np.load(os.path.join(DATA_PATH, action, str(sequence), "{}.npy".format(frame_num))) window.append(res) sequences.append(window) labels.append(label_map[action]) np.array(sequences).shape np.array(labels).shape X = np.array(sequences) X.shape y = to_categorical(labels).astype(np.float32) y X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) y_test.shape "Please write a report on this code for a research and methodology of a sign language recognition model" Explain how it works and why its used and what is the model used ?
- Assistant
- User
import cv2 import numpy as np import os from matplotlib import pyplot as plt import time import mediapipe as mp
Path for exported data, numpy arrays
DATA_PATH = os.path.join(‘MP_Data’)
Actions that we try to detect
actions = np.array([“الصبح”,“availabile”,“direct”,“hour”,“kaam”,“Masr”,“saturday”,“money”,“stop_cut”,“ticket”,“train”])
- Assistant