AnlaAnla 1 тиждень тому
батько
коміт
08fc6fc1a5
2 змінених файлів з 166 додано та 26 видалено
  1. 165 25
      app/core/scoring_config.json
  2. 1 1
      app/utils/score_inference/CardScorer.py

+ 165 - 25
app/core/scoring_config.json

@@ -6,54 +6,174 @@
         {
           "min": 0,
           "max": 0.01,
-          "deduction": -0.1
+          "deduction": -0.01
         },
         {
           "min": 0.01,
+          "max": 0.05,
+          "deduction": -0.1
+        },
+        {
+          "min": 0.05,
           "max": 0.1,
-          "deduction": -0.5
+          "deduction": -0.2
         },
         {
           "min": 0.1,
           "max": 0.25,
-          "deduction": -1.5
+          "deduction": -0.5
         },
         {
           "min": 0.25,
           "max": 0.5,
-          "deduction": -3
+          "deduction": -1
         },
         {
           "min": 0.5,
-          "max": "inf",
+          "max": 0.75,
+          "deduction": -1.5
+        },
+        {
+          "min": 0.75,
+          "max": 1,
+          "deduction": -2
+        },
+        {
+          "min": 1,
+          "max": 1.5,
+          "deduction": -2.5
+        },
+        {
+          "min": 1.5,
+          "max": 2,
+          "deduction": -3
+        },
+        {
+          "min": 2,
+          "max": 2.5,
+          "deduction": -3.5
+        },
+        {
+          "min": 2.5,
+          "max": 3,
+          "deduction": -4
+        },
+        {
+          "min": 3,
+          "max": 3.5,
+          "deduction": -4.5
+        },
+        {
+          "min": 3.5,
+          "max": 4,
           "deduction": -5
+        },
+        {
+          "min": 4,
+          "max": 5,
+          "deduction": -5.5
+        },
+        {
+          "min": 5,
+          "max": 6,
+          "deduction": -6
+        },
+        {
+          "min": 6,
+          "max": 7,
+          "deduction": -6.5
+        },
+        {
+          "min": 7,
+          "max": "inf",
+          "deduction": -7
         }
       ],
       "loss_area": [
         {
           "min": 0,
+          "max": 0.01,
+          "deduction": -0.01
+        },
+        {
+          "min": 0.01,
           "max": 0.05,
           "deduction": -0.1
         },
         {
           "min": 0.05,
           "max": 0.1,
-          "deduction": -0.5
+          "deduction": -0.2
         },
         {
           "min": 0.1,
           "max": 0.25,
-          "deduction": -1.5
+          "deduction": -0.5
         },
         {
           "min": 0.25,
           "max": 0.5,
-          "deduction": -3
+          "deduction": -1
         },
         {
           "min": 0.5,
-          "max": "inf",
+          "max": 0.75,
+          "deduction": -1.5
+        },
+        {
+          "min": 0.75,
+          "max": 1,
+          "deduction": -2
+        },
+        {
+          "min": 1,
+          "max": 1.5,
+          "deduction": -2.5
+        },
+        {
+          "min": 1.5,
+          "max": 2,
+          "deduction": -3
+        },
+        {
+          "min": 2,
+          "max": 2.5,
+          "deduction": -3.5
+        },
+        {
+          "min": 2.5,
+          "max": 3,
+          "deduction": -4
+        },
+        {
+          "min": 3,
+          "max": 3.5,
+          "deduction": -4.5
+        },
+        {
+          "min": 3.5,
+          "max": 4,
           "deduction": -5
+        },
+        {
+          "min": 4,
+          "max": 5,
+          "deduction": -5.5
+        },
+        {
+          "min": 5,
+          "max": 6,
+          "deduction": -6
+        },
+        {
+          "min": 6,
+          "max": 7,
+          "deduction": -6.5
+        },
+        {
+          "min": 7,
+          "max": "inf",
+          "deduction": -7
         }
       ],
       "pit_area": [
@@ -157,8 +277,8 @@
       "loss_area": 1
     },
     "final_weights": {
-      "front": 1.4,
-      "back": 0.6
+      "front": 0.7,
+      "back": 0.3
     }
   },
   "edge": {
@@ -318,8 +438,8 @@
       "loss_area": 1.2
     },
     "final_weights": {
-      "front": 1.4,
-      "back": 0.6
+      "front": 0.7,
+      "back": 0.3
     }
   },
   "face": {
@@ -588,19 +708,29 @@
       "scratch_length": [
         {
           "min": 0,
-          "max": 1,
+          "max": 0.1,
           "deduction": -0.1
         },
         {
-          "min": 1,
-          "max": 2,
+          "min": 0.1,
+          "max": 0.5,
+          "deduction": -0.25
+        },
+        {
+          "min": 0.5,
+          "max": 1,
           "deduction": -0.5
         },
         {
-          "min": 2,
-          "max": 5,
+          "min": 1,
+          "max": 2.5,
           "deduction": -1
         },
+        {
+          "min": 2.5,
+          "max": 5,
+          "deduction": -1.5
+        },
         {
           "min": 5,
           "max": 10,
@@ -609,15 +739,25 @@
         {
           "min": 10,
           "max": 20,
-          "deduction": -3
+          "deduction": -2.5
         },
         {
           "min": 20,
-          "max": 50,
+          "max": 40,
+          "deduction": -3
+        },
+        {
+          "min": 40,
+          "max": 60,
+          "deduction": -3.5
+        },
+        {
+          "min": 60,
+          "max": 80,
           "deduction": -4
         },
         {
-          "min": 50,
+          "min": 80,
           "max": "inf",
           "deduction": -5
         }
@@ -634,8 +774,8 @@
       "coaxial_weight": 0.2
     },
     "final_weights": {
-      "front": 1.5,
-      "back": 0.5
+      "front": 0.75,
+      "back": 0.25
     }
   },
   "centering": {
@@ -786,8 +926,8 @@
       }
     },
     "final_weights": {
-      "front": 0.75,
-      "back": 0.25
+      "front": 1.5,
+      "back": 0.5
     }
   },
   "severity_level": {

+ 1 - 1
app/utils/score_inference/CardScorer.py

@@ -202,7 +202,7 @@ class CardScorer:
                     # 多次修改
                     # if defect["new_score"] != the_score:
                     #     defect["score"] = defect["new_score"]
-                    if defect.get("edit_type") == "edit":
+                    if defect.get("edit_type") == "edit" or defect.get("edit_type") == "add":
                         defect["new_score"] = the_score
                     elif defect.get("edit_type") == "del":
                         logger.info(f"del {defect_type} 补回: {the_score}")