4 Commits bbae5dee3b ... 09d3c87f22

Author SHA1 Message Date
  MaochengHu 09d3c87f22 Merge remote-tracking branch 'origin/master' 2 years ago
  MaochengHu db1c1fdb1b fix the python environment path problem 2 years ago
  MaochengHu 0f6303f99c fix the python environment path problem 2 years ago
  MaochengHu d25269c4af fix the python environment path problem 2 years ago

+ 26 - 12
.idea/workspace.xml

@@ -2,14 +2,7 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="e5041b5b-13f7-40ae-a9f1-04b16d6a93ad" name="Default Changelist" comment="">
-      <change afterPath="$PROJECT_DIR$/src_code/model_zoo/yolov5_model_zoo/coco.yaml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src_code/config_files/yolov5_config.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/src_code/config_files/yolov5_config.yaml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src_code/models-server/model-store/yolov5_config.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src_code/models-server/model-store/yolov5_config.properties" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src_code/src/model_structure/yolov5_structure/yolov5-master/utils/torch_utils.py" beforeDir="false" afterPath="$PROJECT_DIR$/src_code/src/model_structure/yolov5_structure/yolov5-master/utils/torch_utils.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src_code/src/model_structure/yolov5_structure/yolov5.py" beforeDir="false" afterPath="$PROJECT_DIR$/src_code/src/model_structure/yolov5_structure/yolov5.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src_code/start_torch_server.sh" beforeDir="false" afterPath="$PROJECT_DIR$/src_code/start_torch_server.sh" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src_code/test/test_src/multi_thread_test.py" beforeDir="false" afterPath="$PROJECT_DIR$/src_code/test/test_src/multi_thread_test.py" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -57,7 +50,7 @@
       <recent name="F:\server_develop\code\src\model_structure\yolov5_structure" />
     </key>
   </component>
-  <component name="RunManager" selected="Python.multi_thread_test">
+  <component name="RunManager" selected="Python.yolo_test_handler">
     <configuration name="123" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
       <module name="server_develop" />
       <option name="INTERPRETER_OPTIONS" value="" />
@@ -199,11 +192,11 @@
     </list>
     <recent_temporary>
       <list>
+        <item itemvalue="Python.yolo_test_handler" />
         <item itemvalue="Python.q23" />
         <item itemvalue="Python.multi_thread_test" />
         <item itemvalue="Python.123" />
         <item itemvalue="Python.yolo_test_docker" />
-        <item itemvalue="Python.yolo_test_handler" />
       </list>
     </recent_temporary>
   </component>
@@ -218,6 +211,11 @@
       <workItem from="1646114239289" duration="17703000" />
       <workItem from="1646185096865" duration="3852000" />
       <workItem from="1646189002277" duration="76763000" />
+      <workItem from="1646616500010" duration="54000" />
+      <workItem from="1646616567009" duration="18000" />
+      <workItem from="1646616597837" duration="122000" />
+      <workItem from="1646720875499" duration="1923000" />
+      <workItem from="1647392635005" duration="77000" />
     </task>
     <task id="LOCAL-00001" summary="first commit">
       <created>1646185575550</created>
@@ -233,7 +231,21 @@
       <option name="project" value="LOCAL" />
       <updated>1646297168339</updated>
     </task>
-    <option name="localTasksCounter" value="3" />
+    <task id="LOCAL-00003" summary="fix the python environment path problem">
+      <created>1646721847123</created>
+      <option name="number" value="00003" />
+      <option name="presentableId" value="LOCAL-00003" />
+      <option name="project" value="LOCAL" />
+      <updated>1646721847123</updated>
+    </task>
+    <task id="LOCAL-00004" summary="fix the python environment path problem">
+      <created>1646721943494</created>
+      <option name="number" value="00004" />
+      <option name="presentableId" value="LOCAL-00004" />
+      <option name="project" value="LOCAL" />
+      <updated>1646721943494</updated>
+    </task>
+    <option name="localTasksCounter" value="5" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -274,10 +286,12 @@
         <entry key="7fa0cafa-346f-4108-8391-ef5b1a6ab08f" value="TOOL_WINDOW" />
       </map>
     </option>
+    <option name="oldMeFiltersMigrated" value="true" />
   </component>
   <component name="VcsManagerConfiguration">
     <MESSAGE value="first commit" />
-    <option name="LAST_COMMIT_MESSAGE" value="first commit" />
+    <MESSAGE value="fix the python environment path problem" />
+    <option name="LAST_COMMIT_MESSAGE" value="fix the python environment path problem" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>
@@ -295,7 +309,7 @@
     <SUITE FILE_PATH="coverage/server_develop$object_detector_handler.coverage" NAME="object_detector_handler Coverage Results" MODIFIED="1646188921658" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/code/src" />
     <SUITE FILE_PATH="coverage/server_develop$123.coverage" NAME="123 Coverage Results" MODIFIED="1646289968940" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
     <SUITE FILE_PATH="coverage/server_develop$yolo_test_handler__1_.coverage" NAME="yolo_test_handler Coverage Results" MODIFIED="1646290847557" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src_code/test/test_src" />
-    <SUITE FILE_PATH="coverage/server_develop$yolo_test_handler.coverage" NAME="yolo_test_handler Coverage Results" MODIFIED="1646189020877" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/code/test/test_src" />
+    <SUITE FILE_PATH="coverage/server_develop$yolo_test_handler.coverage" NAME="yolo_test_handler Coverage Results" MODIFIED="1646721642597" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src_code/test/test_src" />
     <SUITE FILE_PATH="coverage/server_develop$q23.coverage" NAME="q23 Coverage Results" MODIFIED="1646322674165" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
     <SUITE FILE_PATH="coverage/server_develop$method_parser.coverage" NAME="method_parser Coverage Results" MODIFIED="1646115981351" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/code/src/server_utils" />
     <SUITE FILE_PATH="coverage/server_develop$yolo_test_docker.coverage" NAME="yolo_test_docker Coverage Results" MODIFIED="1646323214508" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src_code/test/test_src" />

+ 3 - 0
src_code/src/object_detector_handler.py

@@ -62,7 +62,10 @@ class ObjectDetectionHandler(BasicModelHandler):
         - input_source: base64(image)
         - output_methods: parse prediction for formatting return prediction result
         """
+        logging.info("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ row_data"+str(row_data) )
+
         data = row_data[0]
+        logging.info("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ data"+str(data) )
         input_data = data.get("data")
         assert input_data is not None, "get input_data(request info) is None"
         output_methods = eval(data.get("output_methods", []).decode(encoding='utf-8'))

+ 1 - 1
src_code/src/server_utils/image_convert.py

@@ -5,7 +5,7 @@
 # @File : image_convert.py
 # @Project : server_develop
 
-import cv2
+
 import pybase64
 from PIL import Image
 from io import BytesIO

+ 16 - 4
src_code/test/test_src/yolo_test_handler.py

@@ -7,8 +7,19 @@
 
 import sys
 import os
-print(os.getcwd())
-sys.path.append("../../src")
+root_src = "../../src"
+
+
+
+def import_env(names):
+    for name in names:
+        sys.path.append(os.path.join(os.getcwd(), name))
+
+
+append_path = ["../../src/server_utils", "../../src/", "../../src/model_structure",
+               "../../src/model_structure/yolov5_structure/yolov5-master"]
+
+import_env(append_path)
 from server_utils.image_convert import path2base64
 from object_detector_handler import ObjectDetectionHandler
 
@@ -18,8 +29,9 @@ def main():
     test_source = "../test_images/test1.jpg"
     base64str = path2base64(test_source)
     context = None
-    output_methods = ["pd_xywh_json", "pd_xywhn", "pd_xyxy", "pd_xyxyn", "tolist", "crop_np", "crop_base64",
-                      "detail_time_info", "render_base64"]
+    # , "pd_xywhn", "pd_xyxy", "pd_xyxyn", "tolist", "crop_np", "crop_base64",
+    #                       "detail_time_info", "render_base64"
+    output_methods = ["pd_xywh_json"]
     obh = ObjectDetectionHandler()
     data = {"data": base64str, "output_methods": str(output_methods).encode(), "base64_bool": str(True).encode()}
     result = obh.handle([data], context)