#6 develop

マージ済み
chenyukun が 4 個のコミットを develop から master へマージ 1年前
  1. +2
    -2
      .idea/deployment.xml
  2. +10
    -7
      .idea/workspace.xml
  3. +1
    -0
      entity/FeedBack.py
  4. +1
    -1
      fk_application.yml
  5. +43
    -43
      service/Dispatcher.py
  6. +1
    -1
      test/kafka/producer_start.py

+ 2
- 2
.idea/deployment.xml ファイルの表示

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" autoUpload="Always" serverName="thsw2@192.168.10.66:22" remoteFilesAllowedToDisappearOnAutoupload="false">
<component name="PublishConfigData" autoUpload="Always" serverName="10.11" remoteFilesAllowedToDisappearOnAutoupload="false">
<serverData>
<paths name="10.11">
<serverdata>
<mappings>
<mapping deploy="/home/thsw/tuo_heng/prod/algSch" local="$PROJECT_DIR$" web="/" />
<mapping deploy="/home/thsw/tuo_heng/prod/fk" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>

+ 10
- 7
.idea/workspace.xml ファイルの表示

@@ -7,8 +7,7 @@
<list default="true" id="4f7dccd9-8f92-4a6e-90cc-33890d102263" name="Changes" comment="Changes">
<change beforePath="$PROJECT_DIR$/.idea/deployment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/deployment.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/baidusdk/baidusdk.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/baidusdk/baidusdk.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/util/ModelUtils.py" beforeDir="false" afterPath="$PROJECT_DIR$/util/ModelUtils.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/service/Dispatcher.py" beforeDir="false" afterPath="$PROJECT_DIR$/service/Dispatcher.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -65,7 +64,7 @@
</favorite-branches>
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="master" />
<entry key="$PROJECT_DIR$" value="release" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
@@ -158,7 +157,7 @@
<recent name="D:\work\alg\tuoheng_alg\image" />
</key>
</component>
<component name="RunManager" selected="Python.baidusdk">
<component name="RunManager" selected="Python.producer_start">
<configuration name="ailiyunsdk2" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="tuoheng_fk" />
<option name="INTERPRETER_OPTIONS" value="" />
@@ -301,10 +300,11 @@
</list>
<recent_temporary>
<list>
<item itemvalue="Python.producer_start" />
<item itemvalue="Python.baidusdk (1)" />
<item itemvalue="Python.ailiyunsdk2" />
<item itemvalue="Python.producer_start" />
<item itemvalue="Python.fk_master" />
<item itemvalue="Python.baidusdk (1)" />
</list>
</recent_temporary>
</component>
@@ -366,6 +366,9 @@
<workItem from="1668495580103" duration="4299000" />
<workItem from="1668557058851" duration="7348000" />
<workItem from="1668729963723" duration="1367000" />
<workItem from="1668992475881" duration="5624000" />
<workItem from="1669712597426" duration="1097000" />
<workItem from="1669779593434" duration="362000" />
</task>
<servers />
</component>
@@ -406,7 +409,7 @@
<SUITE FILE_PATH="coverage/tuoheng_alg$2.coverage" NAME="视频添加图片水印2 Coverage Results" MODIFIED="1661875306428" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" />
<SUITE FILE_PATH="coverage/tuoheng_fk$producer_start.coverage" NAME="producer_start 覆盖结果" MODIFIED="1667811329568" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test/kafka" />
<SUITE FILE_PATH="coverage/tuoheng_alg$4.coverage" NAME="视频添加图片水印4 Coverage Results" MODIFIED="1661874731395" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" />
<SUITE FILE_PATH="coverage/tuoheng_fk_python$producer_start.coverage" NAME="producer_start 覆盖结果" MODIFIED="1667895565003" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test/kafka" />
<SUITE FILE_PATH="coverage/tuoheng_fk_python$producer_start.coverage" NAME="producer_start 覆盖结果" MODIFIED="1668740739058" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test/kafka" />
<SUITE FILE_PATH="coverage/tuoheng_alg$KafkaUtils__1_.coverage" NAME="KafkaUtils (1) Coverage Results" MODIFIED="1663464961001" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/util" />
<SUITE FILE_PATH="coverage/tuoheng_alg$minio.coverage" NAME="minio 覆盖结果" MODIFIED="1667465702864" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test/minio1" />
<SUITE FILE_PATH="coverage/tuoheng_alg$producer_start.coverage" NAME="producer_start Coverage Results" MODIFIED="1663466832843" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" />
@@ -417,7 +420,7 @@
<SUITE FILE_PATH="coverage/tuoheng_fk$image.coverage" NAME="image 覆盖结果" MODIFIED="1667547816366" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test/协程" />
<SUITE FILE_PATH="coverage/tuoheng_alg$TimeUtils.coverage" NAME="TimeUtils Coverage Results" MODIFIED="1661222768678" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/util" />
<SUITE FILE_PATH="coverage/tuoheng_fk_python$aaliyunsdk.coverage" NAME="ailiyunsdk2 覆盖结果" MODIFIED="1667959131471" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="/home/chenyukun/fk/test/baidusdk" />
<SUITE FILE_PATH="coverage/tuoheng_fk_python$baidusdk.coverage" NAME="baidusdk 覆盖结果" MODIFIED="1668732696180" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="/home/chenyukun/fk" />
<SUITE FILE_PATH="coverage/tuoheng_fk_python$baidusdk.coverage" NAME="baidusdk 覆盖结果" MODIFIED="1668740729949" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="/home/chenyukun/fk" />
<SUITE FILE_PATH="coverage/tuoheng_fk$Dispatcher.coverage" NAME="Dispatcher 覆盖结果" MODIFIED="1667810228478" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/service" />
<SUITE FILE_PATH="coverage/tuoheng_alg$3.coverage" NAME="视频添加文字水印3 Coverage Results" MODIFIED="1661906152928" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" />
</component>

