Skip to content

ZXWCAX/PMI-rec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Step 1: Clone the Repository

git clone https://github.com/ZXWCAX/PMI-rec.git
cd PMI-rec
git lfs pull

Step 2: Set Up the Environment

conda create -n PMI python=3.12
conda activate PMI
pip install opencv-python pandas Pillow pyclipper Shapely tqdm openai numpy openai openpyxl scikit-image matplotlib

Note: If you are only using CPU for inference:

pip install onnxruntime

if using gpu for inference:

pip install onnxruntime-gpu

Step 3: inference

python detect.py


EX.1: Change the ED

Modify line 11 of detect.py:

raw_img_path = 'test_image/2025-A-1-4706.png'

EX.2: Change the providers

Modify line 88 of detect.py: CPU:

providers = ['CPUExecutionProvider']

GPU:

providers = ['CUDAExecutionProvider']

EX.3: General PMI

Configure your own MLLM API key or set raw_img_path to False to disable General PMI recognition from line 11 to line 18.

General_PMI_mllm_det = True
client = OpenAI(
    api_key="XX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
)
mllm_model_name = "qwen-vl-max"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages