This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A = np.array([[1, 2],[3,4],[5,6]]) | |
B = np.array([[1, 2, 3], [4, 5, 6]]) | |
Result=[] | |
for i in range(0,len(A)): | |
temp=[] | |
for j in range(0,len(B[0])): | |
s = 0 | |
for k in range(0,len(A[0])): | |
s += A[i][k]*B[k][j] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
input_matrix=np.array([[3,0,1,2,7,4], | |
[1,5,8,9,3,1], | |
[2,7,2,5,1,3], | |
[0,1,3,1,7,8], | |
[4,2,1,6,2,8], | |
[2,4,5,2,3,9] | |
]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
files=$(ls *.wav) | |
for file in $files;do | |
filename=$(echo $file | cut -d "." -f 1) | |
sox "$file" -r 48000 $filename{48000}.wav | |
done | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
def take_photo(): | |
cap = cv2.VideoCapture(0) | |
ret , frame = cap.read() | |
cv2.imwrite("SS.png",frame) | |
cap.release() | |
take_photo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
from importlib.resources import path | |
from os import listdir | |
from os.path import isfile, join | |
import cv2 | |
import os | |
import numpy as np | |
from random import shuffle | |
# from tqdm import tqdm | |
import pandas as pd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.datasets import mnist | |
from keras.utils import to_categorical | |
from keras.layers import * | |
from keras.models import * | |
import numpy as np | |
## Load and preprocess the MNIST dataset | |
(train_images , train_labels) , (validation_images , validation_labels) = mnist.load_data() | |
## reshaping the images and normalizing the pixel values to be between 0 and 1. | |
train_images = train_images.reshape((60000, 28, 28, 1)).astype('float32') / 255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import glob | |
import numpy as np | |
import os | |
import sys | |
import tensorflow as tf | |
from sklearn.model_selection import train_test_split | |
EPOCHS = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import os | |
import numpy as np | |
path = "/home/myn/Downloads/all_images/" | |
destination = "/home/myn/Downloads/resized_all_images" | |
for img_name in os.listdir(path): | |
# print(img_path) | |
img = cv2.imread(str(path)+"/"+str(img_name)) | |
# print(img.shape) | |
img = cv2.resize(img, (200,200), interpolation = cv2.INTER_AREA) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("librispeech-lexicon.txt") as f: | |
liness = f.readlines() | |
vocabulary = open("vocab.txt" , 'w') | |
for line in liness: | |
vocabulary.write(line.split()[0] +"\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("utt2spk") as f: | |
liness = f.readlines() | |
utt2spk_final = open("utt2spk_final.txt" , 'w') | |
for line in liness: | |
words = line.split() | |
utt = (words[1],words[0]) | |
uttjoin = '-'.join(utt) | |
# print(uttjoin) |
OlderNewer