Commit a80ff051 authored by myhloli's avatar myhloli
Browse files

refactor(model): remove unused YOLO v11 language detection model

- Remove YOLO v11 language detection model from model_configs.yaml
- Update language detection utils to use a fixed model path instead of dynamic configuration
- Remove unused model weight parameter for YOLO v11 language detection
parent b06a1f2b
...@@ -24,11 +24,11 @@ def get_model_config(): ...@@ -24,11 +24,11 @@ def get_model_config():
config_path = os.path.join(model_config_dir, 'model_configs.yaml') config_path = os.path.join(model_config_dir, 'model_configs.yaml')
with open(config_path, 'r', encoding='utf-8') as f: with open(config_path, 'r', encoding='utf-8') as f:
configs = yaml.load(f, Loader=yaml.FullLoader) configs = yaml.load(f, Loader=yaml.FullLoader)
return local_models_dir, device, configs return root_dir, local_models_dir, device, configs
def get_text_images(simple_images): def get_text_images(simple_images):
local_models_dir, device, configs = get_model_config() _, local_models_dir, device, configs = get_model_config()
atom_model_manager = AtomModelSingleton() atom_model_manager = AtomModelSingleton()
temp_layout_model = atom_model_manager.get_atom_model( temp_layout_model = atom_model_manager.get_atom_model(
atom_model_name=AtomicModel.Layout, atom_model_name=AtomicModel.Layout,
...@@ -69,15 +69,11 @@ def model_init(model_name: str): ...@@ -69,15 +69,11 @@ def model_init(model_name: str):
atom_model_manager = AtomModelSingleton() atom_model_manager = AtomModelSingleton()
if model_name == MODEL_NAME.YOLO_V11_LangDetect: if model_name == MODEL_NAME.YOLO_V11_LangDetect:
local_models_dir, device, configs = get_model_config() root_dir, _, device, _ = get_model_config()
model = atom_model_manager.get_atom_model( model = atom_model_manager.get_atom_model(
atom_model_name=AtomicModel.LangDetect, atom_model_name=AtomicModel.LangDetect,
langdetect_model_name=MODEL_NAME.YOLO_V11_LangDetect, langdetect_model_name=MODEL_NAME.YOLO_V11_LangDetect,
langdetect_model_weight=str( langdetect_model_weight=str(os.path.join(root_dir, 'resources', 'yolov11-langdetect', 'yolo_v11_ft.pt')),
os.path.join(
local_models_dir, configs['weights'][MODEL_NAME.YOLO_V11_LangDetect]
)
),
device=device, device=device,
) )
else: else:
......
...@@ -5,5 +5,4 @@ weights: ...@@ -5,5 +5,4 @@ weights:
unimernet_small: MFR/unimernet_small unimernet_small: MFR/unimernet_small
struct_eqtable: TabRec/StructEqTable struct_eqtable: TabRec/StructEqTable
tablemaster: TabRec/TableMaster tablemaster: TabRec/TableMaster
rapid_table: TabRec/RapidTable rapid_table: TabRec/RapidTable
yolo_v11n_langdetect: LangDetect/YOLO/yolo_v11_ft.pt \ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment