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 |
Tags
- ubuntu
- C
- 오류
- Numpy
- 핑거스타일
- 채보
- VS Code
- error
- paramiko
- C++
- Selenium
- mysql
- C#
- Linux
- pandas
- label
- YOLO
- pip
- Docker
- windows forms
- Python
- OpenCV
- 프로그래머스
- pytorch
- 컨테이너
- LIST
- Visual Studio
- JSON
- 기타 연주
- SSH
Archives
- Today
- Total
목록colorsys (1)
기계는 거짓말하지 않는다
Python colorsys 모듈을 이용한 일정한 분포의 색상 생성 함수
Python에서 colorsys 모듈을 이용하여 지정된 개수만큼의 색상을일정하게 분포된 색상 팔레트를 생성하는 간단한 함수이다.import colorsysdef generate_colors(num_classes: int, alpha=1): """ list of tuple: (R, G, B, A) 0~255 """ colors = [] for i in range(num_classes): hue = i / num_classes # S=1.0, V=1.0 rgb = colorsys.hsv_to_rgb(hue, 1.0, 1.0) # # RGB 0~255 # r, g, b = [int(x * 255) for x in ..
Python
2025. 1. 21. 22:47