Spaces:
Sleeping
Sleeping
Download utils/plot_fonts.py from leewatson/kshs33_emotion_predict: direct link, hf CLI and curl.
- Browser
- Download file 522 Bytes
-
https://huggingface.co/spaces/leewatson/kshs33_emotion_predict/resolve/main/utils/plot_fonts.py
- Command line
-
hf download hf://spaces/leewatson/kshs33_emotion_predict/utils/plot_fonts.py
-
curl -L -o plot_fonts.py https://huggingface.co/spaces/leewatson/kshs33_emotion_predict/resolve/main/utils/plot_fonts.py
522 Bytes
| # utils/plot_fonts.py | |
| import os | |
| from matplotlib import font_manager, rcParams | |
| def setup_korean_font(project_root, ttf_name="NanumGothic.ttf"): | |
| font_path = os.path.join(project_root, ttf_name) | |
| if os.path.exists(font_path): | |
| font_manager.fontManager.addfont(font_path) | |
| rcParams["font.family"] = font_manager.FontProperties(fname=font_path).get_name() | |
| else: | |
| rcParams["font.family"] = ["NanumGothic", "AppleGothic", "Malgun Gothic", "DejaVu Sans"] | |
| rcParams["axes.unicode_minus"] = False |