일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- evaluation
- PostgreSQL
- judge
- format
- Python
- Database
- Mac
- enV
- TORCH
- Laravel
- Converting
- Windows
- DB
- KAKAO
- docker
- pytorch
- Package
- LLM
- list
- Flask
- git
- AI
- 책갈피
- Paper
- Linux
- numpy
- pandas
- GitLab
- Container
- file
- Today
- Total
목록전체 글 (112)
Daily Develope
PIL 모듈 사용 ㅇ 네모박스 삽입 예제 : 이미지파일에 10*20 크기의 박스 삽입 후 저장 from PIL import Image, ImageDraw ### load image targetImg = "{img_path...}/target.jpg" img = Image.open(targetImg) # width, heigth = img.size# image size (width, heigth) ### Draw (width, height)=(10, 20) box from coordinate (x, y) draw = ImageDraw.Draw(img) x = 100 y = 100 draw.rectangle(xy=[(x, y), (x+10, y+20)], outline="#00FF00") img.show()..
Dict. 내부 정렬 ㅇ 샘플 samples = {'c':2, 'a':4, 'b':3, 'd':1, 'e':0} ㅇ 정렬 (숫자/value 기준 오름차순 정렬) sortedList = dict(sorted(samples.items(), key=lambda s: s[1])) print(sortedList) ----- {'e': 0, 'd': 1, 'c': 2, 'b': 3, 'a': 4} Dict. List 정렬 ㅇ 샘플 samples = [ {"name":"a", "score":50}, {"name":"b", "score":60}, {"name":"c", "score":20}, {"name":"d", "score":70}, {"name":"e", "score":20}, {"name":"e", "score..
ㅇ Vision - Face Detect import requests url = "https://dapi.kakao.com/v2/vision/face/detect" target_file = "target_path.jpeg" files = {'image':open(target_file, 'rb')} header = { 'Authorization': 'KakaoAK 123...' } response = requests.post(url=url, headers=header, files=files) print(response) print(response.text)
ㅇ 폴더 및 파일 탐색 - 예) target_dir 에서 png, jpg 파일 출력 (non-recursion) target_dir = f'{os.getcwd()}/sample' for root, dirs, files in os.walk(target_dir): for file in files: if file.endswith(('.png', 'jpg')): print(file) ㅇ 파일 존재 확인 import pathlib if pathlib.Path('myfile.txt').exists(): print("exists")
연산ㅇ 곱셈multiply: a배열과 b배열의 합성곱 (a * b 와 동일)numpy.multiply(a, b)dot: a배열과 b배열의 스칼라곱numpy.dot(a, b)ㅇ absolute: 복소수(a+ib)의 값을 가지는 배열 ary에 대해 절대값(root(a^2 + b^2))의 값을 가지는 배열로 반환numpy.absolute(ary)소수점 제어ㅇ 올림numpy.ceil(value)ㅇ 내림numpy.floor(value)ㅇ 반올림numpy.round(value, point)ㅇ 버림numpy.trunc(value)배열ㅇ 생성- arrange: [start, end] 구간 내 step 간격의 값을 가지는 배열 생성 (default, step = 1)numpy.arrange(start, end, step..