Spaces:
Running
Running
Zengyf-CVer
commited on
Commit
•
110d7c4
1
Parent(s):
6043033
some update
Browse files- util/fonts_opt.py +4 -6
util/fonts_opt.py
CHANGED
@@ -5,7 +5,6 @@
|
|
5 |
import os
|
6 |
import sys
|
7 |
from pathlib import Path
|
8 |
-
import torch
|
9 |
|
10 |
import wget
|
11 |
from rich.console import Console
|
@@ -17,9 +16,9 @@ fonts_list = ["SimSun.ttf", "TimesNewRoman.ttf", "malgun.ttf"] # 字体列表
|
|
17 |
fonts_suffix = ["ttc", "ttf", "otf"] # 字体后缀
|
18 |
|
19 |
data_url_dict = {
|
20 |
-
"SimSun.ttf": "https://
|
21 |
-
"TimesNewRoman.ttf": "https://
|
22 |
-
"malgun.ttf": "https://
|
23 |
|
24 |
console = Console()
|
25 |
|
@@ -38,8 +37,7 @@ def add_fronts(font_diff):
|
|
38 |
|
39 |
try:
|
40 |
# 下载字体文件
|
41 |
-
|
42 |
-
torch.hub.download_url_to_file(v, file_path)
|
43 |
except Exception as e:
|
44 |
print("路径错误!程序结束!")
|
45 |
print(e)
|
|
|
5 |
import os
|
6 |
import sys
|
7 |
from pathlib import Path
|
|
|
8 |
|
9 |
import wget
|
10 |
from rich.console import Console
|
|
|
16 |
fonts_suffix = ["ttc", "ttf", "otf"] # 字体后缀
|
17 |
|
18 |
data_url_dict = {
|
19 |
+
"SimSun.ttf": "https://gitee.com/CV_Lab/gradio_yolov5_det/attach_files/1053539/download/SimSun.ttf",
|
20 |
+
"TimesNewRoman.ttf": "https://gitee.com/CV_Lab/gradio_yolov5_det/attach_files/1053537/download/TimesNewRoman.ttf",
|
21 |
+
"malgun.ttf": "https://gitee.com/CV_Lab/gradio_yolov5_det/attach_files/1053538/download/malgun.ttf",}
|
22 |
|
23 |
console = Console()
|
24 |
|
|
|
37 |
|
38 |
try:
|
39 |
# 下载字体文件
|
40 |
+
wget.download(v, file_path)
|
|
|
41 |
except Exception as e:
|
42 |
print("路径错误!程序结束!")
|
43 |
print(e)
|