diff --git a/lab4/1.yml b/lab4/1.yml index c864de8..e30a50e 100644 --- a/lab4/1.yml +++ b/lab4/1.yml @@ -1,81 +1,4 @@ %YAML:1.0 --- opencv_ml_svm: - format: 3 - svmType: C_SVC - kernel: - type: RBF - gamma: 1. - C: 1. - term_criteria: { epsilon:1.1920928955078125e-07, iterations:1000 } - var_count: 1 - class_count: 2 - class_labels: !!opencv-matrix - rows: 2 - cols: 1 - dt: i - data: [ -1, 1 ] - sv_total: 50 - support_vectors: - - [ 0. ] - - [ 0. ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 1.40129846e-45 ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 0. ] - - [ 2.80259693e-45 ] - - [ 0. ] - - [ 2.80259693e-45 ] - - [ 2.80259693e-45 ] - - [ 2.80259693e-45 ] - - [ 2.80259693e-45 ] - - [ 4.20389539e-45 ] - - [ 2.80259693e-45 ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 2.80259693e-45 ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 1.40129846e-45 ] - - [ 2.80259693e-45 ] - - [ 2.80259693e-45 ] - - [ 1.40129846e-45 ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 0. ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 1.40129846e-45 ] - - [ 0. ] - - [ 2.80259693e-45 ] - - [ 0. ] - - [ 1.40129846e-45 ] - - [ 2.80259693e-45 ] - - [ 1.40129846e-45 ] - - [ 0. ] - decision_functions: - - - sv_count: 50 - rho: 0. - alpha: [ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., -1., -1., -1., - -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., - -1., -1., -1., -1., -1., -1., -1., -1., -1., -1. ] - index: [ 12, 15, 2, 16, 4, 5, 21, 24, 8, 31, 10, 11, 23, 13, 14, - 29, 30, 32, 33, 40, 42, 44, 46, 47, 48, 19, 26, 27, 28, 1, - 3, 25, 0, 7, 34, 35, 36, 37, 38, 39, 9, 41, 6, 43, 17, 45, - 18, 20, 22, 49 ] + {} diff --git a/lab4/lab4.py b/lab4/lab4.py index 6c92bd1..06d83cc 100644 --- a/lab4/lab4.py +++ b/lab4/lab4.py @@ -8,8 +8,8 @@ from PyQt5.QtCore import Qt from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score from PyQt5.QtGui import QImage, QPixmap -from PyQt5.QtWidgets import (QWidget, QApplication, QLabel, QVBoxLayout, QHBoxLayout, QPushButton, - QFileDialog,QComboBox,QMessageBox,QTextBrowser) +from PyQt5.QtWidgets import (QWidget, QApplication, QLabel, QVBoxLayout, QHBoxLayout, QPushButton, + QFileDialog, QComboBox, QMessageBox, QTextBrowser) class Example(QWidget): diff --git a/lab8/input.jpeg b/lab8/input.jpeg new file mode 100644 index 0000000..2073e28 Binary files /dev/null and b/lab8/input.jpeg differ diff --git a/lab8/lab8.py b/lab8/lab8.py index b5b6994..63b564f 100644 --- a/lab8/lab8.py +++ b/lab8/lab8.py @@ -1,8 +1,10 @@ import cv2 import numpy as np from PIL import Image, ImageDraw + + def main(): - image = Image.open('D:\\MACH\\MACH\\LAB_2\\img1.jpg') + image = Image.open('input.jpeg') image_arr = np.asarray(image) hog = cv2.HOGDescriptor() @@ -11,8 +13,9 @@ def main(): detections_rectangles = detections.tolist() draw = ImageDraw.Draw(image) for x, y, w, h in detections_rectangles: - draw.rectangle( - [x, y, x + w, y + h], outline=(255, 0, 0)) + draw.rectangle((x, y, x + w, y + h), outline=(255, 0, 0)) image.show() + + if __name__ == '__main__': main()