rogerxavier
commited on
Commit
•
60c10a4
1
Parent(s):
21d7e12
Update 3mergeDialogToVideo.py
Browse files- 3mergeDialogToVideo.py +2 -2
3mergeDialogToVideo.py
CHANGED
@@ -90,7 +90,7 @@ def get_sorted_dialog_text(image_path:"包含后缀的文件路径")->"返回排
|
|
90 |
resp = requests.post("https://rogerxavier-ocr-with-fastapi.hf.space/getCoordinates", files=files,headers=headers)#还是有header才能跑
|
91 |
#先json转换,0为坐标list合集,1为 boxid和text合集
|
92 |
boxCoordinates , boxInfo = resp.json()[0],resp.json()[1] #分别是list和dict类型
|
93 |
-
|
94 |
# 计算文本框的中心点,以便按照从右往左,从上往下的顺序进行排序
|
95 |
centers = [((box[0][0] + box[2][0]) / 2, (box[0][1] + box[2][1]) / 2) for box in boxCoordinates]
|
96 |
|
@@ -114,7 +114,7 @@ def get_sorted_dialog_text(image_path:"包含后缀的文件路径")->"返回排
|
|
114 |
print(sorted_text)
|
115 |
return sorted_text
|
116 |
except Exception as e:
|
117 |
-
print("图片请求出现问题")
|
118 |
print(e)
|
119 |
return None
|
120 |
|
|
|
90 |
resp = requests.post("https://rogerxavier-ocr-with-fastapi.hf.space/getCoordinates", files=files,headers=headers)#还是有header才能跑
|
91 |
#先json转换,0为坐标list合集,1为 boxid和text合集
|
92 |
boxCoordinates , boxInfo = resp.json()[0],resp.json()[1] #分别是list和dict类型
|
93 |
+
print("ofa ocr识别漫画块成功返回")
|
94 |
# 计算文本框的中心点,以便按照从右往左,从上往下的顺序进行排序
|
95 |
centers = [((box[0][0] + box[2][0]) / 2, (box[0][1] + box[2][1]) / 2) for box in boxCoordinates]
|
96 |
|
|
|
114 |
print(sorted_text)
|
115 |
return sorted_text
|
116 |
except Exception as e:
|
117 |
+
print("ofa ocr图片请求出现问题")
|
118 |
print(e)
|
119 |
return None
|
120 |
|