본문 바로가기
  • Tried. Failed. Logged.
728x90

분류 전체보기720

파이썬 - 중복 없는 고유성이 보장되는 id 만들기(uuid) import uuid uuid.uuid4() #uuid4 => full random uuid # Outputs something like: UUID('0172fc9a-1dac-4414-b88d-6b9a6feb91ea') uuid란 고유성이 보장되는 id를 만들기 위한 표준 규약을 말한다. 출처: https://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits Random string generation with upper case letters and digits How do I generate a string of size N, made of numbers and uppercase .. 2022. 6. 18.
배경 지워주는 사이트(remove.bg) https://www.remove.bg/ 이미지 배경 제거, 투명 배경 만들기 – remove.bg 사진이나 이미지 배경을 한 번 클릭으로 5초만에 무료로 제거할 수 있습니다. 이미지 배경 투명하게 만드는 법. 누끼 따기 프로그램. www.remove.bg 2022. 6. 15.
PHP - 세션(Session) 사용 출처: https://teserre.tistory.com/8 [PHP] php 세션(Session) 사용하기 목차 세션 시작 세션 변수 사용 세션 변수 해제 세션 변수 등록 확인 세션 id 변경 세션 종료 추가 1. 세션 유지시간 추가 2. 추가 보안설정 세션(Session)은 모든 정보가 사용자 측의 컴퓨터에 저장 teserre.tistory.com 2022. 6. 1.
PHP - MySQL 접속 [prepared statement 방식] $dbserver = "localhost"; $dbuser = "username"; $dbpasswd = "userpasswd"; $dbname = "mydb"; $mysqli = new mysqli($dbserver, $dbuser, $dbpasswd, $dbname); if (mysqli_connect_errno()) { die("Connection failed: " . $conn->connect_error); } $sql = "select * from board where idx = ?"; $stmt = $__mysqli->stmt_init(); $stmt = $__mysqli->prepare($sql); $stmt->bind_param("ss", $use.. 2022. 6. 1.
아스키 형태로 디렉토리 구조 작성 사이트(ASCII Tree Generator) https://ascii-tree-generator.com/ ASCII Tree Generator Visualize and create your perfect folder structure for your next project. Easily convert to an ASCII format to save to your documentation. Instructions Simply drag n drop your folders/files by dragging the icon, click on the name of the folder/file to chan ascii-tree-generator.com 2022. 5. 31.
PyQt - 리소스 적용하기 [경로] images/ ├─ icon.png main.py resources.qrc [resources.qrc] images/icon.png [리소스 파일 변환하기] pyrcc5 resources.qrc -o icon.py [main.py] import icon ... label=QLabel(Form) label.setPixmap( QPixmap(":/images/icon.png") ) # qrc에서 적은 경로명 label.resize(label.pixmap().width(), label.pixmap().height()) ... 출처: https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=browniz1004&logNo=221373310.. 2022. 5. 31.
파이썬 - 현재 라인번호 출력 import inspect def lineno(): """ 이 함수를 호출한 곳의 라인번호를 리턴한다. """ return inspect.getlineno(inspect.getouterframes(inspect.currentframe())[-1][0]) print( lineno() ) try: " " except Exception as e: self.print_log( '[' + str(lineno()) + ']' '예외: ' + str(e), err=True) 출처: https://technote.luminance.kr/entry/python-%EB%94%94%EB%B2%84%EA%B7%B8-line-%EB%B2%88%ED%98%B8-%EC%B0%8D%EA%B8%B0 python 디버그: line 번호.. 2022. 5. 25.
셀레니움 - chromedriver 자동 업데이트 및 설치 pip install chromedriver_autoinstaller from selenium import webdriver import chromedriver_autoinstaller def driverAutoInstall(): chromedriver_autoinstaller.install() driver = webdriver.Chrome() return driver driver = driverAutoInstall() driver.get('http://google.com') 출처: https://dev-guardy.tistory.com/78 [Python] chromedriver selenium 자동설치 [셀레니움, 크롬드라이버] Python , chromedrvier, Selenium, 셀레니움, 크.. 2022. 5. 23.
OpenCV - 커스텀 Cascade 만들기(CASCADE TRAINER GUI) 및 물체 탐지 아래 링크에서 Cascade Trainer GUI를 자신의 컴퓨터 환경에 맞는 버전으로 설치(64비트가 32비트 버전으로 설치하면 중간에 오류가 생김) https://amin-ahmadi.com/cascade-trainer-gui/ Cascade Trainer GUI - Amin Cascade Trainer GUI 1. Introduction Cascade Trainer GUI is a program that can be used to train, test and improve cascade classifier models. It uses a graphical interface to set the parameters and make it easy to use OpenCV tools for training.. 2022. 5. 19.
텐서플로우 - 간단한 기계학습 시키기 https://teachablemachine.withgoogle.com/ Teachable Machine Train a computer to recognize your own images, sounds, & poses. A fast, easy way to create machine learning models for your sites, apps, and more – no expertise or coding required. teachablemachine.withgoogle.com 여러가지 종류의 프로젝트를 생성할 수 있음 [이미지 프로젝트 로컬에서 실행시키기] import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf from .. 2022. 5. 19.
PyQt - 디렉토리 및 파일 경로 불러오기(QFileDialog) from PyQt5.QtWidgets import * path = QFileDialog.getExistingDirectory() print(path) file = QFileDialog.getOpenFileName() print(file) 출처: https://wikidocs.net/5247 1) QFileDialog 이번 절에서는 PyQt가 제공하는 QFileDigalog 클래스에 대해 알아보겠습니다. QFileDigalog는 그림 16.43과 같이 사용자가 파일이나 디렉터리를 선택할 ... wikidocs.net 2022. 5. 19.
OpenCV - 캡챠 문자 검출하기 import cv2 import numpy as numpy import matplotlib.pyplot as plt img = cv2.imread('./characters.PNG') img = cv2.blur(img, (10, 10), anchor=(-1, -1), borderType=cv2.BORDER_DEFAULT) # 블러처리(떨어진 조각을 붙이기) img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 회색 전환 img_gray = 255 - img_gray # 이미지 반전 res, thr = cv2.threshold(img_gray, 90, 255, cv2.THRESH_BINARY) # 이진화 cv2.imshow('gray', thr) contours, hie.. 2022. 5. 18.
728x90