+ 1
- 0
entity/FeedBack.py ファイルの表示

@@ -7,5 +7,6 @@ def message_register(registerId="", carUrl="", carCode="", flowManRecognitionlLi
"registerId": registerId,
"carUrl": carUrl,
"carCode": carCode,
"carCodeScore": '',
"flowManRecognitionlList": flowManRecognitionlList
}

+ 1
- 1
fk_application.yml ファイルの表示

@@ -33,7 +33,7 @@ kafka:
enable_auto_commit: False
max_poll_records: 1
test:
bootstrap_servers: ['192.168.11.242:9092']
bootstrap_servers: ['106.14.96.218:19092']
producer:
acks: -1
retries: 3

+ 43
- 43
service/Dispatcher.py ファイルの表示

@@ -25,9 +25,11 @@ def distinguish(flowMan, fkmodel, gpuId, orc, msgId):
carUrl = flowMan.get("carUrl")
flowManUrlList = flowMan.get("flowManUrlList")
args_list = []
args_list.append(('plate', carUrl, gpuId, fkmodel, orc, msgId))
if carUrl is not None and len(carUrl) > 0:
args_list.append(('plate', carUrl, gpuId, fkmodel, orc, msgId))
for flowManUrl in flowManUrlList:
args_list.append(('code', flowManUrl, gpuId, fkmodel, orc, msgId))
if flowManUrl is not None and len(flowManUrl) > 0:
args_list.append(('code', flowManUrl, gpuId, fkmodel, orc, msgId))
register = message_register(registerId=registerId, carUrl=carUrl, carCode="", flowManRecognitionlList=[])
with ThreadPoolExecutor(max_workers=2) as t:
for result in t.map(ai_segmentation_recognition, args_list):
@@ -85,17 +87,17 @@ def ai_segmentation_recognition(param):
# 行程码
if dataBack.get("type") == 0:
# 手机号
if dataBack.get("phoneNumberImage") is None or len(dataBack.get("phoneNumberImage")) == 0:
phoneNumberRecognition = ''
phone_score = ''
else:
phone = param[4].universal_text_recognition(dataBack.get("phoneNumberImage")[0], param[5])
phone_score = dataBack.get("phoneNumberImage")[1]
if phone is None or phone.get("words_result") is None or len(phone.get("words_result")) == 0:
logger.error("手机号识别为空: {}", phone)
phoneNumberRecognition = ''
else:
phoneNumberRecognition = phone.get("words_result")
# if dataBack.get("phoneNumberImage") is None or len(dataBack.get("phoneNumberImage")) == 0:
# phoneNumberRecognition = ''
# phone_score = ''
# else:
# phone = param[4].universal_text_recognition(dataBack.get("phoneNumberImage")[0], param[5])
# phone_score = dataBack.get("phoneNumberImage")[1]
# if phone is None or phone.get("words_result") is None or len(phone.get("words_result")) == 0:
# logger.error("手机号识别为空: {}", phone)
# phoneNumberRecognition = ''
# else:
# phoneNumberRecognition = phone.get("words_result")
if dataBack.get("cityImage") is None or len(dataBack.get("cityImage")) == 0:
cityRecognition = ''
city_score = ''
@@ -109,35 +111,33 @@ def ai_segmentation_recognition(param):
cityRecognition = city.get("words_result")
return {'type': str(dataBack.get("type")),
'imageUrl': param[1],
'phoneNumberRecognition': phoneNumberRecognition,
'phone_sorce': phone_score,
# 'phoneNumberRecognition': phoneNumberRecognition,
# 'phone_sorce': phone_score,
'cityRecognition': cityRecognition,
'city_score': city_score}
elif dataBack.get("type") == 1:
if dataBack.get("nameImage") is None or len(dataBack.get("nameImage")) == 0:
nameRecognition = ''
name_score = ''
else:
name = param[4].universal_text_recognition(dataBack.get("nameImage")[0], param[5])
name_score = dataBack.get("nameImage")[1]
if name is None or name.get("words_result") is None or len(name.get("words_result")) == 0:
logger.error("名字识别为空: {}", name)
nameRecognition = ''
else:
nameRecognition = name.get("words_result")

