@@ -243,7 +243,6 @@ def AI_process_C(im0s,modelList,postProcess): | |||
elif postProcess['name']=='channel2': | |||
ocrInfo='no ocr' | |||
if len(_detRets0_obj)>0: | |||
print('##line246:',detRets1[0][0] ) | |||
res_real = detRets1[0][0] | |||
res_real="".join( list(filter(lambda x:(ord(x) >19968 and ord(x)<63865 ) or (ord(x) >47 and ord(x)<58 ),res_real))) | |||
@@ -715,4 +714,4 @@ def main(): | |||
if __name__=="__main__": | |||
main() | |||
main() |
@@ -46,7 +46,7 @@ class ocrModel(object): | |||
logger = trt.Logger(trt.Logger.ERROR) | |||
with open(weights, "rb") as f, trt.Runtime(logger) as runtime: | |||
self.model=runtime.deserialize_cuda_engine(f.read())# 输入trt本地文件,返回ICudaEngine对象 | |||
#self.context = self.model.create_execution_context() | |||
self.context = self.model.create_execution_context() | |||
elif self.infer_type=='pth': | |||
if par['mode']=='ch': | |||
@@ -71,6 +71,7 @@ class ocrModel(object): | |||
preds = self.model(image) | |||
else: | |||
preds,trtstr=OcrTrtForward(self.model,[image],False) | |||
#preds,trtstr=OcrTrtForward(self.model,[image], self.context ) | |||
t2 = time.time() | |||
preds_size = torch.IntTensor([preds.size(0)]*1) | |||
@@ -195,4 +196,4 @@ if __name__== "__main__": | |||
print(res_real,os.path.basename(imgUrl),timeInfos ) | |||
@@ -112,3 +112,5 @@ | |||
2.调整crackMeasure模型中增加两个参数。 | |||
3.增加channel2业务,采用检测模型识别"国旗","浮标","船名","船只",并对"船名"调用ocr2。 | |||
除返回格式和过去一样,"船名"对应目标的list末尾加上了ocr结果(原始是[x0,y0,x1,y1,score,cls]--->[x0,y0,x1,y1,score,cls,ocr) | |||
2024.1.26 | |||
1.增加“riverT”业务,和“river2”所有参数都相同,出去yolov5.pt是定制的。 |
@@ -0,0 +1,5 @@ | |||
{ | |||
"labelnames":[ "漂浮物","垃圾","排口","非法建筑","非法种植","水生植物","游泳人员","钓鱼人员","船只","蓝藻"] , | |||
"labelIndexs":[ "SL04","SL05","SL06","SL07","SL08","SL09","SL10","SL11","SL12","SL13" ], | |||
"labelOrders":[0,1,2,3,4,5,6,7,8,9] | |||
} |
@@ -0,0 +1,7 @@ | |||
{ | |||
"post_process":{ "name":"post_process","conf_thres":0.25,"iou_thres":0.3,"ovlap_thres_crossCategory":0.65,"classes":5,"rainbows":[ [0,0,255],[0,255,0],[255,0,0],[255,0,255],[255,255,0],[255,129,0],[255,0,127],[127,255,0],[0,255,127],[0,127,255],[127,0,255],[255,127,255],[255,255,127],[127,255,255],[0,255,255],[255,127,255],[127,255,255], [0,127,0],[0,0,127],[0,255,255]] } | |||
} |