Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 전산기초
- cs
- 자료구조 및 실습
- AWS
- docker
- Python
- pytorch
- C++
- 1단계
- CS231n
- SWEA
- 실전알고리즘
- 구현
- MySQL
- ssd
- test-helper
- 딥러닝
- 백준
- 프로그래머스
- 모두를 위한 딥러닝 강좌 시즌1
- 3단계
- Object detection
- 2단계
- ubuntu
- STL
- 이것이 코딩테스트다 with 파이썬
- 머신러닝
- 그리디
- 코드수행
- 파이썬
Archives
- Today
- Total
곰퓨타의 SW 이야기
[python] image size 아는 법 본문
python에서 image size를 아는 방법이다.
python에서는 PIL 을 활용하면 이미지 사이즈를 쉽게 알 수 있다.
pil은 아래와 같은 명령어로 사용이 가능하다.
$ pip install pillow
# Know image size
from PIL import Image
im = Image.open('/path_image_file.jpg')
width, height = im.size
print(width, height)
pillow.readthedocs.io/en/stable/
Pillow — Pillow (PIL Fork) 8.2.0 documentation
© Copyright 1995-2011 Fredrik Lundh, 2010-2021 Alex Clark and Contributors Revision e0e353c0.
pillow.readthedocs.io
pillow를 사용하다 모르는 것이 나오는 경우, 위의 document를 활용하면 좋을 것 같다.
'Project > python 활용(ex.openCV)' 카테고리의 다른 글
[python] detectron2의 demo.py를 변환하여 txt 파일로 저장하기 (0) | 2021.05.10 |
---|---|
[python] pandas로 labeling type 수정하여 txt 파일 저장하기 (0) | 2021.04.23 |
[python] opencv video to image (0) | 2021.04.21 |
[python] ffmpeg를 활용하여 image to video 수행하기 (0) | 2021.04.21 |
[python] openCV로 txt file 활용하여 bounding box, box labeling 하기 (0) | 2021.04.21 |
Comments