if dataBack.get("phoneNumberImage") is None or len(dataBack.get("phoneNumberImage")) == 0:
phoneNumberRecognition = ''
phone_score = ''
else:
phone = param[4].universal_text_recognition(dataBack.get("phoneNumberImage")[0], param[5])
phone_score = dataBack.get("phoneNumberImage")[1]
if phone is None or phone.get("words_result") is None or len(phone.get("words_result")) == 0:
logger.error("手机号识别为空: {}", phone)
phoneNumberRecognition = ''
else:
phoneNumberRecognition = phone.get("words_result")

# if dataBack.get("nameImage") is None or len(dataBack.get("nameImage")) == 0:
# nameRecognition = ''
# name_score = ''
# else:
# name = param[4].universal_text_recognition(dataBack.get("nameImage")[0], param[5])
# name_score = dataBack.get("nameImage")[1]
# if name is None or name.get("words_result") is None or len(name.get("words_result")) == 0:
# logger.error("名字识别为空: {}", name)
# nameRecognition = ''
# else:
# nameRecognition = name.get("words_result")
# if dataBack.get("phoneNumberImage") is None or len(dataBack.get("phoneNumberImage")) == 0:
# phoneNumberRecognition = ''
# phone_score = ''
# else:
# phone = param[4].universal_text_recognition(dataBack.get("phoneNumberImage")[0], param[5])
# phone_score = dataBack.get("phoneNumberImage")[1]
# if phone is None or phone.get("words_result") is None or len(phone.get("words_result")) == 0:
# logger.error("手机号识别为空: {}", phone)
# phoneNumberRecognition = ''
# else:
# phoneNumberRecognition = phone.get("words_result")
if dataBack.get("hsImage") is None or len(dataBack.get("hsImage")) == 0:
hsRecognition = ''
hs_score = ''
@@ -153,10 +153,10 @@ def ai_segmentation_recognition(param):
return {'type': str(dataBack.get("type")),
'imageUrl': param[1],
'color': dataBack.get("color"),
'nameRecognition': nameRecognition,
'name_score': name_score,
'phoneNumberRecognition': phoneNumberRecognition,
'phone_score': phone_score,
# 'nameRecognition': nameRecognition,
# 'name_score': name_score,
# 'phoneNumberRecognition': phoneNumberRecognition,
# 'phone_score': phone_score,
'hsRecognition': hsRecognition,
'hs_score': hs_score}
else:

+ 1
- 1
test/kafka/producer_start.py ファイルの表示

@@ -67,7 +67,7 @@ aa = {
}
]
}
producer = KafkaProducer(bootstrap_servers=['192.168.11.13:9092'],
producer = KafkaProducer(bootstrap_servers=['106.14.96.218:19092'],
value_serializer=lambda m: json.dumps(m).encode('utf-8'))
future = producer.send(topicName, key=b'ffa29db9c4c7451997b3d5038bf13381', value=aaa)
result = future.get(timeout=10)

読み込み中…
キャンセル
保存