Tech & Development
[ Python ] OpenCV (정리)
[ Python ] OpenCV (정리)
2021.12.10
[ Python ] Pillow (정리)
[ Python ] Pillow (정리)
2021.12.10
[ Python ] scikit-image (정리)
[ Python ] scikit-image (정리)
2021.12.10
[ Python ] Image Library
[ Python ] Image Library
2021.12.10Python에서 Image를 처리하기 위해서는 Pillow, OpenCV, PIL 등의 외부 패키지를 설치하여 사용합니다. 아래 각 페이지에서 이미지를 불러오고 저장하는 방법에 대해 소개되어 있습니다. 1. Pillow [ Python ] Pillow (정리) yunwoong.tistory.com 2. scikit-image [ Python ] scikit-image (정리) yunwoong.tistory.com 3. OpenCV [ Python ] OpenCV (정리) yunwoong.tistory.com Image의 타입은 Pillow 의 경우는 PIL.Image.Image 이고 scikit-image과 OpenCV는 numpy.ndarray 입니다. 각 라이브러리마다 장단점이 있지만 정지이미지뿐만 ..
[ Python ] 간단한 MNIST 모델 (OCR) 만들기
[ Python ] 간단한 MNIST 모델 (OCR) 만들기
2021.11.29전체 Source는 Github에 있습니다. 1. Keras로 MNIST 모델생성 from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import Adam from keras.utils import np_utils # MNIST 데이터 읽어 들이기 --- (※1) (X_train, y_train), (X_test, y_test) = mnist.load_data() # 데이터를 float32 자료형으로 변환하고 정규화하기 --- (※2) X_train = X_train.reshape(60000, ..
딥러닝 객체 검출 용어 정리
딥러닝 객체 검출 용어 정리
2021.08.251. Classification 입력으로 주어진 이미지 안의 객체의 종류를 구분하는 행위입니다. 학습방법 : Classification Model은 이미지를 보고 각 폴더에 분류 후 학습 시켜 만듭니다. Model을 만들기 위한 분류 작업은 사람이 하게 됩니다. 생성된 Classification에 이미지를 입력하면 결과 값을 줍니다. 2. Localization 주어진 이미지 안의 Object 가 이미지 안의 어느 위치에 있는지 위치 정보를 출력하는 것입니다. 이제부터는 위치 정보가 필요합니다. (X, Y, W, H) 학습방법 : Localization Model은 이미지의 좌표를 Text 형태로 저장해야 합니다. 좌표 정보를 얻기 위해 Labeling 프로그램을 이용합니다. 더보기 데이타의 형태는 아래..
[Python] 파일명, 디렉토리 경로 추출
[Python] 파일명, 디렉토리 경로 추출
2021.07.071. 파일 목록 얻기 glob.glob(wildcard) - 유닉스 경로명 패턴 스타일로 파일 목록을 얻을 수 있다. os.listdir(path) - 지정된 디렉토리의 전체 파일 목록을 얻을 수 있다. dircache.listdir(path) - os.listdir(path)와 동일한 파일 목록을 전달한다. path가 변경되지 않았을 때, dircache.listdir()은 다시 디렉토리 구조를 읽지 않고 이미 읽은 정보를 활용 dircache.annotate(head, list) - 일반 파일명과 디렉토리명을 구분해주는 함수 2. 디렉토리 os.chdir(path) - 작업하고 있는 디렉토리 변경 os.getcwd() - 현재 프로세스의 작업 디렉토리 얻기 os.remove( filename or p..
Windows 10 FTP 서버 설정
Windows 10 FTP 서버 설정
2021.07.011. 제어판 2. FTP서버와 IIS관리 콘솔 기능 켜기 3. FTP 사이트 추가 iis 라고 입력하시면 IIS(인터넷 정보 서비스) 관리자 프로그램이 검색됩니다. 클릭하여 실행합니다. 4. FTP 사용자 추가 5. FTP 권한 부여 6. 방화벽 설정 인바운드 규칙 중 FTP 서버 관련 규칙을 '규칙 사용' 으로 변경 아웃바운드 규칙 중 FTP 서버 관련 규칙을 '규칙 사용' 으로 변경 7. 서비스 시작 * 한글명 파일 업로드 시 오류가 발생하는 경우 'UTF8 허용' 을 False 로 변경 후 다시 시작
[Python] 자료형 - 문자열 (String)
[Python] 자료형 - 문자열 (String)
2021.05.18Python에서 문자열은 작은따옴표(') 또는 큰따옴표(")로 묶인 일련의 문자입니다. 문자열은 텍스트를 저장하고 조작하는 데 사용되며 Python에서 가장 많이 사용되는 데이터 유형 중 하나입니다. >>> a = 'this is a sentence' >>> a 'this is a sentence' >>> a = '123' >>> type(a) str >>> "Hello World" # 큰 따옴표로 감싸기 >>> 'Python is fun'# 작은 따옴표로 감싸기 >>> '''this is also a string''' # 작은 따옴표 3개를 연속으로 써서 감싸기 >>> """this is a string"""# 큰 따옴표 3개를 연속을 싸서 감싸기 문자열 연산 >>> 'let\'s ' + 'add th..
[Python] 숫자형
[Python] 숫자형
2021.05.18정수 123, -345, 0 실수 123.45, -1234.5, 3.4e10 8진수 0o34, 0o25 16진수 0x2A, 0xFF 정수형(integer) >>> a = 123 >>> a 123 >>> type(a) int 실수형(floating-point) >>> a = 6.2 >>> a 6.2 >>> type(a) float # 실수형을 다음과 같이 컴퓨터식 지수 표현 방식(scientific notation)으로 표현가능 >>> a = 6.2e-23 # 6.2*10^-23를 의미 >>> a = 6.2E-23 # 위와 같음 복소수(complex) >>> a = complex(1, 3) >>> a (1+3j) >>> type(a) complex >>> a = 3-4j >>> a (3-4j) >>> ty..
파이썬 패키지 PIP로 오프라인 설치 (폐쇄망)
파이썬 패키지 PIP로 오프라인 설치 (폐쇄망)
2021.03.04인터넷을 연결할 수 없는 환경에서는 오프라인으로 파이썬 패키지 설치가 필요합니다. 1. pip를 이용하여 패키지 다운로드 pip download ## 버전을 지정 pip download six==1.13.0 -d /pipdownload download를 수행한 패키지와 관련 패키지가 다운로드 됨 더보기 참고로 패키지 다운 받은 서버와 실제 설치할 서버(폐쇄망)의 os나 Python 버전이 다른 경우에는 패키지도 다르기 때문에 version 문제가 발생할 수 있다. 가능한 실제 설치할 서버 환경에 맞춰서 패키지를 다운받아야 합니다. 2. pip를 이용하여 패키지 설치 ## 패키지 개별 설치 pip install --no-index --find-links=. pyinstaller ## 패키지 목록으로 설치 ..
[Python] Requests와 Fiddler 동시 사용 (Jupyter notebook)
[Python] Requests와 Fiddler 동시 사용 (Jupyter notebook)
2021.02.18Fiddler가 수행중인 상태에서 https 규약 사이트를 Requests로 Post() Get()을 수행하면 아래와 같은 오류가 발생합니다. ProxyError: HTTPSConnectionPool(host='www.tistory.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1074: The handshake operation timed out'))) Fiddler 에서 인증서를 내보낼 수 있는데 이를 활용하여 해결 할 수 있습니다. 1. Tools > Options 선택 2. [HTTPS] 탭으로 이동 > Decrypt HTTPS traff..