更新代码结构

This commit is contained in:
yuruo
2025-03-06 16:39:52 +08:00
parent d793055105
commit af4a5bf3e4
5 changed files with 0 additions and 341 deletions

View File

@@ -1,4 +1,3 @@
import os
import subprocess
from pathlib import Path

View File

@@ -8,7 +8,6 @@ class Omniparser(object):
def __init__(self, config: Dict):
self.config = config
device = 'cuda' if torch.cuda.is_available() else 'cpu'
self.som_model = get_yolo_model(model_path=config['som_model_path'])
self.caption_model_processor = get_caption_model_processor(model_name=config['caption_model_name'], model_name_or_path=config['caption_model_path'], device=device)
print('Omniparser initialized!')

View File

@@ -1,6 +1,4 @@
import os
import logging
import argparse
import shlex
import subprocess
import threading
@@ -31,7 +29,6 @@ def execute_command(command, shell=False):
'returncode': result.returncode
}
except Exception as e:
logger.error("\n" + traceback.format_exc() + "\n")
return {
'status': 'error',
'message': str(e)