AnlaAnla 3 долоо хоног өмнө
parent
commit
ce4db4b849

BIN
Model/pokemon_back_face_defect.pth


BIN
Model/pokemon_front_face_no_reflect_defect.pth


BIN
Model/pokemon_front_face_reflect_defect.pth


+ 81 - 1
README.MD

@@ -10,4 +10,84 @@ python run.py
 
 磨损: 1: 'wear', 2: 'wear_and_impact', 5: 'wear_and_stain',
 
-缺失: 3: 'impact', 4: 'damaged', 
+缺失: 3: 'impact', 4: 'damaged', 
+
+
+## 分数配置信息备注
+```text
+base_score: 基础分数
+
+corner: 角
+    rule: 分数规则
+        wear_area:"磨损的扣分规则"
+        loss_area: "缺失的扣分规则"
+    front_weights: "正面的权重分配"
+        wear_area:"-权重"
+        loss_area:"-权重"
+    back_weights: "背面的权重分配"
+        ...
+        ...
+    final_weights: "最终权重分配"
+        front: "正面权重"
+        back: "背面权重"
+
+edge: 边
+    ...与 corner 类似
+    
+face: 面
+    rule: 分数规则
+        wear_area: 磨损
+        pit_area: 凹坑
+        stain_area: 污渍
+        scratch_length: 划痕长度(!注意只有它看长度, 其他的看面积)
+    coefficients: 权重分配
+        ...这里是几种缺陷对应的权重
+    final_weights: "最终权重分配"
+        ...
+
+centering: 居中
+    front: 正面
+        rules: 规则
+    coefficients: 权重分配
+        horizontal: 水平
+        vertical: 上下
+    back: 背面
+        ...
+    final_weights: "最终权重分配"
+        ...
+
+card: 卡片
+    PSA: 卡的类型, 默认用它
+        ...不同类型的权重最后分配
+```
+
+### 分数规则详解
+```
+举例说明:
+
+    "wear_area": [
+        [
+        面积小于 0.05 平方毫米就扣0.1分
+          0.05,
+          -0.1
+        ],
+        面积在 0.05-0.1之间扣0.5分
+        [
+          0.1,
+          -0.5
+        ],
+        [
+          0.25,
+          -1.5
+        ],
+        [
+          0.5,
+          -3.0
+        ],
+        [
+        面积大于 0.5平方毫米扣 5分
+          "inf",
+          -5.0
+        ]
+      ],
+```

+ 9 - 9
app/core/config.py

@@ -31,11 +31,14 @@ class Settings:
     '''
     face: "1": "wear", "2": "scratch", "3": "stain",
         "4": "scuff", "5": "impact", "6": "damaged",
-        "7": "wear_and_impact"
-        "8": "stain", "9": "pit"
+        "7": "wear_and_impact", "8": "pit"
     
     corner: "1": "wear", "2": "wear_and_impact", "3": "damaged",
                            "4": "impact", "5": "wear_and_stain"
+    
+    
+    简化版本: 边和角: wear, impact, damaged
+            面: wear, scratch, pit, impact, stain 
     '''
     CARD_MODELS_CONFIG: Dict[str, CardModelConfig] = {
         "outer_box": {
@@ -78,31 +81,28 @@ class Settings:
         },
         "pokemon_front_face_reflect_defect": {
             "pth_path": "Model/pokemon_front_face_reflect_defect.pth",
-            "class_dict": {"1": "stain", "2": "scratch", "3": "impact", "4": "wear"},
+            "class_dict": {"1": "stain","2": "scratch","3": "impact","4": "wear","5": "wear"},
             "img_size": {'width': 512, 'height': 512},
             "confidence": 0.5,
             "input_channels": 3,
         },
         "pokemon_front_corner_reflect_defect": {
             "pth_path": "Model/pokemon_front_corner_reflect_defect.pth",
-            "class_dict": {"1": "impact", "2": "wear_and_impact", "3": "wear"},
+            "class_dict": {"1": "impact","2": "wear_and_impact","3": "wear"},
             "img_size": {'width': 512, 'height': 512},
             "confidence": 0.5,
             "input_channels": 3,
         },
         "pokemon_front_corner_no_reflect_defect": {
             "pth_path": "Model/pokemon_front_corner_no_reflect_defect.pth",
-            "class_dict": {"1": "wear", "2": "wear_and_impact", "3": "impact",
-                           "4": "damaged", "5": "stain"},
+            "class_dict": {"1": "wear","2": "wear_and_impact","3": "impact","4": "damaged","5": "stain"},
             "img_size": {'width': 512, 'height': 512},
             "confidence": 0.5,
             "input_channels": 3,
         },
         "pokemon_front_face_no_reflect_defect": {
             "pth_path": "Model/pokemon_front_face_no_reflect_defect.pth",
-            "class_dict": {"1": "scratch", "2": "wear", "3": "stain", "4": "damaged",
-                           "5": "impact", "6": "wear_and_impact",
-                           "7": "chip", "8": "protrudent", "9": "wear_and_stain"},
+            "class_dict": {"1": "scratch", "2": "wear", "3": "stain", "4": "damaged", "5": "impact"},
             "img_size": {'width': 512, 'height': 512},
             "confidence": 0.5,
             "input_channels": 3,