admin管理员组

文章数量:1123854

I am working on a task that involves analyzing floor plans using multimodal AI models (e.g., Google Gemini) to extract structured information such as the location of entry points, bedrooms, and other key features.

However, there is a challenge with detecting the directional orientation in the floor plan.

Here’s an example floor plan image:

In the bottom right corner, there is a direction indicator showing North (N) with an arrow pointing upwards. As humans, we can easily understand that North is pointing upward, and we can adjust our interpretation of the floor plan accordingly. However, when using an AI model to process the image, the model cannot read the "N" label or understand the arrow direction, which results in incorrect orientation analysis.

To address this issue, I attempted to use PaddleOCR to detect text in the image and annotate it. The code I used is provided below from paddleocr import PaddleOCR, draw_ocr from PIL import Image

# Initialize PaddleOCR
ocr = PaddleOCR(use_angle_cls=True, lang='en')  # Download and load the model once

# Provide the image path
img_path = 'prop_1.png'

# Perform OCR
result = ocr.ocr(img_path, cls=True)

# Print the result
for idx in range(len(result)):
    res = result[idx]
    for line in res:
        print(line)

The OCR output successfully detects text labels like "Bedroom," "Kitchen," "Living," etc., but fails to detect the "N" label and the arrow pointing upwards that indicates the direction.

本文标签: pythonHow to detect North Arrow on a floor planStack Overflow