본문 바로가기

공부기록/Python

(3)
Left-Right Flip Method 구현 입력값 array: np.array(), width: int, height: int 좌우 반전 메소드 구현 실행시간 전혀 고려안했음 start, end (좌표로 사용할 값) 구하는게 핵심인듯 이걸 왜 생각못했지 img = [0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0] height, width = 4, 4 output_1 = [] output_2 = [] ### 1. temp list for h in range(height): start = h*width end = start+width temp = [] for idx in range(end, start, -1): temp.append(img[idx-1]) output_1.append(temp) ### 2. reve..
[scikit-learn] F1 Score 산출 F1 Score 관련 설명 잘 되어있는 링크: https://towardsdatascience.com/the-f1-score-bec2bbc38aa6 The F1 score All you need to know about the F1 score in machine learning. With an example applying the F1 score in Python. towardsdatascience.com * Segmentation 결과값과 GT와의 정확도를 비교해야 해서 다시금 찾아보고 정리함 파일 내 클래스가 균형있게 분포되어 있지 않아 단순 정확도보단 F1 Score로 비교하는게 맞는 것 같다. 아래 두 가지 방식 중 하나 골라잡으면 될 것 같음. f1_score: 스코어 평균 산출 (macro-단..
[tkinter] 간단 예제 // Python GUI // 속도와 거리 산출하여 조건 만족시 메시지박스(알림창) 출력 // 속도와 거리는 randrange() 사용하여 임의의 값 생성되도록 함 from tkinter import * ## tkinter module import from tkinter import messagebox ## tkinter messagebox import from random import * ## random module import class App : # 여기서부터 App class 구현 def __init__(self, master) : # define frame = Frame(master) frame.pack() button1 = Button(frame, text = "속도", command = s..