|
|
@@ -28,15 +28,22 @@ class Settings:
|
|
|
# 使用一个字典来管理所有卡片检测模型
|
|
|
# key (如 'outer_box') 将成为 API 路径中的 {inference_type}
|
|
|
CARD_MODELS_CONFIG: Dict[str, CardModelConfig] = {
|
|
|
- "pokemon_outer_box": {
|
|
|
- "pth_path": "Model/pokemon_outer_box.pth",
|
|
|
+ "outer_box": {
|
|
|
+ "pth_path": "Model/outer_box.pth",
|
|
|
"class_dict": {1: 'outer_box'},
|
|
|
"img_size": {'width': 1280, 'height': 1280},
|
|
|
"confidence": 0.5,
|
|
|
"input_channels": 3,
|
|
|
},
|
|
|
- "pokemon_inner_box": {
|
|
|
- "pth_path": "Model/pokemon_inner_box.pth",
|
|
|
+ "pokemon_front_inner_box": {
|
|
|
+ "pth_path": "Model/pokemon_front_inner_box.pth",
|
|
|
+ "class_dict": {1: 'inner_box'},
|
|
|
+ "img_size": {'width': 1280, 'height': 1280},
|
|
|
+ "confidence": 0.5,
|
|
|
+ "input_channels": 3,
|
|
|
+ },
|
|
|
+ "pokemon_back_inner_box": {
|
|
|
+ "pth_path": "Model/pokemon_back_inner_box.pth",
|
|
|
"class_dict": {1: 'inner_box'},
|
|
|
"img_size": {'width': 1280, 'height': 1280},
|
|
|
"confidence": 0.5,
|
|
|
@@ -52,6 +59,23 @@ class Settings:
|
|
|
"confidence": 0.5,
|
|
|
"input_channels": 3,
|
|
|
},
|
|
|
+ "pokemon_back_face_defect": {
|
|
|
+ "pth_path": "Model/pokemon_back_face_defect.pth",
|
|
|
+ "class_dict": {"1": "wear", "2": "scratch", "3": "stain",
|
|
|
+ "4": "scuff", "5": "impact", "6": "damaged",
|
|
|
+ "7": "wear_and_impact"},
|
|
|
+ "img_size": {'width': 512, 'height': 512},
|
|
|
+ "confidence": 0.5,
|
|
|
+ "input_channels": 3,
|
|
|
+ },
|
|
|
+ "pokemon_front_face_reflect_defect": {
|
|
|
+ "pth_path": "Model/pokemon_front_face_reflect_defect.pth",
|
|
|
+ "class_dict": {"1": "scratch", "2": "stain", "3": "wear",
|
|
|
+ "4": "impact", "5": "stain_and_scratch"},
|
|
|
+ "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"},
|
|
|
@@ -61,14 +85,16 @@ class Settings:
|
|
|
},
|
|
|
"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"},
|
|
|
+ "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": "pit", "3": "stain"},
|
|
|
+ "class_dict": {"1": "wear", "2": "scratch", "3": "damaged",
|
|
|
+ "4": "stain", "5": "impact", "6": "pit"},
|
|
|
"img_size": {'width': 512, 'height': 512},
|
|
|
"confidence": 0.5,
|
|
|
"input_channels": 3,
|
|
|
@@ -78,9 +104,16 @@ class Settings:
|
|
|
# 包含, 环形光居中计算, 环形光正反边角缺陷, 同轴光正反表面缺陷
|
|
|
# 里面存储需要用到的模型类型
|
|
|
DEFECT_TYPE: Dict[str, dict] = {
|
|
|
- "pokemon_card_center": {
|
|
|
- "inner_box": "pokemon_inner_box",
|
|
|
- "outer_box": "pokemon_outer_box",
|
|
|
+ "pokemon_front_card_center": {
|
|
|
+ "inner_box": "pokemon_front_inner_box",
|
|
|
+ "outer_box": "outer_box",
|
|
|
+ },
|
|
|
+ "pokemon_back_card_center": {
|
|
|
+ "inner_box": "pokemon_back_inner_box",
|
|
|
+ "outer_box": "outer_box",
|
|
|
+ },
|
|
|
+ "pokemon_back_face_defect": {
|
|
|
+ 'model_type': "pokemon_back_face_defect"
|
|
|
},
|
|
|
"pokemon_back_corner_defect": {
|
|
|
'model_type': "pokemon_back_corner_defect"
|