Spaces:
Sleeping
Sleeping
|
Download README.md from cooldan/SPaCial_server_api: direct link, hf CLI and curl.
- Browser
- Download file 3.53 kB
-
https://huggingface.co/spaces/cooldan/SPaCial_server_api/resolve/main/README.md
- Command line
-
hf download hf://spaces/cooldan/SPaCial_server_api/README.md
-
curl -L -o README.md https://huggingface.co/spaces/cooldan/SPaCial_server_api/resolve/main/README.md
3.53 kB
metadata
title: SPaCial AI OCR Service
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
sdk_version: 4.21.0
app_file: app.py
pinned: false
license: mit
SPaCial AI OCR Service π
Advanced OCR service using PaddleOCR for dimension detection in technical drawings. Perfect for extracting measurements, tolerances, and text from engineering drawings.
π Features
- High-Accuracy OCR: Uses PaddleOCR with multiple detection modes
- Dimension Detection: Automatically identifies measurements and tolerances
- Vertical Text Support: Handles rotated text (90Β°, 180Β°, 270Β°)
- Interactive Canvas: Draw rectangles or click to detect text
- Real-time Processing: Fast and efficient text extraction
- Multiple Modes: Fast, accurate, and hardcore detection modes
π― How to Use
1. Upload an Image
- Click "Choose File" to upload a technical drawing
- Supported formats: JPG, PNG, WebP
2. Auto-Detection
- The system automatically detects all text zones
- Each zone shows confidence percentage and rotation angle
3. Manual Selection
- Double-click: Click on any text to detect it precisely
- Draw Rectangle: Drag to draw a rectangle around text for better detection
4. Zone Management
- Rotate: Click the rotate button to improve vertical text detection
- Fit: Click thumbnail to re-OCR with better accuracy
- Delete: Remove unwanted zones
π§ API Endpoints
Process Image
POST /ocr/process
- file: Image file
- mode: "fast", "accurate", or "hardcore"
- rotation: 0, 90, 180, 270 degrees
Process Center Point
POST /ocr/process-center
- image: Base64 encoded image
- center_point: {"x": x, "y": y}
- rectangle_bounds: {"x1": x1, "y1": y1, "x2": x2, "y2": y2}
- use_rectangle: true/false
- rotation: rotation angle
π οΈ Technical Details
Detection Modes
- Fast: Quick detection for position finding
- Accurate: Balanced speed and accuracy
- Hardcore: Maximum accuracy with preprocessing
Vertical Text Handling
- Automatic detection of vertical text regions
- 90Β° rotation for better OCR accuracy
- Proper coordinate mapping back to original image
Text Correction
- Built-in correction rules for common OCR errors
- Tolerance parsing for engineering measurements
- Dimension validation and formatting
π Performance
- Processing Time: 1-3 seconds per image
- Accuracy: 95%+ for clear technical drawings
- Supported Languages: English (optimized for numbers and dimensions)
- Image Size: Up to 10MB, auto-resized for processing
π Use Cases
- Engineering Drawings: Extract dimensions and tolerances
- Technical Documentation: Digitize handwritten measurements
- Quality Control: Verify measurements on drawings
- CAD Integration: Convert scanned drawings to digital data
π¨ Troubleshooting
Common Issues
- Low Confidence: Try "hardcore" mode or draw a rectangle around text
- Vertical Text: Use the rotate button to improve detection
- Split Text: Draw a rectangle to capture the full text
- Small Text: Ensure image resolution is sufficient
Tips for Best Results
- Use high-contrast images
- Ensure text is clearly visible
- For vertical text, use the rotate feature
- Draw rectangles around complex text regions
π License
This project is part of the SPaCial AI system for technical drawing analysis.
Ready to extract text from your technical drawings? Upload an image and start detecting! π―