This file contains hidden or 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 torch | |
import time | |
def measure_time(device): | |
# create random matrix | |
size=1000 # size of matrix | |
mat1=torch.randn(size,size, device=device) | |
mat2=torch.randn(size,size , device=device) | |
# measure the time taken for matrix multiplication |
This file contains hidden or 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 mysql.connector | |
try: | |
connection = mysql.connector.connect(host='localhost', | |
database='sakila', | |
user='root', | |
password='sql12345678') | |
sql_select_Query = "select * from customer" | |
cursor = connection.cursor() |
This file contains hidden or 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
def detect_outliers(data): | |
outliers=[] | |
threshold=3 | |
mean = np.mean(data) | |
std =np.std(data) | |
for i in data: | |
z_score= (i - mean)/std |
This file contains hidden or 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 | |
import cv2 | |
def correction( | |
img, | |
shadow_amount_percent, shadow_tone_percent, shadow_radius, | |
highlight_amount_percent, highlight_tone_percent, highlight_radius, | |
color_percent | |
): | |
""" |