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 matplotlib.pyplot as plt | |
| import numpy as np | |
| import time | |
| norm = np.linalg.norm | |
| def calculate_baricenter(points): | |
| mid_result = 0 | |
| points.append(points[0]) |
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
| у тебя спина белая))) |
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
| source_file = open('tmp.txt', 'r') | |
| n, s, f = map(int, source_file.readline().strip().split()) | |
| s, f = s-1, f-1 | |
| adjacency_matrix = [] | |
| for line in source_file: | |
| cur_line = line.strip().split() | |
| cur_line = list(map(int, cur_line)) | |
| adjacency_matrix.append(cur_line) |
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 hough_transform( | |
| img: np.ndarray, theta: float, rho: float | |
| ) -> (np.ndarray, list, list): | |
| thetas = np.deg2rad(np.linspace(0, 180, int(180 / theta + 1))) | |
| width, height = img.shape | |
| diag_len = int(np.ceil(np.sqrt(width * width + height * height))) # max_dist | |
| rhos = np.linspace(-diag_len, diag_len, int(diag_len / rho + 1)) | |
| # Cache some resuable values |
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 timm | |
| import torch | |
| import numpy as np | |
| import onnx | |
| import pycuda.driver as cuda | |
| import pycuda.autoinit | |
| import tensorrt as trt | |
| def torch2onnx(model_name, onnx_file_path, batch_size, img_size=224): |
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
| n = int(input()) | |
| k = int(input()) | |
| direction = input() | |
| a = [] | |
| for i in range(n): | |
| a.append(int(input())) | |
| result = [0] * n | |
| k %= n |
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 cv2 | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| def plot_one_image(image: np.ndarray) -> None: | |
| """ | |
| Отобразить изображение с помощью matplotlib. | |
| Вспомогательная функция. | |
| :param image: изображение для отображения |
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 cv2 | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from PIL import Image | |
| import math | |
| def plot_one_image(image: np.ndarray) -> None: | |
| """ | |
| Отобразить изображение с помощью matplotlib. | |
| Вспомогательная функция. |
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
| void ThomasAlgorithm_P(int mynode, int numnodes, | |
| int N, double *b, double *a, double *c, double *x, double *q){ | |
| int i; | |
| int rows_local,local_offset; | |
| double S[2][2],T[2][2],s1tmp,s2tmp; | |
| double *l,*d,*y; | |
| MPI_Status status; | |
| l = new double[N]; | |
| d = new double[N]; |
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
| #include <iostream> | |
| #include <fstream> | |
| #include <sstream> | |
| #include <math.h> | |
| #include <thread> | |
| #include <future> | |
| #include "parallel_thread.h" | |
| #include "Sole.hpp" | |
| #include "file_write.h" |
NewerOlder